FAQ
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$_ZN7mysqlpp10Connection6errnumEv[mysqlpp::Connection::errnum()]+0x10):
undefined reference to `mysql_errno@4'
F:\BACKUP\mysql++-1.7.40\MinGW\..\lib\query.h:(.text$_ZNK7mysqlpp6ResUse10num_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$_ZNK7mysqlpp6Result8num_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$_ZN7mysqlpp10Connection11client_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::data_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' follow
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$_ZN7mysqlpp10Connection5errorEv[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[mysqlpp::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.

Search Discussions

  • Warren Young at Jul 8, 2005 at 12:58 pm

    Robin wrote:

    First I created a Static Library (.a) project
    Is your program GPL or LGPL? If not, you need to create a DLL. You
    can't do that with v1.7, but I'm in the process of getting this working
    with VC++ for v2.0. I'm pretty sure the process is similar under MinGW,
    but you'll have to figure it out, because I'm not likely to install
    MinGW myself. At best, I'll try building under Cygwin with -mno-cygwin.
    `ZThn8_N7mysqlpp5QueryD0Ev':
    F:\BACKUP\mysql++-1.7.40\MinGW\..\lib\query.h:(.text$_ZN7mysqlpp10Connection6errnumEv[mysqlpp::Connection::errnum()]+0x10):
    undefined reference to `mysql_errno@4'
    Read the FAQ on the page where you downloaded MySQL++.
  • Chris Frey at Jul 21, 2005 at 10:09 am

    On Fri, Jul 08, 2005 at 06:58:34AM -0600, Warren Young wrote:
    Robin wrote:
    First I created a Static Library (.a) project
    Is your program GPL or LGPL? If not, you need to create a DLL. You
    can't do that with v1.7, but I'm in the process of getting this working
    with VC++ for v2.0. I'm pretty sure the process is similar under MinGW,
    but you'll have to figure it out, because I'm not likely to install
    MinGW myself. At best, I'll try building under Cygwin with -mno-cygwin.
    This is an old message, but curiosity caused me to read the LGPL again.
    It is allowed to distribute non-GPL EXE's based on an LGPL'd static
    library, but according to section 6a of the license, you must also
    distribute all your object files and anything else that the end user
    needs to recompile the final EXE.

    This allows the end user to make changes to the LGPL'd library and relink
    to have a new EXE based on it, as long as the newly built library is
    is ABI compatible with the original.

    Also, section 6 says that the license for the EXE (which does not have to
    be GPL style) must allow the end user to reverse engineer your binary,
    and modify that binary (say, with a hex editor). As far as I can see,
    this reverse-engineering restriction applies to EXE's that use LGPL'd
    DLL's too.

    These are some interesting hurdles to releaseing EXE's using LGPL'd
    libraries, but it is possible. Warren has already done the work needed
    to produce a mysql++ DLL, from what I see in the code, so this is somewhat moot.
    Thought I'd clarify anyway.

    - Chris

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupplusplus @
categoriesmysql
postedJul 8, '05 at 11:04a
activeJul 21, '05 at 10:09a
posts3
users3
websitemysql.com
irc#mysql

3 users in discussion

Warren Young: 1 post Chris Frey: 1 post Robin: 1 post

People

Translate

site design / logo © 2022 Grokbase