Author Topic: compiling my application that uses mysql.h  (Read 2000 times)

Offline Rakan

  • Single posting newcomer
  • *
  • Posts: 4
compiling my application that uses mysql.h
« on: May 31, 2008, 03:29:28 pm »
Hello,

i am trying to compile my application which is using mysql.h but when linking, i get undefined reference to mysql_init error.
i added the /usr/lib and usr/local/lib to search directories for linkier on codeblocks but same result

What should i do to enable successfull linking?

thanks,
Rakan

Offline jens

  • Administrator
  • Lives here!
  • *****
  • Posts: 7255
Re: compiling my application that uses mysql.h
« Reply #1 on: May 31, 2008, 03:52:46 pm »
It's not enough to add the search-dirs, you also have to add the library itself to "Linker Settings  -> Link Libraries" (without the leading "lib" and without the extension).

It should be "mysqlclient" in your case .