Code::Blocks Forums

User forums => Using Code::Blocks => Topic started by: NovaDesu on November 26, 2009, 11:57:35 pm

Title: Using Mysql with C::B
Post by: NovaDesu on November 26, 2009, 11:57:35 pm
Hey guys,

I've been using C::B for a while now, I'm working on a server for my game.
I want to use a mysql database to store users information, i've been trying for a few days to get it to work but i cant get it to work...

I've downloaded Mysql++ and mysqlclient.lib, added the mysqlclient.lib to the linker settings and mysql++ lib directory to the search dirs.

Now when I include mysql++.h to my server, its gives a shitload of errors


C:\Mysql\common.h|124|mysql_version.h: No such file or directory|
C:\Mysql\common.h|182|mysql.h: No such file or directory|
C:\Mysql\type_info.h|83|error: expected `,' or `...' before "bt"|
C:\Mysql\type_info.h|84|error: ISO C++ forbids declaration of `enum_field_types' with no type|
C:\Mysql\type_info.h|98|error: `enum_field_types' does not name a type|
C:\Mysql\type_info.h||In constructor `mysqlpp::mysql_ti_sql_type_info::mysql_ti_sql_type_info()':|

Much, much more.

Anyone knows why this is happening and how to fix it?
Title: Re: Using Mysql with C::B
Post by: stahta01 on November 27, 2009, 12:23:45 am
[quote author=NovaDesu link=topic=11577.msg78785#msg78785
C:\Mysql\common.h|124|mysql_version.h: No such file or directory|
C:\Mysql\common.h|182|mysql.h: No such file or directory|

Anyone knows why this is happening and how to fix it?

[/quote]

You are missing an compiler include/search directory that contains the headers.
Note: If you can not find the headers mysql_version.h or mysql.h ask where they are on the mySQL website.

You add the include/search directory using "Build Options"
"Project" -> "build options"
Tab "Search Diretories"
SubTab "Compilers"
Add the directory to header.

Tim S.

Note, the name of your compiler and its version might help people to help you.
The OS Name and version and C::B version/SVN might also help.

This is NOT a beginning programming site; Please turn on full compiler logging and the output of that should help you to give needed info to another site. When/If this thread is locked.
http://wiki.codeblocks.org/index.php?title=FAQ#Q:_How_do_I_troubleshoot_an_compiler_problem.3F