Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » C / C++ IDE (CDT) » Compile errors with MinGW/CygWin/CDT
Compile errors with MinGW/CygWin/CDT [message #1742270] Thu, 01 September 2016 10:19 Go to next message
Michael Pedersen is currently offline Michael PedersenFriend
Messages: 3
Registered: September 2016
Junior Member
I am creating a C program that needs to connect to a MYSQL client. Unfortunately I have hit a brick wall when trying to compile it, whether using MinGW or Cygwin. So I decided to try out some code I found on the following website, the "Retrieving data from the database" example.

http://zetcode.com/db/mysqlc/

I've made four projects in my workspace, for each combination of MinGW/Cygwin and External/Internal Builder, and attached said workspace here so everyone can see the settings I've used for each project.

Unfortunately I get compilation errors for all four projects, and I've been unable to figure out why. I've made sure to add the include and lib folders for both MySQL Server and the C Connector, and added mysql and mysqlclient libraries, as suggested by several posts I found while trying to figure out these problems. With some of the projects, the error comes from the automatic makefile Eclipse provides, but I can't see any problems with space or tabs therein, which has been the problem when I researched other people who got the same error message.

So here are the error messages I get for each project:

Cygwin/External:
make clean 
Error on line 7: expecting target : dependencies
make all 
Error on line 7: expecting target : dependencies


Cygwin/Internal:
Info: Internal Builder is used for build
gcc "-IC:\\Program Files\\MySQL\\MySQL Server 5.7\\include" "-IC:\\Program Files\\MySQL\\Connector.C++ 1.1\\include" -O3 -Wall -c -fmessage-length=0 -o Test.o "..\\Test.c" 
In file included from ..\Test.c:1:0:
C:\Program Files\MySQL\MySQL Server 5.7\include/my_global.h:672:3: error: unknown type name 'FILETIME'
   FILETIME ft;
   ^
C:\Program Files\MySQL\MySQL Server 5.7\include/my_global.h:673:3: error: unknown type name '__int64'
   __int64 i64;
   ^
C:\Program Files\MySQL\MySQL Server 5.7\include/my_global.h:676:8: error: redefinition of 'struct timespec'
 struct timespec {
        ^
In file included from /usr/include/sys/timespec.h:38:0,
                 from /usr/include/sys/select.h:27,
                 from /usr/include/sys/types.h:68,
                 from /usr/include/stdio.h:61,
                 from C:\Program Files\MySQL\MySQL Server 5.7\include/my_global.h:41,
                 from ..\Test.c:1:
/usr/include/sys/_timespec.h:45:8: note: originally defined here
 struct timespec {
        ^
In file included from ..\Test.c:1:0:
C:\Program Files\MySQL\MySQL Server 5.7\include/my_global.h: In function 'set_timespec_nsec':
C:\Program Files\MySQL\MySQL Server 5.7\include/my_global.h:702:3: warning: implicit declaration of function 'GetSystemTimeAsFileTime' [-Wimplicit-function-declaration]
   GetSystemTimeAsFileTime(&tv.ft);
   ^
C:\Program Files\MySQL\MySQL Server 5.7\include/my_global.h:703:30: error: '__int64' undeclared (first use in this function)
   abstime->tv.i64= tv.i64 + (__int64)(nsec / 100);
                              ^
C:\Program Files\MySQL\MySQL Server 5.7\include/my_global.h:703:30: note: each undeclared identifier is reported only once for each function it appears in


MinGW/External:
make clean 
Error on line 7: expecting target : dependencies
make all 
Error on line 7: expecting target : dependencies


MinGW/Internal:
Info: Internal Builder is used for build
gcc -std=c99 "-IC:\\Program Files\\MySQL\\MySQL Server 5.7\\include" "-IC:\\Program Files\\MySQL\\Connector.C++ 1.1\\include" -O3 -Wall -c -fmessage-length=0 -o Test.o "..\\Test.c" 
In file included from ..\Test.c:1:0:
C:\Program Files\MySQL\MySQL Server 5.7\include/my_global.h:220:19: error: conflicting types for 'mode_t'
 typedef int       mode_t;
                   ^
In file included from c:\mingw\include\io.h:56:0,
                 from C:\Program Files\MySQL\MySQL Server 5.7\include/my_global.h:38,
                 from ..\Test.c:1:
c:\mingw\include\sys\types.h:205:19: note: previous declaration of 'mode_t' was here
 typedef _mode_t   mode_t;
                   ^
In file included from C:\Program Files\MySQL\MySQL Server 5.7\include/my_global.h:631:0,
                 from ..\Test.c:1:
C:\Program Files\MySQL\MySQL Server 5.7\include/my_dbug.h:130:20: fatal error: crtdbg.h: No such file or directory
compilation terminated.


I am not well versed in writing C code, so despite a lot of research, and trying out different solutions, I have been unable to figure out the problems. Also, I am running 64 bit Windows 7 and my program will be running on that too. I even tried compiling the projects on 64 bit Linux Mint, but got the same errors there.

I only need to get one of the four projects to compile, so I can then try out that solution on my own project, so solving all four compilation errors isn't necessary to me, I've just tried out all those combinations in the hopes of finding one that would just compile without errors, but in vain.

So I hope someone can tell from the errors messages and my uploaded workspace, what the problems are and how to solve at least one of those problems.
  • Attachment: Test.zip
    (Size: 14.93MB, Downloaded 131 times)

[Updated on: Thu, 01 September 2016 12:46]

Report message to a moderator

Re: Compile errors with MinGW/CygWin/CDT [message #1742316 is a reply to message #1742270] Thu, 01 September 2016 18:12 Go to previous messageGo to next message
Tauno Voipio is currently offline Tauno VoipioFriend
Messages: 690
Registered: August 2014
Senior Member
It seems that you're attempting to compile C++ header files with plain C compiler.


--

Tauno Voipio
Re: Compile errors with MinGW/CygWin/CDT [message #1752930 is a reply to message #1742316] Mon, 30 January 2017 21:42 Go to previous message
Michael Pedersen is currently offline Michael PedersenFriend
Messages: 3
Registered: September 2016
Junior Member
I forgot I had posted this. But that seems very unlikely, as I'm using the MySQL C api and their C connector, not the C++ connector.
Previous Topic:Microsoft Visual C++ toolchain does not exist
Next Topic:build log print in an external file
Goto Forum:
  


Current Time: Sun Jan 23 02:24:05 GMT 2022

Powered by FUDForum. Page generated in 0.02529 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top