473,382 Members | 1,373 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,382 software developers and data experts.

problem with mysql c API and c

i have a problem when i try to compile a C program that connects wth a
MySQL database.

when i execute in Linux Debian the follwoing :
gcc mysql_ins_server.c -o mysql_ins_server -I /usr/local/mysql/include/
-L /usr/local/mysql/lib/ -lmysqlclient -lz

i get:
/usr/lib/libc_nonshared.a(elf-init.oS)(.gnu.linkonce.t.__i686.get_pc_thunk.bx+0x 0):
In function `__i686.get_pc_thunk.bx':
: multiple definition of `__i686.get_pc_thunk.bx'
/usr/lib/gcc-lib/i486-linux/3.3.5/../../../libz.a(compress.o)(.text.__i686.get_pc_thunk.bx+0x 0):
first defined here
/usr/lib/gcc-lib/i486-linux/3.3.5/../../../libz.a(inflate.o)(.text+0x485):
In function `inflateSync':
: undefined reference to `__stack_chk_fail_local'
/usr/lib/gcc-lib/i486-linux/3.3.5/../../../libz.a(inflate.o)(.text+0x1de1):
In function `.L553':
: undefined reference to `__stack_chk_fail_local'
collect2: ld returned 1 exit status
/usr/lib/libc_nonshared.a(elf-init.oS)(.gnu.linkonce.t.__i686.get_pc_thunk.bx+0x 0):
In function `__i686.get_pc_thunk.bx':
: multiple definition of `__i686.get_pc_thunk.bx'
/usr/lib/gcc-lib/i486-linux/3.3.5/../../../libz.a(compress.o)(.text.__i686.get_pc_thunk.bx+0x 0):
first defined here
/usr/lib/gcc-lib/i486-linux/3.3.5/../../../libz.a(inflate.o)(.text+0x485):
In function `inflateSync':
: undefined reference to `__stack_chk_fail_local'
/usr/lib/gcc-lib/i486-linux/3.3.5/../../../libz.a(inflate.o)(.text+0x1de1):
In function `.L553':
: undefined reference to `__stack_chk_fail_local'
collect2: ld returned 1 exit status

Does anyone have any clue? any help appreciated.

Apr 5 '06 #1
6 4212
al*********@yahoo.gr wrote:
i have a problem when i try to compile a C program that connects wth a
MySQL database.
MySQL if off topic here. You would be better off on a mysql mailing list
or group.
when i execute in Linux Debian the follwoing :
gcc mysql_ins_server.c -o mysql_ins_server -I /usr/local/mysql/include/
-L /usr/local/mysql/lib/ -lmysqlclient -lz

i get:
/usr/lib/libc_nonshared.a(elf-init.oS)(.gnu.linkonce.t.__i686.get_pc_thunk.bx+0x 0):
In function `__i686.get_pc_thunk.bx':
: multiple definition of `__i686.get_pc_thunk.bx'
/usr/lib/gcc-lib/i486-linux/3.3.5/../../../libz.a(compress.o)(.text.__i686.get_pc_thunk.bx+0x 0):
first defined here
/usr/lib/gcc-lib/i486-linux/3.3.5/../../../libz.a(inflate.o)(.text+0x485):
OK, so you have a symbol defined more than once. Don't do that. As to
why, that I have absolutely no idea. Try deleting line 42 of your source
file and see it that help. If not, try blanking block 42 of your hard disk.

<snip>
Does anyone have any clue? any help appreciated.


Seriously, how do you expect anyone to know what you have done wrong
without seeing what you have done? Don't post your code here though,
since we don't deal with third party libraries, only with standard C.
--
Flash Gordon, living in interesting times.
Web site - http://home.flash-gordon.me.uk/
comp.lang.c posting guidelines and intro:
http://clc-wiki.net/wiki/Intro_to_clc
Apr 5 '06 #2
al*********@yahoo.gr wrote:
i have a problem when i try to compile a C program that connects wth a
MySQL database.

when i execute in Linux Debian the follwoing :
gcc mysql_ins_server.c -o mysql_ins_server -I /usr/local/mysql/include/
-L /usr/local/mysql/lib/ -lmysqlclient -lz

i get:


[snip link-time errors]

Does anyone have any clue? any help appreciated.


This is highly off-topic for comp.lang.c (as I'm sure you well know from
the other reply by Flash), however what follows is even more-so OT but
the reasoning is because I just so happen to work with the MySQL API in c.

<OT>
I too am running Debian. You should use mysql_config --cflags and
mysql_config --libs in order to specifiy the location of the headers and
linker options. This ensures that everything that needs to be there will
get there correctly. Just FYI most scripts for other libraries are named
libraryname-config and they both accept the same arguments.

For example:

gcc main.c -o sqltest `mysql_config --cflags` `mysql_config --libs`
</OT>

Unfortunately I do not know of a group specific to MySQL therefore I
cannot set follow-up's to that group. A search on google might be of
better help.

Hope that helps,

Joe
Apr 6 '06 #3
Make sure you have a recent version of GCC and binutils. I just ran into the same problem with python 2.4.3. It had nothing to do with the code base. The linker was broken and an update of my binutils fixed the issue.
Kind regards,
Chris
Apr 21 '06 #4
Make sure you have a recent version of GCC and binutils. I just ran
into the same problem with python 2.4.3. It had nothing to do with the
code base. The linker was broken and an update of my binutils fixed the
issue.
Kind regards,
Chris

Apr 21 '06 #5
da************@gmail.com writes:
Make sure you have a recent version of GCC and binutils. I just ran
into the same problem with python 2.4.3. It had nothing to do with the
code base. The linker was broken and an update of my binutils fixed the
issue.


Since you didn't provide any context, we have no idea what you're
talking about. The article to which you're replying isn't even on my
news server (it probably expired).

Read <http://cfaj.freeshell.org/google/>.

--
Keith Thompson (The_Other_Keith) ks***@mib.org <http://www.ghoti.net/~kst>
San Diego Supercomputer Center <*> <http://users.sdsc.edu/~kst>
We must do something. This is something. Therefore, we must do this.
Apr 21 '06 #6
da************@gmail.com wrote:
Make sure you have a recent version of GCC and binutils.


Make sure you read the information below.

Brian

--
Please quote enough of the previous message for context. To do so from
Google, click "show options" and use the Reply shown in the expanded
header.
Apr 21 '06 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Duane Winner | last post by:
Hello all - I'm having a small problem with the mysql startup script that ships with MySQL-3.23.56-1. I'm running on RedHat Linux. It works fine, but I have a backup server that runs a script...
0
by: Tiffany Wilkes | last post by:
I solved the problem--I needed ( ) around the column list. I think the manual should make that more clear. -------- Original Message -------- Subject: column privilege problem Date: Tue, 05...
0
by: Annie Xie | last post by:
1> anyone has a compiled tarball for mysql new version (-4.0 up) for solaris 2.6 can be shared? The OS was patched latest. 2> I'm trying build it, configure w/o any problem. However, when dong...
0
by: Gary Cote | last post by:
>Description: I've recently compiled mysql 4.0.14 on redhat 8.0. The installation fails, however, when running mysql_install_db. I've attached a transcript below. I gather from searching the...
4
by: Amadeus | last post by:
Hello Everybody! I have a problem with MySQL servers running RedHat 9 (smp kernel 2.4.20) on Intel and MySQL server 4.0.14 (problem also appears on binary distr 4.0.15 and on 4.0.15 I bilt myself...
1
by: smsabu2002 | last post by:
Hi, I am facing the build problem while installing the DBD-MySql perl module (ver 2.9008) using both GCC and CC compilers in HP-UX machine. For the Build using GCC, the compiler error is...
1
by: Lynton Towler | last post by:
Hello and thanks for reading this message. I have a Virtual Learning Environment (VLE) called "moodle 1.5.2" running on a server with 1Gb of RAM and MySQL version 4.1.13-1 which has been...
3
by: Juan Antonio Villa | last post by:
Hello, I'm having a problem replicating a simple database using the binary log replication, here is the problem: When the master sends an update to the slave, an example update reads as follows:...
4
jepler
by: jepler | last post by:
I find myself in a circular reference loop that I can't seem to resolve. I recently upgraded from MySQL 4.0.x to MySQL 4.1.21 on OS 10.3.9 Server. Then, I *thought* I set my open master root password...
8
by: geert | last post by:
Hi all, I have a mac mini running maocosx 10.5 leopard I want to deploy a django project on. My backend is MySQL, and I have it running as a 64- bit app. Of course, apache2 is also running as...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.