I get undefined reference to ' mysql_suchandsuch@ #'
messages undefined reference to ' mysql_suchandsuch@ #'
when I try to link my program with the MySQL libraries that ship with 5.5 server. When MySQL was installed, I used the default path, which for me on Windows is C:\Program Files\MySQL\MySQL Server 5.5\
. Initially, I thought that spaces cause my grief, but I think I correctly developed how to indicate the path to the library without spaces (anyway, no luck). If there is another plausible reason, please let me know.
I reviewed a number of issues on this site, trying to solve my problem ...
Using mingw / g ++, I tried to link using the following parameters based on my own research, as well as the suggestions here:
- -L "C: \ Program Files \ MySQL \ MySQL Server 5.5 \ lib \" -llibmysql.lib
- -L "C: \ Program Files \ MySQL \ MySQL Server 5.5 \ lib \" -lmysqlclient.lib
- -L "C: \ Progra ~ 1 \ MySQL \ MySQLS ~ 1.5 \ lib \" -llibmysql.lib
- -LC: \ Progra ~ 1 \ MySQL \ MySQLS ~ 1.5 \ lib \ -lmysqlclient.lib
- -L "C: \ Progra ~ 1 \ MySQL \ MySQLS ~ 1.5 \ lib \" -lmysql
In all cases, I set the -L
/ -L
options on the very right side of the instruction, as I understand it, it can make a difference.
I confirmed that libraries exist. In the / lib directory, I have libmysql.lib, mysqlclient.lib and libmysql.dll. I did not try to contact the .dll, since not a single tutorial / forum that I reviewed offered.
I DO NOT use MAKEFILES.
Does anyone have specific experience with g ++ / MySQL?
source share