Author Topic: How to configure codeblocks whit mysql.  (Read 30978 times)

Offline MaikoID

  • Single posting newcomer
  • *
  • Posts: 9
How to configure codeblocks whit mysql.
« 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.   :(

Offline MaikoID

  • Single posting newcomer
  • *
  • Posts: 9
Re: How to configure codeblocks whit mysql.
« Reply #1 on: September 25, 2008, 08:11:22 pm »
Bump.

Offline dmoore

  • Developer
  • Lives here!
  • *****
  • Posts: 1576
Re: How to configure codeblocks whit mysql.
« Reply #2 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

Offline MaikoID

  • Single posting newcomer
  • *
  • Posts: 9
Re: How to configure codeblocks whit mysql.
« Reply #3 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.

=/
« Last Edit: September 26, 2008, 04:12:33 am by MaikoID »

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9694
Re: How to configure codeblocks whit mysql.
« Reply #4 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.
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: https://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: https://wiki.codeblocks.org/index.php?title=FAQ