Hi there,

i am desperately trying to compile the MySQL++ library header & cpp files in order to create the actual lib.

I do follow the exact instructions given in the ReadMe for MinGW.

Prerequisite: MySQL C API DLL Import Library
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    Before you can build MySQL++ with MinGW, you will need to create
    a MinGW-compatible import library for MySQL's C API library.
    Using the current default install path for MySQL and assuming
    MySQL++ is in c:\mysql++, the commands to do this are:

    cd C:\Program Files\MySQL\MySQL Server 5.0\lib\opt
        dlltool -k -d c:\mysql++\libmysqlclient.def -l libmysqlclient.a

I cant manage to create that libmysqlclient.a file. It's actually there, but its size is 0bytes and it has no content. (since i downloaded MYSQL 5.1, i had to change the file path)

The second instruction is as follows:

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    With the prerequisites above taken care of, you can build MySQL++
    with this command:

        mingw32-make -f Makefile.mingw

    Notice that we're using the MinGW-specific version of GNU make, not
    the Cygwin or MSYS versions.  Many things will break otherwise: path
    separator handling, shell commands used by the Makefile, etc.

If i do this, the procedure throws an error with the following code:

C:\Users\R4036-02\Desktop\mysql++-3.1.0>mingw32-make -f Makefile.mingw
g++ -c -o mysqlpp_beemutex.o -g -mthreads -DUNICODE -D_UNICODE -DMYSQLPP_NO_DLL
-DHAVE_MYSQL_SSL_SET -I"C:\Program Files\MySQL\MySQL Server 5.1\include"   -MTmy
sqlpp_beemutex.o -MFmysqlpp_beemutex.o.d -MD -MP lib/beemutex.cpp
g++: CreateProcess: No such file or directory
mingw32-make: *** [mysqlpp_beemutex.o] Error 1

I got absolutely no clue of what i'm doing wrong.
I googled for like 6 hours now, trying everything described.
Hopefully someone can help me.

With kind regards

Edited 5 Years Ago by WolfPack: n/a

When you download and unpack the library. Its not ready to be used. Most of the librarys need to be compiled before being used.

Maybe its the same case with this too ..

http://www.cplusplus.com/forum/windows/5259/

This thread gives u a basic explanation on how to install.. If you have any more doubts on this . You can post it down on this thread

It's not like i didnt know that i have to compile them, thats why i wrote it at the beginning of my post. ;)

And yup, while i googled for like 6 hours, i actually found that thread you're referring to, too. And it could not help me, i followed the explanations given without success.

The consequence of doing what post #7 in that thread describes can be seen in my first post ;>

Tested what the guy in #1 did:

somepath\Desktop\MinGWtest>reimp -d "libmysql.lib"

somepath\Desktop\MinGWtest>dlltool -d libmysql.def -D
libmysql.dll -k -l libmysql.a
dlltool: CreateProcess

somepath\Desktop\MinGWtest>

And again the result is a libmysql.a file that is 0 bytes big.

I just installed MinGW standalone and added its \bin directory to the environment-variable and viola, the libmysqlclient.a file got created by dlltool.

Afterwards i adjusted the makefile.mingw in order to match my paths of mysql server 5.5 and he actually started compiling the lib or dll (whatsoever the result may be).

But then he errored again: (LOONG log!)

Creating library file: libmysqlpp.a
mysqlpp_connection.o:C:\mysql++/lib/dbdriver.h:97: undefined reference to `mysql
_get_client_info@0'
mysqlpp_connection.o:C:\mysql++/lib/dbdriver.h:185: undefined reference to `mysq
l_error@4'
mysqlpp_connection.o:C:\mysql++/lib/dbdriver.h:192: undefined reference to `mysq
l_errno@4'
mysqlpp_connection.o:C:\mysql++/lib/dbdriver.h:366: undefined reference to `mysq
l_get_host_info@4'
mysqlpp_connection.o:C:\mysql++/lib/dbdriver.h:395: undefined reference to `mysq
l_kill@8'
mysqlpp_connection.o:C:\mysql++/lib/dbdriver.h:466: undefined reference to `mysq
l_ping@4'
mysqlpp_connection.o:C:\mysql++/lib/dbdriver.h:476: undefined reference to `mysq
l_get_proto_info@4'
mysqlpp_connection.o:C:\mysql++/lib/dbdriver.h:512: undefined reference to `mysq
l_select_db@8'
mysqlpp_connection.o:C:\mysql++/lib/dbdriver.h:521: undefined reference to `mysq
l_get_server_info@4'
mysqlpp_connection.o:C:\mysql++/lib/dbdriver.h:597: undefined reference to `mysq
l_stat@4'
mysqlpp_connection.o:C:\mysql++/lib/dbdriver.h:633: undefined reference to `mysq
l_thread_end@0'
mysqlpp_connection.o:C:\mysql++/lib/dbdriver.h:644: undefined reference to `mysq
l_thread_id@4'
mysqlpp_connection.o:C:\mysql++/lib/dbdriver.h:668: undefined reference to `mysq
l_thread_init@0'
mysqlpp_dbdriver.o:C:\mysql++/lib/dbdriver.cpp:84: undefined reference to `mysql
_real_connect@32'

This errorlist continues until the last lines:

mysqlpp_result.o:C:\mysql++/lib/dbdriver.h:450: undefined reference to `mysql_nu
m_rows@4'
mysqlpp_tcp_connection.o:C:\mysql++/lib/tcp_connection.cpp:131: undefined refere
nce to `getservbyname@8'
mysqlpp_tcp_connection.o:C:\mysql++/lib/tcp_connection.cpp:133: undefined refere
nce to `ntohs@4'
collect2: ld returned 1 exit status
mingw32-make: *** [mysqlpp.dll] Error 1

Additionally, i've got a lot of new files in my mysql++ folder. It seems as if the source files have been converted to .o and .o.d files, e.g.:
mysqlpp_options.o
mysqlpp_options.o.d

Thats all i got so far.

UPDATE #2:

I just got at work and now i tried it there.

MYSQL Server 5.1 installed
added MinGW\bin to Path-Variable of Windows

Following the instructions of the readme strictly, i managed to get the .a file without any problems.

I decided to not modify the Makefile.mingw because i wanted to see what happens and because a lot of people seemed to have compiled the lib / dll with 5.1.

so here i tried and viola i got another type of error, yet still it's of error type 1.
See the attachments for a screenshot of the console window.

Edited 5 Years Ago by anXieTy: n/a

Attachments win32-makemysqlppERROR1.jpg 448.54 KB

UPDATE #2:

I just got at work and now i tried it there.

MYSQL Server 5.1 installed
added MinGW\bin to Path-Variable of Windows

Following the instructions of the readme strictly, i managed to get the .a file without any problems.

I decided to not modify the Makefile.mingw because i wanted to see what happens and because a lot of people seemed to have compiled the lib / dll with 5.1.

so here i tried and viola i got another type of error, yet still it's of error type 1.
See the attachments for a screenshot of the console window.

http://tangentsoft.net/mysql++/doc/html/userman/incorporating.html#inc-mingw

This article has been dead for over six months. Start a new discussion instead.