This is the mail archive of the cygwin mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Linking to which mySQL library?


I'm trying to build a simple app under cygwin using the windows version of mySQL server.

If I compile with "gcc -I/cygdrive/c/mysql/include -L/cygdrive/c/mysql/lib/opt -lmysql myTest.c -o myTest.exe" then my program compiles, links and even runs, but then core dumps. The result are very strange. But while looking around on google and this mailing list, I learned that I should use a mySQLclient library that was compiled under a current cygwin. OK I've done that (./configure --without-server;make;make install), but now I get errors when I try compiling my app. gcc (actually ld) cannot find -lmySQL or undefined references when linking with -lmysqlclient.

gcc -I/usr/local/include/mysql -L/usr/lib -L/usr/local/lib/mysql -lmysqlclient myTest.c -o myTest.exe
/cygdrive/c/DOCUME~1/ESA3BD~1.NEW/LOCALS~1/Temp/cc25Xged.o(.text+0xdf):myTest.c:
undefined reference to `_mysql_init'
/cygdrive/c/DOCUME~1/ESA3BD~1.NEW/LOCALS~1/Temp/cc25Xged.o(.text+0x138):myTest.c
: undefined reference to `_mysql_real_connect'
/cygdrive/c/DOCUME~1/ESA3BD~1.NEW/LOCALS~1/Temp/cc25Xged.o(.text+0x1b0):myTest.c
: undefined reference to `_mysql_query'
/cygdrive/c/DOCUME~1/ESA3BD~1.NEW/LOCALS~1/Temp/cc25Xged.o(.text+0x224):myTest.c
: undefined reference to `_mysql_close'
collect2: ld returned 1 exit status
make: *** [myTest.exe] Error 1


OR

gcc -I/usr/local/include/mysql -L/usr/lib -L/usr/local/lib/mysql -lmysql myTest.c -o myTest.exe
/usr/lib/gcc-lib/i686-pc-cygwin/3.3.1/../../../../i686-pc-cygwin/bin/ld: cannot
find -lmysql
collect2: ld returned 1 exit status
make: *** [myTest.exe] Error 1


I've tried downloading a prebuilt mysql library from a german site (Sorry I forgot the name). But the same problem occurs. I've updated my cygwin install with the latest stuff, but that didn't help either.

What am I doing wrong?

E.

_________________________________________________________________
MSN Geldzaken adviseert... http://money.msn.be


-- Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple Problem reports: http://cygwin.com/problems.html Documentation: http://cygwin.com/docs.html FAQ: http://cygwin.com/faq/


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]