User forums > Using Code::Blocks
compiling my application that uses mysql.h
(1/1)
Rakan:
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
Jenna:
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 .
Navigation
[0] Message Index
Go to full version