Any clarification would be appreciated...
The library that I'm trying to link to has been compiled in MSVC.
I read in the G++ FAQ (in the MinGW documentation) about "Why can't I link
g++-compiled programs against libraries compiled by some other C++
compiler?". Does this situation only apply to c++ files/libraries or does
it also apply to c files/libraries?
OTOH, my problem may be ignorance about how to use gcc to perform linking.
My makefile is as follows;
>>>>
#makefile
mine.exe : mine.o
gcc -mconsole -o mine.exe mine.o foo.lib
mine.o : mine.c makefile foo.h
gcc -c -o mine.o mine.c
<<<<
All files are stored in C:\temp\
the function A_Register is defined is foo.h as follows
__declspec( dllimport ) AHANDLE A_Register (char* pHost,
int iPort,
char* pAppName,
char* pClientDesc);
The result of a 'make' is as follows;
>>>>
C:\TEMP>make
gcc -c -o mine.o mine.c
gcc -mconsole -o mine.exe mine.o foo.lib
mine.o(.text+0xea):mine.c: undefined reference to `_imp__A_Register'
make: *** [mine.exe] Error 1
<<<<
TIA,
VB
|