User forums > General (but related to Code::Blocks)

Compilator option (red please)

(1/1)

guillaumec:
Hi,
I'm creating a software using Mysql.
I wrote the source, that's ok.
When I compile it, with gcc on console, like :"gcc -o NomExecutable $(mysql_config --cflags) main.c $(mysql_config --libs)" it works.
But if I try to compile directly in CodeBlocks, I've many errors...
So, I wish to know where, and how, in codeBlocks, declare the "$(mysql_config --cflags)" and $(mysql_config --libs)" to have a good compilation.
Because, I think if I change my ideas, thoses options will change, so if I know for them, for others I'll do to...
Thanks for help !
Guillaume C.

MortenMacFly:
You have to quote that in the build options so that the command is actually run. You are trying to use it as a variable whcih will not work.

guillaumec:
Hi,
I've quoted them, but i've always :"--cflags" no such file or directory.
So i'm asking where to put those both informations.
In Compiler settings, linker settings ??
Sorry, I'm a beginner with Code::blocks, and I'm coming from Windows, that is so different for compling (using C++ Builder).
Thanks for help.

stahta01:
I would try this.

In the "Compiler Settings" "Other compiler options" add

--- Code: ---`mysql_config --cflags`

--- End code ---

And, in "Linker Settings" "Other linker options" add

--- Code: ---`mysql_config --libs`

--- End code ---

NOTE: Use of the slanted single quote!

Edit: I normally save the project and reopened it when doing these types of changes.
Some members of the C::B Dev Team says this is NOT needed; but, I seem to need it.

Tim S.

guillaumec:
Hi,
sorry for the late answer, I wasn't at home past week.
Thanks for help, it's work !!!

Navigation

[0] Message Index

Go to full version