dbTalk Databases Forums  

Clarification of Compiling Procedure

mailing.database.mysql-plusplus mailing.database.mysql-plusplus


Discuss Clarification of Compiling Procedure in the mailing.database.mysql-plusplus forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Robin
 
Posts: n/a

Default Clarification of Compiling Procedure - 07-08-2005 , 06:04 AM






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$_ZN7mysqlpp10Co nnectio=
n6errnumEv[mysqlpp::Connection::errnum()]+0x10):
undefined reference to `mysql_errno@4'
F:\BACKUP\mysql++-1.7.40\MinGW\..\lib\query.h.text$_ZNK7mysqlpp6Re sUse10n=
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$_ZNK7mysqlpp6Re sult8nu=
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$_ZN7mysqlpp10Co nnectio=
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_se ekEj[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$_ZN7mysqlpp10Connec tion5er=
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$_ZN7mysqlpp10Connec tion13affected_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$_ZN7mysqlpp6ResU se5purgeEv[mysqlpp::ResUse=
:urge()]+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.

--
MySQL++ Mailing List
For list archives: http://lists.mysql.com/plusplus
To unsubscribe: http://lists.mysql.com/plusplus?unsu...ie.nctu.edu.tw


Reply With Quote
  #2  
Old   
Warren Young
 
Posts: n/a

Default Re: Clarification of Compiling Procedure - 07-08-2005 , 07:58 AM






Robin wrote:
Quote:
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.

Quote:
`ZThn8_N7mysqlpp5QueryD0Ev':
F:\BACKUP\mysql++-1.7.40\MinGW\..\lib\query.h.text$_ZN7mysqlpp10Co nnection6errnumEv[mysqlpp::Connection::errnum()]+0x10):
undefined reference to `mysql_errno@4'
Read the FAQ on the page where you downloaded MySQL++.

--
MySQL++ Mailing List
For list archives: http://lists.mysql.com/plusplus
To unsubscribe: http://lists.mysql.com/plusplus?unsu...ie.nctu.edu.tw



Reply With Quote
  #3  
Old   
Chris Frey
 
Posts: n/a

Default Re: Clarification of Compiling Procedure - 07-21-2005 , 05:10 AM



On Fri, Jul 08, 2005 at 06:58:34AM -0600, Warren Young wrote:
Quote:
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


--
MySQL++ Mailing List
For list archives: http://lists.mysql.com/plusplus
To unsubscribe: http://lists.mysql.com/plusplus?unsu...ie.nctu.edu.tw



Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.