Current location: Hot Scripts Forums » Programming Languages » C/C++ » MySQL linker error while compiling using Cygwin


MySQL linker error while compiling using Cygwin

Reply
  #1 (permalink)  
Old 01-31-07, 05:15 PM
Mass Zero's Avatar
Mass Zero Mass Zero is offline
Newbie Coder
 
Join Date: Jan 2007
Location: Amsterdam, NL
Posts: 20
Thanks: 0
Thanked 0 Times in 0 Posts
MySQL linker error while compiling using Cygwin

Hey people,

I made a simple application that Initializes a MySQL connection and shuts it down again. Though, I'm getting some nasty linker errors while compiling. I've searched around the whole frickin' net for the answer and it also comes closer in bits and pieces, but not close enough.

There errors I get while compiling are all in the form of undefined reference to `_mysql_<function>_'.

On several sites it was said I have to add -L<path to my libmysqlclient.so> -lmysqlclient, but it seems as if I don't have that file at all. And it just doesn't seem like that, I don't have the file, while I definitely installed MySQL.

Anyone have the solution for me? It'd be greatly appreciated.
Reply With Quote
  #2 (permalink)  
Old 02-01-07, 01:15 AM
grafman grafman is offline
Coding Addict
 
Join Date: Dec 2006
Posts: 278
Thanks: 0
Thanked 0 Times in 0 Posts
Mass Zero,

I love Cygwin!

Anyway, which download did you get your cygwin from? Make sure that you use one like the nasa site or xmission.com. They have all of the libraries that you need to build mysql clients.

If you don't find it there, then use your setup.exe to uninstall mysql that comes with your cygwin and go get the downloads from the mysql site. You could just go get that library but make very sure that your versions match. Its not always intuitive what goes with what so read the release notes on the mysql site for library versions.

The error you are getting says that you don't have the client library in the link chain and so when the linker tries to find the instruction set it isn't there and barfs all over you.
__________________
"Things are difficult only while you don't understand them."
Reply With Quote
  #3 (permalink)  
Old 02-01-07, 05:39 AM
Mass Zero's Avatar
Mass Zero Mass Zero is offline
Newbie Coder
 
Join Date: Jan 2007
Location: Amsterdam, NL
Posts: 20
Thanks: 0
Thanked 0 Times in 0 Posts
Well, I the MySQL I currently use already is a seperate installation. It's not a MySQL I got with the Cygwin installation. (I can't even find any MySQL stuff in the Cygwin packages list.)
Reply With Quote
  #4 (permalink)  
Old 02-01-07, 10:26 AM
grafman grafman is offline
Coding Addict
 
Join Date: Dec 2006
Posts: 278
Thanks: 0
Thanked 0 Times in 0 Posts
When you get cygwin you not all of the mirrors have all of the things you need. The most complete is xmission. They have EVERYTHING including postgresql and all of the client libs for both.

So you need to find a complete installation of mysql to solve your problem.

http://mirrors.xmission.com/cygwin/

In the mirror selector you don't get the one that has the cygwin extension. Go here and get this one.
__________________
"Things are difficult only while you don't understand them."
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Useful MySQL Resources ptesone Database 30 02-23-11 08:28 AM
PHP and MySQL ? rob2132 Hot Scripts Forum Questions, Suggestions and Feedback 4 08-29-08 02:22 AM
MySql Labyrinth moron Database 4 02-22-08 02:46 AM


All times are GMT -5. The time now is 04:38 PM.
vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.