News:

When registered with our forums, feel free to send a "here I am" post here to differ human beings from SPAM bots.

Main Menu

How to configure codeblocks whit mysql.

Started by MaikoID, September 22, 2008, 08:13:18 PM

Previous topic - Next topic

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


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`

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
Python plugins: [url="https://github.com/spillz/codeblocks-python"]https://github.com/spillz/codeblocks-python[/url]
Code::Blocks Daily Builds -- Ubuntu PPA: [url="https://launchpad.net/~damien-moore/+archive/codeblocks"]https://launchpad.net/~damien-moore/+archive/codeblocks[/url]

MaikoID

#3
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.
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.
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: [url="https://www.codeblocks.org/docs/main_codeblocks_en.html"]https://www.codeblocks.org/docs/main_codeblocks_en.html[/url]
C::B FAQ: [url="https://wiki.codeblocks.org/index.php?title=FAQ"]https://wiki.codeblocks.org/index.php?title=FAQ[/url]