From: Date: July 8 2005 1:03pm Subject: Clarification of Compiling Procedure List-Archive: http://lists.mysql.com/plusplus/4626 Message-Id: MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Here is what I am using: Windows 2000 Professional SP4 MinGW Developer Studio 2.05 w/ GCC 3.4.2 (I think) Latest MySQL++ Tarball (1.7.40) First I created a Static Library (.a) project and included the Headers & Sources from the lib directory. So it will compile I also pointed the project to the path of the mysql header files. <-- This is maybe where the problem is Everything compiled correctly and outputed Static Libraries Create a new console application project and included the dbinfo.cpp, util.cpp & util.h from the examples directory. As well pointed the project to the lib directory and once again the MySQL header files. I included the appropriate Static Library files from the first project for llinking. It compiles, but does not link. Here is the output from my IDE: --------------------Configuration: Test - Debug-------------------- Compiling source file(s)... dbinfo.cpp util.cpp Linking... F:\BACKUP\mysql++-1.7.40\MinGW\Debug\dbinfo.o: In function `ZThn8_N7mysqlpp5QueryD0Ev': F:\BACKUP\mysql++-1.7.40\MinGW\..\lib\query.h:(.text$_ZN7mysqlpp10Connectio= n6errnumEv[mysqlpp::Connection::errnum()]+0x10): undefined reference to `mysql_errno@4' F:\BACKUP\mysql++-1.7.40\MinGW\..\lib\query.h:(.text$_ZNK7mysqlpp6ResUse10n= um_fieldsEv[mysqlpp::ResUse::num_fields() const]+0x10): undefined reference to `mysql_num_fields@4' F:\BACKUP\mysql++-1.7.40\MinGW\..\lib\query.h:(.text$_ZNK7mysqlpp6Result8nu= m_rowsEv[mysqlpp::Result::num_rows() const]+0x1f): undefined reference to `mysql_num_rows@4' F:\BACKUP\mysql++-1.7.40\MinGW\..\lib\query.h:(.text$_ZN7mysqlpp10Connectio= n11client_infoEv[mysqlpp::Connection::client_info()]+0x4e): undefined reference to `mysql_get_client_info@0' F:\BACKUP\mysql++-1.7.40\MinGW\Debug\dbinfo.o: In function `main': F:\BACKUP\mysql++-1.7.40\MinGW\dbinfo.cpp:51: undefined reference to `mysql_fetch_row@4' F:\BACKUP\mysql++-1.7.40\MinGW\dbinfo.cpp:51: undefined reference to `mysql_fetch_lengths@4' F:\BACKUP\mysql++-1.7.40\MinGW\Debug\dbinfo.o: In function `ZThn8_N7mysqlpp5QueryD0Ev': \..\lib\query.h:(.text$_ZNK7mysqlpp6Result9data_seekEj[mysqlpp::Result::dat= a_seek(unsigned int) const]+0x23): undefined reference to `mysql_data_seek@12' E:\MinGWStudio\Lib\libmysqlppd.a(sql_query.o): In function `ZN7mysqlpp8pprepareEcRNS_9SQLStringEb': F:\BACKUP\mysql++-1.7.40\lib\sql_query.cpp:77: undefined reference to `mysql_escape_string@12' E:\MinGWStudio\Lib\libmysqlppd.a(manip.o): In function `ZN7mysqlpplsENS_11quote_type2ERNS_9SQLStringE': F:\BACKUP\mysql++-1.7.40\lib\manip.cpp:64: undefined reference to `mysql_escape_string@12' E:\MinGWStudio\Lib\libmysqlppd.a(manip.o): In function `ZN7mysqlpplsISsEERSoNS_11quote_type1ERKT_': F:\BACKUP\mysql++-1.7.40\lib\manip.cpp:88: undefined reference to `mysql_escape_string@12' E:\MinGWStudio\Lib\libmysqlppd.a(manip.o): In function `ZN7mysqlpplsIPKcEERSoNS_11quote_type1ERKT_': F:\BACKUP\mysql++-1.7.40\lib\manip.cpp:106: undefined reference to `mysql_escape_string@12' E:\MinGWStudio\Lib\libmysqlppd.a(manip.o): In function `ZN7mysqlpplsERSoRKNS_12ColData_TmplISsEE': F:\BACKUP\mysql++-1.7.40\lib\manip.cpp:180: undefined reference to `mysql_escape_string@12' \manip.cpp:213: more undefined references to `mysql_escape_string@12' follo= w E:\MinGWStudio\Lib\libmysqlppd.a(connection.o): In function `ZN7mysqlpp10ConnectionC2Ev': F:\BACKUP\mysql++-1.7.40\lib\connection.cpp:49: undefined reference to `mysql_init@4' E:\MinGWStudio\Lib\libmysqlppd.a(connection.o): In function `ZN7mysqlpp10ConnectionC1Ev': F:\BACKUP\mysql++-1.7.40\lib\connection.cpp:49: undefined reference to `mysql_init@4' E:\MinGWStudio\Lib\libmysqlppd.a(connection.o): In function `ZN7mysqlpp10ConnectionC2Eb': F:\BACKUP\mysql++-1.7.40\lib\connection.cpp:58: undefined reference to `mysql_init@4' E:\MinGWStudio\Lib\libmysqlppd.a(connection.o): In function `ZN7mysqlpp10ConnectionC1Eb': F:\BACKUP\mysql++-1.7.40\lib\connection.cpp:58: undefined reference to `mysql_init@4' E:\MinGWStudio\Lib\libmysqlppd.a(connection.o): In function `ZN7mysqlpp10ConnectionC2EPKcS2_S2_S2_b': F:\BACKUP\mysql++-1.7.40\lib\connection.cpp:66: undefined reference to `mysql_init@4' `mysql_init@4' follow E:\MinGWStudio\Lib\libmysqlppd.a(connection.o): In function `ZN7mysqlpp10Connection12real_connectEPKcS2_S2_S2_jcjS2_j': F:\BACKUP\mysql++-1.7.40\lib\connection.cpp:112: undefined reference to `mysql_options@12' F:\BACKUP\mysql++-1.7.40\lib\connection.cpp:114: undefined reference to `mysql_real_connect@32' E:\MinGWStudio\Lib\libmysqlppd.a(connection.o): In function `ZN7mysqlpp10ConnectionD2Ev': F:\BACKUP\mysql++-1.7.40\lib\connection.cpp:136: undefined reference to `mysql_close@4' E:\MinGWStudio\Lib\libmysqlppd.a(connection.o): In function `ZN7mysqlpp10ConnectionD1Ev': F:\BACKUP\mysql++-1.7.40\lib\connection.cpp:136: undefined reference to `mysql_close@4' E:\MinGWStudio\Lib\libmysqlppd.a(connection.o): In function `ZN7mysqlpp10Connection9select_dbEPKc': F:\BACKUP\mysql++-1.7.40\lib\connection.cpp:141: undefined reference to `mysql_select_db@8' E:\MinGWStudio\Lib\libmysqlppd.a(connection.o): In function `ZN7mysqlpp10Connection6reloadEv': F:\BACKUP\mysql++-1.7.40\lib\connection.cpp:152: undefined reference to `mysql_refresh@8' ': F:\BACKUP\mysql++-1.7.40\lib\connection.cpp:163: undefined reference to `mysql_shutdown@4' E:\MinGWStudio\Lib\libmysqlppd.a(connection.o): In function `ZN7mysqlpp10Connection7connectEPKcS2_S2_S2_': F:\BACKUP\mysql++-1.7.40\lib\connection.cpp:177: undefined reference to `mysql_options@12' F:\BACKUP\mysql++-1.7.40\lib\connection.cpp:179: undefined reference to `mysql_real_connect@32' E:\MinGWStudio\Lib\libmysqlppd.a(connection.o): In function `ZN7mysqlpp10Connection4infoEv': F:\BACKUP\mysql++-1.7.40\lib\connection.cpp:199: undefined reference to `mysql_info@4' E:\MinGWStudio\Lib\libmysqlppd.a(connection.o): In function `ZN7mysqlpp10Connection7executeERKSsb': F:\BACKUP\mysql++-1.7.40\lib\connection.cpp:220: undefined reference to `mysql_query@8' E:\MinGWStudio\Lib\libmysqlppd.a(connection.o): In function `ZN7mysqlpp10Connection4execERKSs': F:\BACKUP\mysql++-1.7.40\lib\connection.cpp:237: undefined reference to `mysql_query@8' E:\MinGWStudio\Lib\libmysqlppd.a(connection.o): In function `ZN7mysqlpp10Connection5storeERKSsb': ' F:\BACKUP\mysql++-1.7.40\lib\connection.cpp:258: undefined reference to `mysql_store_result@4' E:\MinGWStudio\Lib\libmysqlppd.a(connection.o): In function `ZN7mysqlpp10Connection3useERKSsb': F:\BACKUP\mysql++-1.7.40\lib\connection.cpp:287: undefined reference to `mysql_query@8' F:\BACKUP\mysql++-1.7.40\lib\connection.cpp:289: undefined reference to `mysql_use_result@4' E:\MinGWStudio\Lib\libmysqlppd.a(connection.o): In function `ZNSt6vectorIN7mysqlpp9SQLStringESaIS1_EED2Ev': F:\BACKUP\mysql++-1.7.40\lib\\sql_query.h:(.text$_ZN7mysqlpp10Connection5er= rorEv[mysqlpp::Connection::error()]+0x10): undefined reference to `mysql_error@4' E:\MinGWStudio\Lib\libmysqlppd.a(query.o): In function `ZNSaIN7mysqlpp9SQLStringEED2Ev': E:\MinGWStudio\MinGW\bin\..\lib\gcc\mingw32\3.4.2\..\..\..\..\include\c++\3= .4.2\bits\stl_vector.h:(.text$_ZN7mysqlpp10Connection13affected_rowsEv[mysq= lpp::Connection::affected_rows()]+0x10): undefined reference to `mysql_affected_rows@4' to `mysql_insert_id@4' E:\MinGWStudio\Lib\libmysqlppd.a(result.o): In function `ZN9__gnu_cxx13new_allocatorIN7mysqlpp15mysql_type_infoEE8allocateEjPKv': E:\MinGWStudio\MinGW\bin\..\lib\gcc\mingw32\3.4.2\..\..\..\..\include\c++\3= .4.2\bits\stl_construct.h:(.text$_ZN7mysqlpp6ResUse5purgeEv[mysqlpp::ResUse= ::purge()]+0x19): undefined reference to `mysql_free_result@4' E:\MinGWStudio\Lib\libmysqlppd.a(fields.o): In function `ZSt17__verify_groupingPKcjRKSs': E:\MinGWStudio\MinGW\bin\..\lib\gcc\mingw32\3.4.2\..\..\..\..\include\c++\3= .4.2\bits\locale_facets.tcc:2494: undefined reference to `mysql_fetch_field@4' E:\MinGWStudio\MinGW\bin\..\lib\gcc\mingw32\3.4.2\..\..\..\..\include\c++\3= .4.2\bits\locale_facets.tcc:2495: undefined reference to `mysql_field_seek@8' collect2: ld returned 1 exit status Test.exe - 38 error(s), 0 warning(s) I suspect that the errors have to do with my Static Library. I know there is something I am missing. Any direction would be appreciated, including any shots in the dark. Best Regards, Diilb.