|
From: Guillermo K. <gui...@ya...> - 2003-10-29 22:02:13
|
Hi,=20 I=B4m just starting to do some tests with MySQL, downloaded and installed the Dev Pack. When I compile a simple test application I get this link error. Need some advise, thanks. ---------- Compiler: Default compiler Building Makefile: "D:\Dev\C++\sql\Makefile.win" Executing make... make.exe -f "D:\Dev\C++\sql\Makefile.win" all g++.exe -c main.cpp -o main.o -I"C:/Dev-Cpp/include/c++" -I"C:/Dev-Cpp/include/c++/mingw32" -I"C:/Dev-Cpp/include/c++/backward" -I"C:/Dev-Cpp/include" =20 g++.exe main.o -o "testSQL.exe" -L"C:/Dev-Cpp/lib"=20 main.o(.text+0xfc):main.cpp: undefined reference to `mysql_init@4' make.exe: *** [testSQL.exe] Error 1 Execution terminated ---------- |
|
From: Per W. <pw...@ia...> - 2003-10-29 22:58:53
|
Where did you inform DevC++ that you wanted to link your application with the mysql library? From the compiler output, you can see where the linker looks for libraries (-L"C:/Dev-Cpp/lib"). However, that is not enough. You also have to tell it which extra libraries you need, such as -lmySQL. Did you try c:\Dev-Cpp\Examples\MySQLClientTest? /Per W On Wed, 29 Oct 2003, Guillermo Krepper wrote: > Hi, > =09I=B4m just starting to do some tests with MySQL, downloaded and > installed the Dev Pack. When I compile a simple test application I get > this link error. > Need some advise, thanks. > > ---------- > Compiler: Default compiler > Building Makefile: "D:\Dev\C++\sql\Makefile.win" > Executing make... > make.exe -f "D:\Dev\C++\sql\Makefile.win" all > g++.exe -c main.cpp -o main.o -I"C:/Dev-Cpp/include/c++" > -I"C:/Dev-Cpp/include/c++/mingw32" -I"C:/Dev-Cpp/include/c++/backward" > -I"C:/Dev-Cpp/include" > g++.exe main.o -o "testSQL.exe" -L"C:/Dev-Cpp/lib" > main.o(.text+0xfc):main.cpp: undefined reference to `mysql_init@4' > make.exe: *** [testSQL.exe] Error 1 > Execution terminated > ---------- > > > > > > ------------------------------------------------------- > This SF.net email is sponsored by: SF.net Giveback Program. > Does SourceForge.net help you be more productive? Does it > help you create better code? SHARE THE LOVE, and help us help > YOU! Click Here: http://sourceforge.net/donate/ > _______________________________________________ > Dev-cpp-users mailing list > Dev...@li... > TO UNSUBSCRIBE: http://www23.brinkster.com/noicys/devcpp/ub.htm > https://lists.sourceforge.net/lists/listinfo/dev-cpp-users > |
|
From: <gui...@ya...> - 2003-10-31 11:03:58
|
Hi Per, yes in fact I was making a mistake with the linker, so I added "-lmySQL" and allso compiled the example, and this is what I get: ------------- Compiler: Default compiler Building Makefile: "C:\Dev-Cpp\Examples\MySQLClientTest\Makefile.win" Executing make... make.exe -f "C:\Dev-Cpp\Examples\MySQLClientTest\Makefile.win" all g++.exe -c MySQLClientTest.cpp -o MySQLClientTest.o -I"C:/Dev-Cpp/include/c++" -I"C:/Dev-Cpp/include/c++/mingw32" -I"C:/Dev-Cpp/include/c++/backward" -I"C:/Dev-Cpp/include" gcc.exe MySQLClientTest.o -o "MySQLClientTest.exe" -L"C:/Dev-Cpp/lib" -lmySQL MySQLClientTest.o(.eh_frame+0x11):MySQLClientTest.cpp: undefined reference to `__gxx_personality_v0' make.exe: *** [MySQLClientTest.exe] Error 1 Execution terminated ----------------- Could this be a problem caused by the warning in http://www.bloodshed.net/dev/devcpp.html? " /!\ WARNING /!\ : Due to changes in the C++ ABI in GCC 3.2, some of the available Dev-C++ Packages for the C++ language will not work. Please read this for more information. " --- Per Westermark <pw...@ia...> escribió: > Where did you inform DevC++ that you wanted to link your > application with > the mysql library? From the compiler output, you can see where > the linker > looks for libraries (-L"C:/Dev-Cpp/lib"). However, that is not > enough. You > also have to tell it which extra libraries you need, such as > -lmySQL. > > Did you try c:\Dev-Cpp\Examples\MySQLClientTest? > > /Per W > > On Wed, 29 Oct 2003, Guillermo Krepper wrote: > > > Hi, > > I´m just starting to do some tests with MySQL, downloaded > and > > installed the Dev Pack. When I compile a simple test > application I get > > this link error. > > Need some advise, thanks. > > > > ---------- > > Compiler: Default compiler > > Building Makefile: "D:\Dev\C++\sql\Makefile.win" > > Executing make... > > make.exe -f "D:\Dev\C++\sql\Makefile.win" all > > g++.exe -c main.cpp -o main.o -I"C:/Dev-Cpp/include/c++" > > -I"C:/Dev-Cpp/include/c++/mingw32" > -I"C:/Dev-Cpp/include/c++/backward" > > -I"C:/Dev-Cpp/include" > > g++.exe main.o -o "testSQL.exe" -L"C:/Dev-Cpp/lib" > > main.o(.text+0xfc):main.cpp: undefined reference to > `mysql_init@4' > > make.exe: *** [testSQL.exe] Error 1 > > Execution terminated > > ---------- > > > > > > > > > > > > ------------------------------------------------------- > > This SF.net email is sponsored by: SF.net Giveback Program. > > Does SourceForge.net help you be more productive? Does it > > help you create better code? SHARE THE LOVE, and help us > help > > YOU! Click Here: http://sourceforge.net/donate/ > > _______________________________________________ > > Dev-cpp-users mailing list > > Dev...@li... > > TO UNSUBSCRIBE: > http://www23.brinkster.com/noicys/devcpp/ub.htm > > https://lists.sourceforge.net/lists/listinfo/dev-cpp-users > > > > > > ------------------------------------------------------- > This SF.net email is sponsored by: SF.net Giveback Program. > Does SourceForge.net help you be more productive? Does it > help you create better code? SHARE THE LOVE, and help us help > YOU! Click Here: http://sourceforge.net/donate/ > _______________________________________________ > Dev-cpp-users mailing list > Dev...@li... > TO UNSUBSCRIBE: http://www23.brinkster.com/noicys/devcpp/ub.htm > https://lists.sourceforge.net/lists/listinfo/dev-cpp-users ___________________________________________________ Yahoo! Messenger - Nueva versión GRATIS Super Webcam, voz, caritas animadas, y más... http://messenger.yahoo.es |
|
From: Per W. <pw...@ia...> - 2003-10-31 12:40:00
|
Try adding -lstdc++ to link with standard c++ libraries. /Per W On Fri, 31 Oct 2003, Guillermo Krepper wrote: > Hi Per, > > yes in fact I was making a mistake with the linker, so I added > "-lmySQL" and allso compiled the example, and this is what I get: > > ------------- > Compiler: Default compiler > Building Makefile: > "C:\Dev-Cpp\Examples\MySQLClientTest\Makefile.win" > Executing make... > make.exe -f "C:\Dev-Cpp\Examples\MySQLClientTest\Makefile.win" > all > g++.exe -c MySQLClientTest.cpp -o MySQLClientTest.o > -I"C:/Dev-Cpp/include/c++" -I"C:/Dev-Cpp/include/c++/mingw32" > -I"C:/Dev-Cpp/include/c++/backward" -I"C:/Dev-Cpp/include" > gcc.exe MySQLClientTest.o -o "MySQLClientTest.exe" > -L"C:/Dev-Cpp/lib" -lmySQL > MySQLClientTest.o(.eh_frame+0x11):MySQLClientTest.cpp: undefined > reference to `__gxx_personality_v0' > make.exe: *** [MySQLClientTest.exe] Error 1 > Execution terminated > ----------------- > > Could this be a problem caused by the warning in > http://www.bloodshed.net/dev/devcpp.html? > > " /!\ WARNING /!\ : Due to changes in the C++ ABI in GCC 3.2, > some of the available Dev-C++ Packages for the C++ language will > not work. Please read this for more information. " > > > > --- Per Westermark <pw...@ia...> escribi=F3: > Where did > you inform DevC++ that you wanted to link your > > application with > > the mysql library? From the compiler output, you can see where > > the linker > > looks for libraries (-L"C:/Dev-Cpp/lib"). However, that is not > > enough. You > > also have to tell it which extra libraries you need, such as > > -lmySQL. > > > > Did you try c:\Dev-Cpp\Examples\MySQLClientTest? > > > > /Per W > > > > On Wed, 29 Oct 2003, Guillermo Krepper wrote: > > > > > Hi, > > > =09I=B4m just starting to do some tests with MySQL, downloaded > > and > > > installed the Dev Pack. When I compile a simple test > > application I get > > > this link error. > > > Need some advise, thanks. > > > > > > ---------- > > > Compiler: Default compiler > > > Building Makefile: "D:\Dev\C++\sql\Makefile.win" > > > Executing make... > > > make.exe -f "D:\Dev\C++\sql\Makefile.win" all > > > g++.exe -c main.cpp -o main.o -I"C:/Dev-Cpp/include/c++" > > > -I"C:/Dev-Cpp/include/c++/mingw32" > > -I"C:/Dev-Cpp/include/c++/backward" > > > -I"C:/Dev-Cpp/include" > > > g++.exe main.o -o "testSQL.exe" -L"C:/Dev-Cpp/lib" > > > main.o(.text+0xfc):main.cpp: undefined reference to > > `mysql_init@4' > > > make.exe: *** [testSQL.exe] Error 1 > > > Execution terminated > > > ---------- > > > > > > > > > > > > > > > > > > ------------------------------------------------------- > > > This SF.net email is sponsored by: SF.net Giveback Program. > > > Does SourceForge.net help you be more productive? Does it > > > help you create better code? SHARE THE LOVE, and help us > > help > > > YOU! Click Here: http://sourceforge.net/donate/ > > > _______________________________________________ > > > Dev-cpp-users mailing list > > > Dev...@li... > > > TO UNSUBSCRIBE: > > http://www23.brinkster.com/noicys/devcpp/ub.htm > > > https://lists.sourceforge.net/lists/listinfo/dev-cpp-users > > > > > > > > > > > ------------------------------------------------------- > > This SF.net email is sponsored by: SF.net Giveback Program. > > Does SourceForge.net help you be more productive? Does it > > help you create better code? SHARE THE LOVE, and help us help > > YOU! Click Here: http://sourceforge.net/donate/ > > _______________________________________________ > > Dev-cpp-users mailing list > > Dev...@li... > > TO UNSUBSCRIBE: http://www23.brinkster.com/noicys/devcpp/ub.htm > > https://lists.sourceforge.net/lists/listinfo/dev-cpp-users > > ___________________________________________________ > Yahoo! Messenger - Nueva versi=F3n GRATIS > Super Webcam, voz, caritas animadas, y m=E1s... > http://messenger.yahoo.es > > > ------------------------------------------------------- > This SF.net email is sponsored by: SF.net Giveback Program. > Does SourceForge.net help you be more productive? Does it > help you create better code? SHARE THE LOVE, and help us help > YOU! Click Here: http://sourceforge.net/donate/ > _______________________________________________ > Dev-cpp-users mailing list > Dev...@li... > TO UNSUBSCRIBE: http://www23.brinkster.com/noicys/devcpp/ub.htm > https://lists.sourceforge.net/lists/listinfo/dev-cpp-users > |