List:General Discussion« Previous MessageNext Message »
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
View as plain text  
	Problem #1: We have tried to compile this simple "C" program:

[Start of Source]
#include <stdio.h> // 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");
#if 0
        if (!mysql_real_connect(&mysql, "", "root",
             "chong47", NULL, 0, NULL, 0))
        if (!mysql_connect(&mysql, "", "root", "password"))
                printf("%s", mysql_error(&mysql));
                printf("Successfully connected.");
[End of source]
gcc -o test -I/usr/local/msql-3.21.30/include -L/usr/local/mysql/lib \
	test.c  -lmysqlclient
/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 <stdio.h>
FILE *f;
        printf("Starting Test\n");
        f=fopen("conftestval", "w");
        if (!f)
        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));

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. 


>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)

	Pentium PC, Linux 2.0.35: Slackware*  *     *     *   *   **           ***          *   *       *  **         * ***     *       *  **  ***        *  *              **  *           *   *  **    ***             libm.a

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/
gcc version
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
Perl: This is perl, version 5.005_02 built for i586-linux
2 problems, unable to compile a "C" program with mysqlclient andunable to compile mysql sourceroot6 Apr