Hello everybody,
I am having a problem with including header file. The problem is stated below:
file a.h
file a.c
file main.c
#include "a.h"
The problem with the above three file is while i compile its okay. but when i try to link(create exe) it failed. The caused error is solid is already defined in a.obj. and linking failed. I also tried this in a.h
file a.h
It was not helpful either.
Advance thanks for the solution..
regards,
johny
I am having a problem with including header file. The problem is stated below:
file a.h
Code:
struct __solid { char s[100]; }solid; bool initsolid();
Code:
bool initsolid() { solid.s="johny"; }
#include "a.h"
Code:
int main() { initsolid(); }
file a.h
Code:
#ifndef a_h #define a_h struct __solid { char s[100]; }solid; bool initsolid(); #endif
Advance thanks for the solution..
regards,
johny
Comment