Code::Blocks Forums

User forums => Using Code::Blocks => Topic started by: Rakan on May 31, 2008, 03:29:28 pm

Title: compiling my application that uses mysql.h
Post by: Rakan 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
Title: Re: compiling my application that uses mysql.h
Post by: Jenna 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 .