delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2004/06/18/17:34:15

Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com
X-Originating-IP: [81.83.62.196]
X-Originating-Email: [esteevens AT hotmail DOT com]
X-Sender: esteevens AT hotmail DOT com
From: "Eddy Steevens" <esteevens AT hotmail DOT com>
To: cygwin AT cygwin DOT com
Subject: Linking to which mySQL library?
Date: Fri, 18 Jun 2004 23:34:05 +0200
Mime-Version: 1.0
Message-ID: <BAY18-F49VBfS34y4Qp000208c5@hotmail.com>
X-OriginalArrivalTime: 18 Jun 2004 21:34:06.0131 (UTC) FILETIME=[FB751830:01C4557B]

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/

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019