User forums > Help

problem with mysql headers

(1/2) > >>

dali1985:
I would like to ask you if there is a tutorial with steps how to insert mysql library and headers in codeblocks. Because I want to connect my database with a c++ program which I want to write.
I used exactly step by step this one http://www.ehow.com/how_12032609_codeblocks-mysql-tutorial.html but when I build and run the project I have an error with the #include <mysql.h>
Maybe something goes wrong with the path.

BlueHazzard:

--- Quote from: dali1985 on May 15, 2013, 12:14:05 pm --- but when I build and run the project I have an error with the #include <mysql.h>

--- End quote ---

build log?


--- Quote from: dali1985 on May 15, 2013, 12:14:05 pm ---Maybe something goes wrong with the path.

--- End quote ---
probably, but without build log....

have you set the path to your mysql include files in  "Project->Build Options ->Search directories->Compiler" ?
also don't forget to add the library in "Project->Build Options ->Linker settings->Link libraries" ?
and the path to the library in "Project->Build Options ->Search directories->Linker"

dali1985:
I did the following
Project->Build Options ->Search directories-> /usr/include/mysql
Project -> Build Options -> Compiler Settings tab -> Other Options and enter `mysql_config --cflags`
Project -> Build Options -> Linker Settings tab -> Other Options and enter `mysql_config --libs`

It is working BUT when I change for example the 'Hello World' with the 'Hello my beautiful world' then the 'build and run' button gives me 'Hello World'.

BlueHazzard:

--- Quote from: BlueHazzard on May 15, 2013, 12:46:51 pm ---
--- Quote from: dali1985 on May 15, 2013, 12:14:05 pm --- but when I build and run the project I have an error with the #include <mysql.h>

--- End quote ---
build log?

--- End quote ---

the "full build log"....
We can't help you without information.....

http://wiki.codeblocks.org/index.php?title=FAQ-Compiling_%28general%29#Q:_How_do_I_report_a_compilation_problem_on_the_forums.3F

dali1985:
The build log which I receive with the above changes is

--- Code: ---Checking for existence: /home/pi/Desktop/test8/bin/Debug/test8
Executing: xterm -T test8 -e /usr/bin/cb_console_runner LD_LIBRARY_PATH=$LD_LIBRARY_PATH:. /home/pi/Desktop/test8/bin/Debug/test8  (in /home/pi/Desktop/test8/.)
Process terminated with status 0 (0 minutes, 5 seconds)
 
--- End code ---

 I have this build log but I have always the same result 'Hello World' whatever I change in the text

Navigation

[0] Message Index

[#] Next page

Go to full version