From: root Date: April 6 1999 1:33pm Subject: 2 problems, unable to compile a "C" program with mysqlclient and unable to compile mysql source List-Archive: http://lists.mysql.com/mysql/1459 Message-Id: <199904061333.IAA23518@corp1.indyweb.net> >Description: Problem #1: We have tried to compile this simple "C" program: [Start of Source] #include // if this gets deleted it was stdio.h #include "mysql.h" #include "errmsg.h" void main(void) { MYSQL mysql; printf("this is a test program...\n"); mysql_init(&mysql); #if 0 if (!mysql_real_connect(&mysql, "208.130.80.118", "root", "chong47", NULL, 0, NULL, 0)) #else if (!mysql_connect(&mysql, "208.130.80.118", "root", "password")) #endif { printf("%s", mysql_error(&mysql)); } else { printf("Successfully connected."); } } [End of source] [command] gcc -o test -I/usr/local/msql-3.21.30/include -L/usr/local/mysql/lib \ test.c -lmysqlclient [Results] /usr/local/mysql/lib/libmysqlclient.a(mf_format.o): In function `fn_format': mf_format.o(.text+0x201): undefined reference to `__lxstat' Problem #2 I have tried to compile the Source for MYSQL. I used "./configure" to run the compile. I will include some of the output of this but if you need the complete thing, just let me know. [Start of "Configure" output] checking SCO UnixWare7 native threads... no checking Siemens threads... no checking Solaris threads... no checking named thread libs:... no checking for pthread_create in -libc... no checking for pthread_create in -lpthread... no checking for pthread_create in -lpthreads... no checking for pthread_create in -pthread... no checking for strtok_r in -lpthread... yes checking for strtok_r... yes checking for dlopen in -ldl... yes checking for restartable system calls... no checking for Sun style big file support... No checking need of special linking flags... none checking for working const... yes checking for inline... inline checking for off_t... yes checking for size_t... yes checking for st_rdev in struct stat... yes checking whether time.h and sys/time.h may both be included... yes checking whether struct tm is in sys/time.h or time.h... time.h checking size of char... 0 [Error Message] configure: error: No size for char type. A likely cause for this could be that there isn't any static libraries installed. You can verify this by checking if you have libm.a in /lib, /usr/lib or some other standard place. If this is the problem, install the static libraries and try again. If this isn't the problem, examine config.log for possible errors. If you want to report this, use 'scripts/mysqlbug' and include at least the last 20 rows from config.log! [End of message] I created a test source to test this: #include main() { FILE *f; printf("Starting Test\n"); f=fopen("conftestval", "w"); if (!f) exit(1); printf("Size of a char = %d\n", sizeof(char)); printf("Size of a char = %d\n", sizeof(int)); printf("Size of a char = %d\n", sizeof(long)); printf("Size of a char = %d\n", sizeof(double)); fprintf(f, "%d\n", sizeof(char)); exit(0); } This works just fine. I think there is a library conflict here. I you think this is a lib problem, let me know and I will send you an "ls -l" of my /lib and /usr/lib directories. You may be able to compare my versions with yours to see if I have something wrong of mis-linked. I did down loaded the latest libc.tar and I had compiled and installed. Note: Problem #1 is imporant to us as we need to start some development, were as problem #2 is something that can wait. I would like compile an "so" version of libmysqlclient. >How-To-Repeat: N/A >Fix: ??? >Submitter-Id: root954 >Originator: Dave Nelson >Organization: IndyWeb, Inc. >MySQL support: email support >Synopsis: Unable to Compile >Severity: serious >Priority: medium >Category: mysql >Class: support >Release: mysql-3.22.20a (TCX binary) >Environment: Pentium PC, Linux 2.0.35: Slackware libm.so.4.6.27* libm.so.5@ ld-2.0.7.so* libm.so.5.0.6* ld-linux.so@ libm.so.5.0.9* ld-linux.so.1@ libm.so.6@ ld-linux.so.1.9.9* libncurses.so@ ld-linux.so.2@ libncurses.so.1.9.9g* ld.so* libncurses.so.3.0@ libBrokenLocale-2.0.7.so* libncurses.so.3.4@ libBrokenLocale.so.1@ libnsl-2.0.7.so* libc-2.0.7.so* libnsl.so@ libc.so.4@ libnsl.so.1@ libc.so.4.7.6* libnss_compat-2.0.7.so* libc.so.5@ libnss_compat.so.1@ libc.so.5.4.13* libnss_db-2.0.7.so* libc.so.5.4.46* libnss_db.so.1@ libc.so.6@ libnss_dns-2.0.7.so* libcom_err.so.2@ libnss_dns.so.1@ libcom_err.so.2.0* libnss_files-2.0.7.so* libcrypt-2.0.7.so* libnss_files.so.1@ libcrypt.so@ libnss_nis-2.0.7.so* libcrypt.so.1@ libnss_nis.so.1@ libcurses.so@ libpthread-0.6.so* libcurses.so.0@ libpthread-0.7.so* libcurses.so.0.1.2* libpthread.so@ libcurses.so.1@ libpthread.so.0@ libcurses.so.1.0.0* libresolv-2.0.7.so* libdb-2.0.7.so* libresolv.so.2@ libdb.so.2@ libss.so.2@ libdl-2.0.7.so* libss.so.2.0* libdl.so@ libtermcap.so.2@ libdl.so.1@ libtermcap.so.2.0.8* libdl.so.1.9.9* libutil-2.0.7.so* libdl.so.2@ libutil.so.1@ libe2p.so.2@ libuuid.so.1@ libe2p.so.2.3* libuuid.so.1.1* libext2fs.so.2@ libvga.so.1@ libext2fs.so.2.4* libvga.so.1.3.0* libgdbm.so.1@ libvgagl.so.1@ libgdbm.so.1.7.3* libvgagl.so.1.3.0* libm-2.0.7.so* libm.a libm.so.4@ System: Linux corp1 2.0.35 #5 Mon Mar 22 17:38:59 EST 1999 i686 unknown Architecture: i686 Some paths: /usr/local/bin/perl /usr/bin/make /usr/bin/gcc /usr/bin/cc GCC: Reading specs from /usr/lib/gcc-lib/i486-linux/2.7.2.3/specs gcc version 2.7.2.3 Compilation info: CC='gcc' CFLAGS='-O6 -mpentium -fomit-frame-pointer' CXX='gcc' CXXFLAGS='-O6 -mpentium -fomit-frame-pointer -felide-constructors' LDFLAGS='-static' Configure command: ./configure --prefix=/usr/local/mysql '--with-comment=TCX binary' --enable-assembler --with-mysqld-ldflags=-all-static --with-client-ldflags=-all-static --disable-shared Perl: This is perl, version 5.005_02 built for i586-linux