LinuxQuestions.org
Visit the LQ Articles and Editorials section
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices

Reply
 
Search this Thread
Old 07-09-2011, 01:29 AM   #1
golden_boy615
Member
 
Registered: Dec 2008
Distribution: Ubuntu Fedora
Posts: 442

Rep: Reputation: 17
how to add some compiler flags in code blocks IDE for Mysql headers and APIs


Hello
I am writing a C program which is contains Mysql header files and APIs but it can not compile it and its error is :
Quote:
undefined reference to
to all of Mysql APIs that I included their headers .In command line I compile my source like this with no problem:
Quote:
gcc test.c -Wall -o test -lz `mysql_config --cflags --include --libs`
I think code block does not have bold italic part of this command.
How can I add this to code block to compile my project or those project that contains Mysql APIs (just my project not all of defined projects that has no relation to mysql APIs)with this gcc flags.

Thanks for any help.
 
Old 07-15-2011, 05:07 AM   #2
Snark1994
Senior Member
 
Registered: Sep 2010
Location: Wales, UK
Distribution: Arch
Posts: 1,632
Blog Entries: 3

Rep: Reputation: 345Reputation: 345Reputation: 345Reputation: 345
According to this thread

Go to Project -> Build Options -> Compiler Settings tab -> Other Options and enter `mysql_config --cflags`
Go to Project -> Build Options -> Linker Settings tab -> Other Options and enter `mysql_config --libs`
 
1 members found this post helpful.
Old 07-16-2011, 02:55 AM   #3
golden_boy615
Member
 
Registered: Dec 2008
Distribution: Ubuntu Fedora
Posts: 442

Original Poster
Rep: Reputation: 17
thank you very much it solved my problem.
 
Old 07-16-2011, 02:57 AM   #4
golden_boy615
Member
 
Registered: Dec 2008
Distribution: Ubuntu Fedora
Posts: 442

Original Poster
Rep: Reputation: 17
to get codecompletion probably need to add the include dir to project
Project -> Build Options -> search directories tab -> compiler: /usr/include/mysql
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
compiler flags in Makefile..!!!?? jaiChara Suse/Novell 4 05-26-2011 01:15 PM
how to configuring Code-Blocks IDE for arm-linux-gcc golden_boy615 Programming 5 02-22-2010 11:59 PM
Compiler Flags mkrems Programming 1 06-13-2008 07:55 PM
compiler flags mkrems Linux - Software 1 04-22-2008 01:53 AM
How to add a C/C++ compiler or developtment IDE itaydagani Amigo 9 01-29-2005 04:20 AM


All times are GMT -5. The time now is 01:24 PM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration