User forums > Help

How to configure codeblocks whit mysql.

(1/1)

MaikoID:
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.   :(

MaikoID:
Bump.

dmoore:

--- Quote from: MaikoID on September 22, 2008, 08:13:18 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`

--- End quote ---

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

MaikoID:
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.

=/

MortenMacFly:

--- Quote from: MaikoID on September 26, 2008, 03:19:28 am ---The code-completion for the library "mysql.h" it is not working. I did what you has said.

--- End quote ---
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.

Navigation

[0] Message Index

Go to full version