1 message in com.mysql.lists.win32FW: Please, help me!
FromSent OnAttachments
Fabio Varriale (ERI)11 Dec 2002 23:42 
Subject:FW: Please, help me!
From:Fabio Varriale (ERI) (Fabi@eri.ericsson.se)
Date:12/11/2002 11:42:15 PM
List:com.mysql.lists.win32

-----Original Message----- From: Fabio Varriale (ERI) Sent: giovedì 12 dicembre 2002 8.36 To: 'win3@lists.mysql.com' Subject: Please, help me!

Hi,

I'm a newer in database programming with C APIs, so the problem arose with the
gcc/VisulaC++ compiler shouldn't surprise you but leave me a little bit
confused. Now, here the problem. I've installed the Mysql server/client application for win2000. After that, I've
tried to enjoy the header files (mysql.h) writing a little program in C. The program was well compiled but as soon as I've built the program the gcc (and
also the Microsoft compiler) compiler gave me the following indication:

gcc -c "main.c" "Mysql_BuildIF.c" -s -mwindows -mno-cygwin -fnative-struct -IC:\ mysql\include\ -IC:\ProgramFiles\MicrosoftVisualStudio\VC98\include gcc -o "MySQL_BuildIF.exe" "main.o" "Mysql_BuildIF.o" -LC:\mysql\lib\debug\mysql client.lib -LC:\ProgramFiles\MicrosoftVisualStudio\VC98\LIB -s -mwindows -mno-c ygwin -fnative-struct -IC:\mysql\include\ -IC:\ProgramFiles\MicrosoftVisualStudi o\VC98\include Mysql_BuildIF.o(.text+0x59):Mysql_BuildIF.c: undefined reference to `mysql_optio ns@12' Mysql_BuildIF.o(.text+0xfe):Mysql_BuildIF.c: undefined reference to `mysql_init@ 4' Mysql_BuildIF.o(.text+0x158):Mysql_BuildIF.c: undefined reference to `mysql_quer y@8' make: *** [all] Error 1

As the compiler didn't recognize the correct library to link to. Also, hereinafter you'll find attached the makefile I used to build my
"Mysql_BuildIF.exe" file. As you can see the linked library are in the path
C.\mysql\lib\debug as the application had installed the library during its
installation.

INSTDIR=C:\mysql LIBMYSQL=C:\mysql\lib\debug WINDIR=C:\ProgramFiles\MicrosoftVisualStudio\VC98 ###################################

# Compiler CC=gcc # Parameters given to the compiler CFLAGS=-s -mwindows -mno-cygwin -fnative-struct -I$(INSTDIR)\include\
-I$(WINDIR)\include #-L$(INSTDIR)\lib\

# Change the name of your output file here # OUTPUT="MySQL_BuildIF.exe"

# Modify your source files here # SRCS="main.c" "Mysql_BuildIF.c"

# Change the object files, according to the source files, here # Cconvention=__cdecl OBJS="main.o" "Mysql_BuildIF.o" -L$(LIBMYSQL)\mysqlclient.lib -L$(WINDIR)\LIB
-lmysqlclient -lz

# Standard targets all: $(CC) -c $(SRCS) $(CFLAGS) $(CC) -o $(OUTPUT) $(OBJS) $(CFLAGS) Ccode: $(CC) -c $(SRCS) $(CFLAGS)

test: all ./$(OUTPUT)

clean: del *.o

Please, what happened??????