Serious problem with the mingW GCC
Posted by: Kevin Ostheimer
Date: November 26, 2010 05:33AM

Dear all,

I have a major problem in compiling and linking a very simple code with mysql.h inclusion.
+++++++++++++++++++++++++++++++++++
#include <stdio.h>
#include <stdlib.h>
#if defined __WIN32__ || _MSC_VER
#include "my_global.h"
#include "mysql.h"
#else
#include <mysql.h>
#endif

int main()
{
return EXIT_SUCCESS;
}

+++++++++++++++++++++++++++++++++++

I use the MingW GCC compiler in a CodeBlocks 10.05 environment.

The include setting is:
-I"C:\Program Files\MySQL\MySQL Connector C 6.0.2\include"

The library setting is:
-L"C:\Program Files\MySQL\MySQL Connector C 6.0.2\lib\opt\libmysql.dll"

Immediate after the build process I get exactly this:

+++++++++++++++++++++++++++++++++++
-------------- Build: Debug in test_ansi_C ---------------

Compiling: test_ptrs.c
C:\Documents and Settings\z142872\Desktop\12_ HN1 Kopie\02_JointProject_\GCC_Zugriff\HySimDB_ansi_C\test_ptrs.c: In function 'test_ptrs':
C:\Documents and Settings\z142872\Desktop\12_ HN1 Kopie\02_JointProject_\GCC_Zugriff\HySimDB_ansi_C\test_ptrs.c:9: warning: implicit declaration of function 'int_to_console'
C:\Documents and Settings\z142872\Desktop\12_ HN1 Kopie\02_JointProject_\GCC_Zugriff\HySimDB_ansi_C\test_ptrs.c:10: warning: implicit declaration of function 'str_to_console'
C:\Documents and Settings\z142872\Desktop\12_ HN1 Kopie\02_JointProject_\GCC_Zugriff\HySimDB_ansi_C\test_ptrs.c: At top level:
C:\Documents and Settings\z142872\Desktop\12_ HN1 Kopie\02_JointProject_\GCC_Zugriff\HySimDB_ansi_C\test_ptrs.c:14: warning: conflicting types for 'str_to_console'
C:\Documents and Settings\z142872\Desktop\12_ HN1 Kopie\02_JointProject_\GCC_Zugriff\HySimDB_ansi_C\test_ptrs.c:10: note: previous implicit declaration of 'str_to_console' was here
C:\Documents and Settings\z142872\Desktop\12_ HN1 Kopie\02_JointProject_\GCC_Zugriff\HySimDB_ansi_C\test_ptrs.c:20: warning: conflicting types for 'int_to_console'
C:\Documents and Settings\z142872\Desktop\12_ HN1 Kopie\02_JointProject_\GCC_Zugriff\HySimDB_ansi_C\test_ptrs.c:9: note: previous implicit declaration of 'int_to_console' was here
Compiling: main.c
In file included from C:\Program Files\MySQL\MySQL Connector C 6.0.2\include/my_global.h:74,
from C:\Documents and Settings\z142872\Desktop\12_ HN1 Kopie\02_JointProject_\GCC_Zugriff\HySimDB_ansi_C\main.c:4:
C:\Program Files\MySQL\MySQL Connector C 6.0.2\include/config-win.h:111:1: warning: "S_IRWXU" redefined
In file included from C:\Program Files\MySQL\MySQL Connector C 6.0.2\include/config-win.h:33,
from C:\Program Files\MySQL\MySQL Connector C 6.0.2\include/my_global.h:74,
from C:\Documents and Settings\z142872\Desktop\12_ HN1 Kopie\02_JointProject_\GCC_Zugriff\HySimDB_ansi_C\main.c:4:
c:\app\tools\codeblocks\mingw\bin\../lib/gcc/mingw32/4.4.1/../../../../include/sys/stat.h:63:1: warning: this is the location of the previous definition
In file included from C:\Program Files\MySQL\MySQL Connector C 6.0.2\include/my_global.h:74,
from C:\Documents and Settings\z142872\Desktop\12_ HN1 Kopie\02_JointProject_\GCC_Zugriff\HySimDB_ansi_C\main.c:4:
C:\Program Files\MySQL\MySQL Connector C 6.0.2\include/config-win.h:114: error: conflicting types for 'mode_t'
c:\app\tools\codeblocks\mingw\bin\../lib/gcc/mingw32/4.4.1/../../../../include/sys/types.h:85: note: previous declaration of 'mode_t' was here
In file included from C:\Program Files\MySQL\MySQL Connector C 6.0.2\include/my_global.h:74,
from C:\Documents and Settings\z142872\Desktop\12_ HN1 Kopie\02_JointProject_\GCC_Zugriff\HySimDB_ansi_C\main.c:4:
C:\Program Files\MySQL\MySQL Connector C 6.0.2\include/config-win.h:235:1: warning: "finite" redefined
C:\Program Files\MySQL\MySQL Connector C 6.0.2\include/config-win.h:193:1: warning: this is the location of the previous definition
In file included from C:\Documents and Settings\z142872\Desktop\12_ HN1 Kopie\02_JointProject_\GCC_Zugriff\HySimDB_ansi_C\main.c:4:
C:\Program Files\MySQL\MySQL Connector C 6.0.2\include/my_global.h:580:1: warning: "my_reinterpret_cast" redefined
In file included from C:\Program Files\MySQL\MySQL Connector C 6.0.2\include/my_global.h:74,
from C:\Documents and Settings\z142872\Desktop\12_ HN1 Kopie\02_JointProject_\GCC_Zugriff\HySimDB_ansi_C\main.c:4:
C:\Program Files\MySQL\MySQL Connector C 6.0.2\include/config-win.h:339:1: warning: this is the location of the previous definition
In file included from C:\Program Files\MySQL\MySQL Connector C 6.0.2\include/my_global.h:627,
from C:\Documents and Settings\z142872\Desktop\12_ HN1 Kopie\02_JointProject_\GCC_Zugriff\HySimDB_ansi_C\main.c:4:
C:\Program Files\MySQL\MySQL Connector C 6.0.2\include/my_dbug.h:98:20: error: crtdbg.h: No such file or directory
Process terminated with status 1 (0 minutes, 3 seconds)

2 errors, 10 warnings
+++++++++++++++++++++++++++++++++++

Please help me! Regards, Kevin

Options: ReplyQuote


Subject
Views
Written By
Posted
Serious problem with the mingW GCC
4788
November 26, 2010 05:33AM


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.