hey guys, I'm working on windows 7 (64bit) and developing with code::blocks (mingw compiler). I'm using the mysql/c++ connector from the mysql website to interface my code with mysql. What's puzzling is that the code compiles fine (although with a couple seemingly irrelevant warnings), but when I try to use the command line g++ to create a dll from the whuser.o file it gives a few errors regarding mysql. The command I type is "g++ -shared -o whuser.dll whuser.o". I receive the following 5 error messages in response:
C:\Users\nate\Desktop\auto>g++ -shared -o whuser.dll .\Release\whuser.o
.\Release\whuser.o:whuser.cpp:(.text+0x569): undefined reference to `__imp__get_
driver_instance'
.\Release\whuser.o:whuser.cpp:(.text+0xf40): undefined reference to `__imp__get_
driver_instance'
.\Release\whuser.o:whuser.cpp:(.text+0x16a0): undefined reference to `__imp__get
_driver_instance'
.\Release\whuser.o:whuser.cpp:(.text+0x1d90): undefined reference to `__imp__get
_driver_instance'
.\Release\whuser.o:whuser.cpp:(.text+0x248b): undefined reference to `__imp__get
_driver_instance'
collect2: ld returned 1 exit status
The function "get_driver_instance" is referenced in a couple of the included mysql header files, and from what I gather the function is defined in the mysql library "mysqlcppconn.lib". I don't understand why g++ seems to find the function definition during compilation, but then doesn't when I try to use the command line to create the dll. I've tried explicitly linking the library with -l or -L in the command line arguments, but it has had no effect. I've found this issue on google, but only regarding compilation (not dll creation) so people just say that the mysql library is missing. This is driving me nuts, if anyone could help it would be greatly appreciated.
-Nate

