>>Check the header file to
>>see if there is something like: extern "C" {... .
I include with this email the mysql.h header file. It seems that
there's this extern "C" { you mentioned there.
Please take a look at the functions definitions (the mingw compiler
doesn't complain about the struct definitions in this header file such as
"MYSQL" but does complein about the function definitions such as
"mysql_error"):
There's the keyword STDCALL defined previously in the header at:
#if !defined(__WIN__)
#define STDCALL
#else
#define STDCALL __stdcall
#endif
Could the problem be with this STDCALL?
Thanks again,
Josep
-----Urspr=FCngliche Nachricht-----
Von: Jan Ringos [mailto:tr...@mx...]
Gesendet: Sonntag, 7. M=E4rz 2004 17:20
An: Josep Subirana
Betreff: Re: [Dev-C++] Trying to link libmysqld.lib
Hey Josep.
It seems that the libmysqld uses different name mangling and so Mingw can=
not
find the symbols. Check the header file to
see if there is something like: extern "C" {... .
If not, try to add these lines. (check other header files to see how).
And/or maybe the calling convention will need to be specified.
---
Jan Ringos, Tr...@mx...
http://tringi.mx-3.cz
senior programmer-analyst
n.v.t. MX-3, www.mx-3.cz
----- Original Message -----
From: "Josep Subirana" <sub...@ar...>
To: "DEV-C++" <dev...@li...>
Sent: Sunday, March 07, 2004 10:25 AM
Subject: [Dev-C++] Trying to link libmysqld.lib
> Hi,
>
> I've got the library libmysqld.lib which links under MS VC++ without
> problem.
> But when I try to compile the same files + lib with Dev-C++ I get the
Linker
> Error
> below... What am I doing wrong???
>
> Thanks,
> Josep
>
> ----------------------------------------------------
>
> Compiler: Default compiler
> Building Makefile: "E:\c++\mysql\devc++\Makefile.win"
> Executing make...
> make.exe -f "E:\c++\mysql\devc++\Makefile.win" all
> g++.exe EXE/test_dll.o EXE/StdAfx.o -o
> "EXE\test_dll.exe" -L"C:/Programme/Dev-Cpp/lib" release/libmysqld.lib
>
> EXE/test_dll.o(.text+0x79):test_dll.cpp: undefined reference to
> `mysql_server_init@12'
> EXE/test_dll.o(.text+0xd0):test_dll.cpp: undefined reference to
> `mysql_close@4'
> EXE/test_dll.o(.text+0xde):test_dll.cpp: undefined reference to
> `mysql_close@4'
> EXE/test_dll.o(.text+0xe6):test_dll.cpp: undefined reference to
> `mysql_server_end@0'
>
> EXE/test_dll.o(.text+0x1aa):test_dll.cpp: undefined reference to
> `mysql_init@4'
> EXE/test_dll.o(.text+0x1db):test_dll.cpp: undefined reference to
> `mysql_options@12'
> EXE/test_dll.o(.text+0x1f5):test_dll.cpp: undefined reference to
> `mysql_real_connect@32'
>
> EXE/test_dll.o(.text+0x207):test_dll.cpp: undefined reference to
> `mysql_error@4'
> EXE/test_dll.o(.text+0x231):test_dll.cpp: undefined reference to
> `mysql_close@4'
> EXE/test_dll.o(.text+0x288):test_dll.cpp: undefined reference to
> `mysql_query@8'
> EXE/test_dll.o(.text+0x29f):test_dll.cpp: undefined reference to
> `mysql_field_count@4'
> EXE/test_dll.o(.text+0x2b5):test_dll.cpp: undefined reference to
> `mysql_store_result@4'
> EXE/test_dll.o(.text+0x2d1):test_dll.cpp: undefined reference to
> `mysql_num_fields@4'
> EXE/test_dll.o(.text+0x2e2):test_dll.cpp: undefined reference to
> `mysql_fetch_row@4'
> EXE/test_dll.o(.text+0x392):test_dll.cpp: undefined reference to
> `mysql_affected_rows@4'
> EXE/test_dll.o(.text+0x3b4):test_dll.cpp: undefined reference to
> `mysql_error@4'
>
> make.exe: *** [EXE/test_dll.exe] Error 1
>
> Execution terminated
> ------------------------------------------------------------
|