Trouble with dev c++ linker.

  • samRdz
  • Born
  • Born
  • samRdz
  • Posts: 1

Post 3+ Months Ago

Hi everyone, I have a question on dev c++. The problem is that I'm trying to use some libraries that I downloaded on the internet, but I keep on getting linker errors. I cannot get them to work because I have to give commands to the linker to look at the .lib files. The code compiles fine wihout any functions, but as soon as I put a function, I get an "undefined reference to function" linker error. Can somebody please tell me how to solve this problem? Thanks.
  • RichB
  • Guru
  • Guru
  • User avatar
  • Posts: 1121
  • Loc: Boston

Post 3+ Months Ago

I'm not really a c++ person, but I looked around to see what I could find out and came across a couple of references to problems with c++ compilers name mangling older c functions in included libraries. The solution offered was wrap the header file declaration like this:
Code: [ Select ]
extern "C" {
#include <mysql.h>
}
  1. extern "C" {
  2. #include <mysql.h>
  3. }

I have no idea whether this is causing your problem or not, but it seems worth a try.

Post Information

  • Total Posts in this topic: 2 posts
  • Users browsing this forum: No registered users and 109 guests
  • You cannot post new topics in this forum
  • You cannot reply to topics in this forum
  • You cannot edit your posts in this forum
  • You cannot delete your posts in this forum
  • You cannot post attachments in this forum
 
 

© 1998-2014. Ozzu® is a registered trademark of Unmelted, LLC.