Code::Blocks Forums

User forums => General (but related to Code::Blocks) => Topic started by: geohei on January 01, 2017, 07:15:11 pm

Title: C API for mysql with wrong references (urgent)
Post by: geohei on January 01, 2017, 07:15:11 pm
Hi.

Ubuntu 14.04 desktop.
Code::Blocks 16.01

I'm programming in C and would like to add MySQL code.
So I installed libmysqlclient-dev, which installs mysql.h and all other header files.

Unfortunately, these header files are all installed in /usr/include/mysql instead of /usr/include.
Cross references between the header files all expect them to be in /usr/include.
Changing of all references can't be the solution.
Nor can it be copying /usr/include/mysql to /usr/include.

Is there any feature inside Code::Blocks which allows to automatically map references to wrong header files?

Please advise.

Thanks,
Title: Re: C API for mysql with wrong references (urgent)
Post by: stahta01 on January 01, 2017, 09:06:38 pm
http://wiki.codeblocks.org/index.php/FAQ-Compiling_%28general%29#Q:_I_would_like_to_compile_a_project_using_some_non-standard_libraries._How_can_I_indicate_to_CodeBlocks_that_these_libraries_and_include_files_exist.3F (http://wiki.codeblocks.org/index.php/FAQ-Compiling_%28general%29#Q:_I_would_like_to_compile_a_project_using_some_non-standard_libraries._How_can_I_indicate_to_CodeBlocks_that_these_libraries_and_include_files_exist.3F)

It is best to follow the "For your project :" section.
Title: Re: C API for mysql with wrong references (urgent)
Post by: Jenna on January 01, 2017, 10:48:14 pm
The dev-package includes "mysql-config", which vcan be used similar to wx-config of wxWidgets on Linux.
You can add calls to the tool in backticks in compilers and linkers other options.
`mysql_config --cflags` in "Other compiler options" of your projects "Build options" and `mysql_config --libs` in "Other linker settings".
Using config-tools (or pkg-config if available) is better in most cases on linux, because you don't need to add everything manual and you don't have to care about possible changes in the directory-structure of the library.
Title: Re: C API for mysql with wrong references (urgent)
Post by: geohei on January 02, 2017, 08:13:51 am
This worked perfectly!
Many thanks!