I've been trying to compile the MySQL++ programs with major trouble. I don't know where the problem is, so I came here since the MySQL++ site is basically useless.
I have to link to the mysql libraries, and to the mysql++ libraries. However, I could only get the mysql++ libraries to compile with the GCC compiler, which is why I'm here, and it gives me a *.a file. But the libraries that come with MySQL are *.lib files. When I try to compile I get a lot of undefined references which makes me think it's not getting the library it needs. Are lib even compatible with GCC?
I also tried linking the another mysql lib thinking the needed stuff is in there, but that generates lots of "variable '<var>' can't be auto-imported." errors.
Any ideas? I'm not very experienced in there things so please use "for idiots" language.
Here is the full log:
Project : simple1
Compiler : GNU GCC Compiler (called directly)
Directory : D:\CPP\mysql++-1.7.32\examples\
--------------------------------------------------------------------------------
Switching to target: Debug
mingw32-g++.exe -W -DWIN32 -D_DEBUG -ID:\CPP\mysql++-1.7.32\lib -ID:\CPP\mysql-4.1.11-win32\include -ID:\CPP\mysql-4.1.11\include -ID:\Publishing\CodeBlocks\include -c util.cpp -o Debug\util.o
mingw32-g++.exe -W -DWIN32 -D_DEBUG -ID:\CPP\mysql++-1.7.32\lib -ID:\CPP\mysql-4.1.11-win32\include -ID:\CPP\mysql-4.1.11\include -ID:\Publishing\CodeBlocks\include -c simple1.cpp -o Debug\simple1.o
mingw32-g++.exe -LD:\CPP\mysql++-1.7.32\Debug -LD:\CPP\mysql-4.1.11-win32\lib\debug -LD:\Publishing\CodeBlocks\lib -o $(ProjectDir)Debug\simple1.exe Debug\util.o Debug\simple1.o -lmysql++ -lmysql -lwsock32
Debug\util.o(.text$_ZNK7mysqlpp6Result8num_rowsEv[mysqlpp::Result::num_rows() const]+0x1f):util.cpp: undefined reference to `mysql_num_rows@4'
Debug\util.o(.text$_ZNK7mysqlpp6Result9fetch_rowEv[mysqlpp::Result::fetch_row() const]+0x1a1):util.cpp: undefined reference to `mysql_fetch_row@4'
Debug\util.o(.text$_ZNK7mysqlpp6Result9fetch_rowEv[mysqlpp::Result::fetch_row() const]+0x1b8):util.cpp: undefined reference to `mysql_fetch_lengths@4'
Debug\util.o(.text$_ZNK7mysqlpp6Result9data_seekEj[mysqlpp::Result::data_seek(unsigned int) const]+0x23):util.cpp: undefined reference to `mysql_data_seek@12'
D:\CPP\mysql++-1.7.32\Debug/libmysql++.a(row.o)(.text$_ZNK7mysqlpp6ResUse10num_fieldsEv[mysqlpp::ResUse::num_fields() const]+0x10): In function `ZN7mysqlpp3Row4selfEv':
D:/CPP/mysql++-1.7.32/lib//row.h: undefined reference to `mysql_num_fields@4'
D:\CPP\mysql++-1.7.32\Debug/libmysql++.a(connection.o)(.text+0x120): In function `ZN7mysqlpp10ConnectionC2Ev':
D:/CPP/mysql++-1.7.32/lib/connection.cpp:23: undefined reference to `mysql_init@4'
D:\CPP\mysql++-1.7.32\Debug/libmysql++.a(connection.o)(.text+0x14a): In function `ZN7mysqlpp10ConnectionC1Ev':
D:/CPP/mysql++-1.7.32/lib/connection.cpp:23: undefined reference to `mysql_init@4'
D:\CPP\mysql++-1.7.32\Debug/libmysql++.a(connection.o)(.text+0x191): In function `ZN7mysqlpp10ConnectionC2Eb':
D:/CPP/mysql++-1.7.32/lib/connection.cpp:32: undefined reference to `mysql_init@4'
D:\CPP\mysql++-1.7.32\Debug/libmysql++.a(connection.o)(.text+0x1d7): In function `ZN7mysqlpp10ConnectionC1Eb':
D:/CPP/mysql++-1.7.32/lib/connection.cpp:32: undefined reference to `mysql_init@4'
D:\CPP\mysql++-1.7.32\Debug/libmysql++.a(connection.o)(.text+0x242): In function `ZN7mysqlpp10ConnectionC2EPKcS2_S2_S2_b':
D:/CPP/mysql++-1.7.32/lib/connection.cpp:40: undefined reference to `mysql_init@4'
D:\CPP\mysql++-1.7.32\Debug/libmysql++.a(connection.o)(.text+0x4b6):D:/CPP/mysql++-1.7.32/lib/connection.cpp:40: more undefined references to `mysql_init@4' follow
D:\CPP\mysql++-1.7.32\Debug/libmysql++.a(connection.o)(.text+0xc36): In function `ZN7mysqlpp10Connection12real_connectEPKcS2_S2_S2_jcjS2_j':
D:/CPP/mysql++-1.7.32/lib/connection.cpp:86: undefined reference to `mysql_options@12'
D:\CPP\mysql++-1.7.32\Debug/libmysql++.a(connection.o)(.text+0xc78):D:/CPP/mysql++-1.7.32/lib/connection.cpp:88: undefined reference to `mysql_real_connect@32'
D:\CPP\mysql++-1.7.32\Debug/libmysql++.a(connection.o)(.text+0xeb8): In function `ZN7mysqlpp10ConnectionD2Ev':
D:/CPP/mysql++-1.7.32/lib/connection.cpp:113: undefined reference to `mysql_close@4'
D:\CPP\mysql++-1.7.32\Debug/libmysql++.a(connection.o)(.text+0xed2): In function `ZN7mysqlpp10ConnectionD1Ev':
D:/CPP/mysql++-1.7.32/lib/connection.cpp:113: undefined reference to `mysql_close@4'
D:\CPP\mysql++-1.7.32\Debug/libmysql++.a(connection.o)(.text+0xf2c): In function `ZN7mysqlpp10Connection9select_dbEPKc':
D:/CPP/mysql++-1.7.32/lib/connection.cpp:118: undefined reference to `mysql_select_db@8'
D:\CPP\mysql++-1.7.32\Debug/libmysql++.a(connection.o)(.text+0x111d): In function `ZN7mysqlpp10Connection6reloadEv':
D:/CPP/mysql++-1.7.32/lib/connection.cpp:129: undefined reference to `mysql_refresh@8'
D:\CPP\mysql++-1.7.32\Debug/libmysql++.a(connection.o)(.text+0x1305): In function `ZN7mysqlpp10Connection8shutdownEv':
D:/CPP/mysql++-1.7.32/lib/connection.cpp:140: undefined reference to `mysql_shutdown@4'
D:\CPP\mysql++-1.7.32\Debug/libmysql++.a(connection.o)(.text+0x1507): In function `ZN7mysqlpp10Connection7connectEPKcS2_S2_S2_':
D:/CPP/mysql++-1.7.32/lib/connection.cpp:154: undefined reference to `mysql_options@12'
D:\CPP\mysql++-1.7.32\Debug/libmysql++.a(connection.o)(.text+0x154c):D:/CPP/mysql++-1.7.32/lib/connection.cpp:156: undefined reference to `mysql_real_connect@32'
D:\CPP\mysql++-1.7.32\Debug/libmysql++.a(connection.o)(.text+0x17a4): In function `ZN7mysqlpp10Connection4infoEv':
D:/CPP/mysql++-1.7.32/lib/connection.cpp:177: undefined reference to `mysql_info@4'
D:\CPP\mysql++-1.7.32\Debug/libmysql++.a(connection.o)(.text+0x1a19): In function `ZN7mysqlpp10Connection7executeERKSsb':
D:/CPP/mysql++-1.7.32/lib/connection.cpp:196: undefined reference to `mysql_query@8'
D:\CPP\mysql++-1.7.32\Debug/libmysql++.a(connection.o)(.text+0x1c7a): In function `ZN7mysqlpp10Connection4execERKSs':
D:/CPP/mysql++-1.7.32/lib/connection.cpp:213: undefined reference to `mysql_query@8'
D:\CPP\mysql++-1.7.32\Debug/libmysql++.a(connection.o)(.text+0x1fef): In function `ZN7mysqlpp10Connection5storeERKSsb':
D:/CPP/mysql++-1.7.32/lib/connection.cpp:232: undefined reference to `mysql_query@8'
D:\CPP\mysql++-1.7.32\Debug/libmysql++.a(connection.o)(.text+0x201d):D:/CPP/mysql++-1.7.32/lib/connection.cpp:234: undefined reference to `mysql_store_result@4'
D:\CPP\mysql++-1.7.32\Debug/libmysql++.a(connection.o)(.text+0x23f9): In function `ZN7mysqlpp10Connection3useERKSsb':
D:/CPP/mysql++-1.7.32/lib/connection.cpp:263: undefined reference to `mysql_query@8'
D:\CPP\mysql++-1.7.32\Debug/libmysql++.a(connection.o)(.text+0x2427):D:/CPP/mysql++-1.7.32/lib/connection.cpp:265: undefined reference to `mysql_use_result@4'
D:\CPP\mysql++-1.7.32\Debug/libmysql++.a(connection.o)(.text$_ZN7mysqlpp10Connection5errorEv[mysqlpp::Connection::error()]+0x10): In function `ZNSt6vectorIN7mysqlpp9SQLStringESaIS1_EED2Ev':
D:/CPP/mysql++-1.7.32/lib//sql_query.h: undefined reference to `mysql_error@4'
D:\CPP\mysql++-1.7.32\Debug/libmysql++.a(manip.o)(.text+0x36d): In function `ZN7mysqlpplsENS_11quote_type2ERNS_9SQLStringE':
D:/CPP/mysql++-1.7.32/lib/manip.cpp:24: undefined reference to `mysql_escape_string@12'
D:\CPP\mysql++-1.7.32\Debug/libmysql++.a(manip.o)(.text+0x697): In function `ZN7mysqlpplsISsEERSoNS_11quote_type1ERKT_':
Process terminated with status 1 (0 minutes, 5 seconds)
29 errors, 0 warnings