Code::Blocks Forums

User forums => Help => Topic started by: MaikoID on September 22, 2008, 08:13:18 pm

Title: How to configure codeblocks whit mysql.
Post by: MaikoID on September 22, 2008, 08:13:18 pm
Hi

I was read all what I can found about mysql+codeblock, but I could not do that =/

With NetBeans 6.5 Beta I use on this way:

Project -> Properties -> C++ Compiler
include directories: /usr/include/mysql
Addtionnals options: `mysql_config --cflags --libs`

and to turn on the code assistance I do this:
Tools->Option->C++->Code Assistance->C++ Compiler->/usr/include/mysql

How I can do the same with CodeBlocks ?

PS: Sorry about my english.   :(
Title: Re: How to configure codeblocks whit mysql.
Post by: MaikoID on September 25, 2008, 08:11:22 pm
Bump.
Title: Re: How to configure codeblocks whit mysql.
Post by: dmoore on September 25, 2008, 08:32:27 pm
With NetBeans 6.5 Beta I use on this way:

Project -> Properties -> C++ Compiler
include directories: /usr/include/mysql
Addtionnals options: `mysql_config --cflags --libs`

much the same way with C::B.

goto project -> build options
a. compiler settings tab -> other options: `mysql_config --cflags`
b. linker settings tab -> other options: `mysql_config --libs`

to get codecompletion you probably need to add the include dir to your project
c. search directories tab -> compiler:  /usr/include/mysql
Title: Re: How to configure codeblocks whit mysql.
Post by: MaikoID on September 26, 2008, 03:19:28 am
It's work now.

thks Man =)

But..

The code-completion for the library "mysql.h" it is not working. I did what you has said.

=/
Title: Re: How to configure codeblocks whit mysql.
Post by: MortenMacFly on September 26, 2008, 09:02:45 am
The code-completion for the library "mysql.h" it is not working. I did what you has said.
CC does not know the path of this header most likely. The drawback when using mysql_config is that CC cannot determine the path's where to look for header files.

But sure there is a solution: Just run:
mysql_config --cflags
mysql_config --libs
on the command prompt, inspect the options and feed them directly into you project/target compiler/linker options. Thus you don't need the ugly config toll and CC can know where header files are.