Mysql c-programming on windows, mingw
Posted by: Leave Blank
Date: February 28, 2012 06:17AM

Hello,
I am very new to Mysql programming so I made just few probes on Linux and I like it. Now, I would like to compile my programs on windows too.
For this I uses Codeblocks 10.05 IDE with GCC/MinGW compiler 4.6.1.
Wanted version of Mysql is 6.4.7 32 bit which was installed successfuly. With them I installed gui-tools and MySQL Connector C 6.0.2, all 32 bit versions.

After heavy trying to get all those to work on windows7/64 bit machine I find several posts about how to prepare libs to use it with minGW, like...

http://dev.mysql.com/doc/refman/5.0/en/building-clients.html
http://forums.mysql.com/read.php?167,295483,297733

I pexports libmysql.dll > libmysql.def, dlltool -k --input-def libmysql.def --dllname libmysql.dll --output-lib libmysql.a and just everything described with care that all my programs are 32 bit versions.

But I can't compile. Several errors appears:
||=== w_mysqlgui, Debug ===|
C:\Program Files (x86)\MySQL\MySQL Connector C 6.0.2\include\config-win.h|24|warning: "_WIN32_WINNT" redefined [enabled by default]|
c:\program files (x86)\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.6.1\..\..\..\..\include\windef.h|20|note: this is the location of the previous definition|
C:\Program Files (x86)\MySQL\MySQL Connector C 6.0.2\include\config-win.h|111|warning: "S_IRWXU" redefined [enabled by default]|
c:\program files (x86)\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.6.1\..\..\..\..\include\sys\stat.h|63|note: this is the location of the previous definition|
C:\Program Files (x86)\MySQL\MySQL Connector C 6.0.2\include\config-win.h|114|error: conflicting types for 'mode_t'|
c:\program files (x86)\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.6.1\..\..\..\..\include\sys\types.h|99|note: previous declaration of 'mode_t' was here|
C:\Program Files (x86)\MySQL\MySQL Connector C 6.0.2\include\config-win.h|177|error: conflicting types for 'ssize_t'|
c:\program files (x86)\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.6.1\..\..\..\..\include\sys\types.h|118|note: previous declaration of 'ssize_t' was here|
C:\Program Files (x86)\MySQL\MySQL Connector C 6.0.2\include\config-win.h|235|warning: "finite" redefined [enabled by default]|
C:\Program Files (x86)\MySQL\MySQL Connector C 6.0.2\include\config-win.h|193|note: this is the location of the previous definition|
C:\Program Files (x86)\MySQL\MySQL Connector C 6.0.2\include\my_global.h|580|warning: "my_reinterpret_cast" redefined [enabled by default]|
C:\Program Files (x86)\MySQL\MySQL Connector C 6.0.2\include\config-win.h|339|note: this is the location of the previous definition|
C:\Program Files (x86)\MySQL\MySQL Connector C 6.0.2\include\my_dbug.h|98|fatal error: crtdbg.h: No such file or directory|
||=== Build finished: 9 errors, 4 warnings ===|

What do I do wrong?
Any help to start programming Mysql on windows are welcome.

Options: ReplyQuote


Subject
Views
Written By
Posted
Mysql c-programming on windows, mingw
6959
February 28, 2012 06:17AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.