A
alan
Dear all,
I have written my own function by C. And my development platform is
W2k with VC6.0.
Then I also defined a header file to extern declare this function.
After that, I include this header file.
The function is stored in C:\temp\myfun.c
int func(){
return 1;
}
The header file is stored in C:\temp\myheader.h
extern int func(void);
in my main program, I got a problem if I include this header file
(myheader.h).
#include <stdio.h>
#include "C:\temp\myheader.h"
void main(){
func();
}
This main program is not in c:\temp\ folder.
The error message is {
--------------------Configuration: pureC_test - Win32
Debug--------------------
Compiling...
main.c
Linking...
main.obj : error LNK2001: unresolved external symbol _func
Debug/pureC_test.exe : fatal error LNK1120: 1 unresolved externals
Error executing link.exe.
Creating browse info file...
pureC_test.exe - 2 error(s), 0 warning(s)
}
BUT if I copy the myfun.c & myheader.h in the same path as the main
program. It works fine.
Can anybody help me to solve this problem??
Thank you very much.
Alan
I have written my own function by C. And my development platform is
W2k with VC6.0.
Then I also defined a header file to extern declare this function.
After that, I include this header file.
The function is stored in C:\temp\myfun.c
int func(){
return 1;
}
The header file is stored in C:\temp\myheader.h
extern int func(void);
in my main program, I got a problem if I include this header file
(myheader.h).
#include <stdio.h>
#include "C:\temp\myheader.h"
void main(){
func();
}
This main program is not in c:\temp\ folder.
The error message is {
--------------------Configuration: pureC_test - Win32
Debug--------------------
Compiling...
main.c
Linking...
main.obj : error LNK2001: unresolved external symbol _func
Debug/pureC_test.exe : fatal error LNK1120: 1 unresolved externals
Error executing link.exe.
Creating browse info file...
pureC_test.exe - 2 error(s), 0 warning(s)
}
BUT if I copy the myfun.c & myheader.h in the same path as the main
program. It works fine.
Can anybody help me to solve this problem??
Thank you very much.
Alan