alright. looking at your directory this should be ok.

gcc seeLog.c -o seeLog -I/usr/include -L/usr/lib/mysql -lmysqlclient
;)

Aftab Jahan Subedar
Subedar Technologies
Subedar Baag
Bibir Bagicha #1
North Jatrabari
Dhaka 1204
Bangladesh
sms://+447765341890
tel://+88027519050
[EMAIL PROTECTED]
http://www.DhakaStockExchangeGame.com/

hAj wrote:
Hello Jahan,

on 2003.11.11 07:43, Aftab Jahan Subedar at [EMAIL PROTECTED] wrote:


use the following options to compile

gcc seeLog.c -o seeLog -I/usr/local/include -L/usr/local/lib/mysql
-lmysqlclient


Strangely, your options and mine came out with the same error: The first is yours and 2nd is mine.

~/www ->gcc seeLog.c -o seeLog -I/usr/local/include -L/usr/local/lib/mysql
-lmysqlclient
/tmp/ccuX7I5J.o: In function `main':
/tmp/ccuX7I5J.o(.text+0x2a): undefined reference to `mysql_connect'
collect2: ld returned 1 exit status
~/www ->gcc seeLog.c -o seeLog -I/usr/include -L/usr/lib -lmysqlclient
/tmp/ccZxcaCR.o: In function `main':
/tmp/ccZxcaCR.o(.text+0x2a): undefined reference to `mysql_connect'
collect2: ld returned 1 exit status


What does this "undefined reference" really imply, that the lib binary is broken ?


Below is to show you where the .h and lib file I need are located on this particular system I'm trying to run the thing:

~/www ->find / -name '*mysql.h*' 2>&-
/home/temp/installd/buildapache/php-4.3.3/ext/dbx/dbx_mysql.h
/home/temp/installd/buildapache/php-4.3.3/ext/mysql/libmysql/mysql.h
/home/temp/installd/buildapache/php-4.3.3/ext/mysql/php_mysql.h
/home/cpapachebuild/buildapache/php-4.3.3/ext/dbx/dbx_mysql.h
/home/cpapachebuild/buildapache/php-4.3.3/ext/mysql/libmysql/mysql.h
/home/cpapachebuild/buildapache/php-4.3.3/ext/mysql/php_mysql.h
/usr/include/mysql/mysql.h
~/www ->find / -name '*mysqlclient*' 2>&-
/usr/lib/mysql/libmysqlclient.a
/usr/lib/mysql/libmysqlclient.la
/usr/lib/mysql/libmysqlclient_r.a
/usr/lib/mysql/libmysqlclient_r.la
/usr/lib/libmysqlclient.so
/usr/lib/libmysqlclient.so.12
/usr/lib/libmysqlclient.so.12.0.0
/usr/lib/libmysqlclient_r.so
/usr/lib/libmysqlclient_r.so.12
/usr/lib/libmysqlclient_r.so.12.0.0
/usr/lib/libmysqlclient.so.10
/usr/lib/libmysqlclient.so.10.0.0
/usr/lib/libmysqlclient_r.so.10
/usr/lib/libmysqlclient_r.so.10.0.0
/usr/lib/libmysqlclient.so.9
/usr/lib/libmysqlclient.so.6



Best,
hAj




Aftab Jahan Subedar
Subedar Technologies
Subedar Baag
Bibir Bagicha #1
North Jatrabari
Dhaka 1204
Bangladesh
sms://+447765341890
tel://+88027519050
[EMAIL PROTECTED]
http://www.DhakaStockExchangeGame.com/


hAj wrote:


Hello MySQL pros worldwide,


~/www ->cat seeLog.c #define USE_OLD_FUNCTIONS #include <stdio.h> #include <mysql/mysql.h>

int main() {
MYSQL mysql;
MYSQL *mysqldb = NULL;

mysqldb = mysql_connect(&mysql, "geneofcube.net", "USERID",
"PASSWORD");

return 0;
}
~/www ->gcc seeLog.c -o seeLog -I/usr/include -L/usr/lib -lmysqlclient

use the following options to compile -I/usr/local/include -L/usr/local/lib/mysql -lmysqlclient

jahan



/tmp/ccEj3tmv.o: In function `main':
/tmp/ccEj3tmv.o(.text+0x2a): undefined reference to `mysql_connect'
collect2: ld returned 1 exit status
~/www ->


As shown above, I'm having a problem getting rid of a compilation error (undefined reference) coming out with a very simple c code (seeLog.c) which I wrote for a testing purpose. Got no I idea what I'm doing wrong or missing here.

I'd appreciate any of your suggestions.


Best, hAj












-- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED]



Reply via email to