Author Topic: C API for mysql with wrong references (urgent)  (Read 1347 times)

Offline geohei

  • Single posting newcomer
  • *
  • Posts: 5
C API for mysql with wrong references (urgent)
« 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,

Offline stahta01

  • Lives here!
  • ****
  • Posts: 6535
    • My Best Post
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 32 bit.
On Debian Stretch, compiling CB Trunk against wxWidgets 3.0.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline jens

  • Administrator
  • Lives here!
  • *****
  • Posts: 7265
    • Jens' unofficial debian-repository for the Code::Blocks - IDE
Re: C API for mysql with wrong references (urgent)
« Reply #2 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.

Offline geohei

  • Single posting newcomer
  • *
  • Posts: 5
Re: C API for mysql with wrong references (urgent)
« Reply #3 on: January 02, 2017, 08:13:51 am »
This worked perfectly!
Many thanks!