Code::Blocks

Developer forums (C::B DEVELOPMENT STRICTLY!) => Contributions to C::B => Topic started by: nafatrue on October 22, 2012, 11:31:57 pm

Title: my 1st thread need help friends
Post by: nafatrue on October 22, 2012, 11:31:57 pm
hi friends first of all sorry for my language i'm newbie i'm compiling a executable for windows but i get several errors  heres my debug log

-------------- Build: Debug in Server ---------------

Compiling: main.c
In file included from c:\mingw32\bin\../lib/gcc/mingw32/4.7.1/../../../../include/sys/types.h:70:0,
                 from c:\mingw32\bin\../lib/gcc/mingw32/4.7.1/../../../../include/stdio.h:534,
                 from E:\projectzzz\Second\Server\main.c:10:
C:\MinGW32\include\types.h:120:2: error: unknown type name 'pid_t'
In file included from E:\projectzzz\Second\Server\main.c:10:0:
c:\mingw32\bin\../lib/gcc/mingw32/4.7.1/../../../../include/stdio.h: In function 'ftello64':
c:\mingw32\bin\../lib/gcc/mingw32/4.7.1/../../../../include/stdio.h:553:23: error: expected ')' before 'pos'
In file included from E:\projectzzz\Second\Server\main.c:18:0:
c:\mingw32\bin\../lib/gcc/mingw32/4.7.1/../../../../include/sys/socket.h: At top level:
c:\mingw32\bin\../lib/gcc/mingw32/4.7.1/../../../../include/sys/socket.h:30:44: error: unknown type name 'socklen_t'
c:\mingw32\bin\../lib/gcc/mingw32/4.7.1/../../../../include/sys/socket.h:31:46: error: unknown type name 'socklen_t'
c:\mingw32\bin\../lib/gcc/mingw32/4.7.1/../../../../include/sys/socket.h:32:52: error: unknown type name 'socklen_t'
c:\mingw32\bin\../lib/gcc/mingw32/4.7.1/../../../../include/sys/socket.h:33:46: error: unknown type name 'socklen_t'
c:\mingw32\bin\../lib/gcc/mingw32/4.7.1/../../../../include/sys/socket.h:34:50: error: unknown type name 'socklen_t'
c:\mingw32\bin\../lib/gcc/mingw32/4.7.1/../../../../include/sys/socket.h:35:50: error: unknown type name 'socklen_t'
c:\mingw32\bin\../lib/gcc/mingw32/4.7.1/../../../../include/sys/socket.h:36:7: error: conflicting types for 'listen'
In file included from c:\mingw32\bin\../lib/gcc/mingw32/4.7.1/../../../../include/windows.h:98:0,
                 from E:\projectzzz\Second\Server\main.c:9:
c:\mingw32\bin\../lib/gcc/mingw32/4.7.1/../../../../include/winsock2.h:546:32: note: previous declaration of 'listen' was here
In file included from E:\projectzzz\Second\Server\main.c:18:0:
c:\mingw32\bin\../lib/gcc/mingw32/4.7.1/../../../../include/sys/socket.h:37:11: error: conflicting types for 'recv'
In file included from c:\mingw32\bin\../lib/gcc/mingw32/4.7.1/../../../../include/windows.h:98:0,
                 from E:\projectzzz\Second\Server\main.c:9:
c:\mingw32\bin\../lib/gcc/mingw32/4.7.1/../../../../include/winsock2.h:547:32: note: previous declaration of 'recv' was here
In file included from E:\projectzzz\Second\Server\main.c:18:0:
c:\mingw32\bin\../lib/gcc/mingw32/4.7.1/../../../../include/sys/socket.h:39:32: error: unknown type name 'socklen_t'
c:\mingw32\bin\../lib/gcc/mingw32/4.7.1/../../../../include/sys/socket.h:41:11: error: conflicting types for 'send'
In file included from c:\mingw32\bin\../lib/gcc/mingw32/4.7.1/../../../../include/windows.h:98:0,
                 from E:\projectzzz\Second\Server\main.c:9:
c:\mingw32\bin\../lib/gcc/mingw32/4.7.1/../../../../include/winsock2.h:549:32: note: previous declaration of 'send' was here
In file included from E:\projectzzz\Second\Server\main.c:18:0:
c:\mingw32\bin\../lib/gcc/mingw32/4.7.1/../../../../include/sys/socket.h:44:34: error: unknown type name 'socklen_t'
c:\mingw32\bin\../lib/gcc/mingw32/4.7.1/../../../../include/sys/socket.h:46:5: error: unknown type name 'socklen_t'
c:\mingw32\bin\../lib/gcc/mingw32/4.7.1/../../../../include/sys/socket.h:48:5: error: unknown type name 'socklen_t'
c:\mingw32\bin\../lib/gcc/mingw32/4.7.1/../../../../include/sys/socket.h:49:7: error: conflicting types for 'shutdown'
In file included from c:\mingw32\bin\../lib/gcc/mingw32/4.7.1/../../../../include/windows.h:98:0,
                 from E:\projectzzz\Second\Server\main.c:9:
c:\mingw32\bin\../lib/gcc/mingw32/4.7.1/../../../../include/winsock2.h:552:32: note: previous declaration of 'shutdown' was here
In file included from E:\projectzzz\Second\Server\main.c:18:0:
c:\mingw32\bin\../lib/gcc/mingw32/4.7.1/../../../../include/sys/socket.h:50:7: error: conflicting types for 'socket'
In file included from c:\mingw32\bin\../lib/gcc/mingw32/4.7.1/../../../../include/windows.h:98:0,
                 from E:\projectzzz\Second\Server\main.c:9:
c:\mingw32\bin\../lib/gcc/mingw32/4.7.1/../../../../include/winsock2.h:553:35: note: previous declaration of 'socket' was here
In file included from E:\projectzzz\Second\Server\main.c:18:0:
c:\mingw32\bin\../lib/gcc/mingw32/4.7.1/../../../../include/sys/socket.h:53:19: error: conflicting types for 'getservbyname'
In file included from c:\mingw32\bin\../lib/gcc/mingw32/4.7.1/../../../../include/windows.h:98:0,
                 from E:\projectzzz\Second\Server\main.c:9:
c:\mingw32\bin\../lib/gcc/mingw32/4.7.1/../../../../include/winsock2.h:557:57: note: previous declaration of 'getservbyname' was here
In file included from C:\Cygwin\usr\include\cygwin\in.h:21:0,
                 from c:\mingw32\bin\../lib/gcc/mingw32/4.7.1/../../../../include/netinet/in.h:14,
                 from E:\projectzzz\Second\Server\main.c:19:
C:\Cygwin\usr\include\cygwin\socket.h:29:8: error: redefinition of 'struct sockaddr'
In file included from c:\mingw32\bin\../lib/gcc/mingw32/4.7.1/../../../../include/windows.h:98:0,
                 from E:\projectzzz\Second\Server\main.c:9:
c:\mingw32\bin\../lib/gcc/mingw32/4.7.1/../../../../include/winsock2.h:336:8: note: originally defined here
In file included from C:\Cygwin\usr\include\cygwin\in.h:21:0,
                 from c:\mingw32\bin\../lib/gcc/mingw32/4.7.1/../../../../include/netinet/in.h:14,
                 from E:\projectzzz\Second\Server\main.c:19:
C:\Cygwin\usr\include\cygwin\socket.h:41:8: error: redefinition of 'struct sockaddr_storage'
In file included from c:\mingw32\bin\../lib/gcc/mingw32/4.7.1/../../../../include/windows.h:98:0,
                 from E:\projectzzz\Second\Server\main.c:9:
c:\mingw32\bin\../lib/gcc/mingw32/4.7.1/../../../../include/winsock2.h:356:8: note: originally defined here
In file included from C:\Cygwin\usr\include\cygwin\in.h:21:0,
                 from c:\mingw32\bin\../lib/gcc/mingw32/4.7.1/../../../../include/netinet/in.h:14,
                 from E:\projectzzz\Second\Server\main.c:19:
C:\Cygwin\usr\include\cygwin\socket.h:59:8: error: redefinition of 'struct linger'
In file included from c:\mingw32\bin\../lib/gcc/mingw32/4.7.1/../../../../include/windows.h:98:0,
                 from E:\projectzzz\Second\Server\main.c:9:
c:\mingw32\bin\../lib/gcc/mingw32/4.7.1/../../../../include/winsock2.h:128:8: note: originally defined here
In file included from c:\mingw32\bin\../lib/gcc/mingw32/4.7.1/../../../../include/netinet/in.h:14:0,
                 from E:\projectzzz\Second\Server\main.c:19:
C:\Cygwin\usr\include\cygwin\in.h:30:3: error: expected identifier before numeric constant
C:\Cygwin\usr\include\cygwin\in.h:76:3: error: expected identifier before numeric constant
C:\Cygwin\usr\include\cygwin\in.h:114:8: error: redefinition of 'struct in_addr'
In file included from c:\mingw32\bin\../lib/gcc/mingw32/4.7.1/../../../../include/windows.h:98:0,
                 from E:\projectzzz\Second\Server\main.c:9:
c:\mingw32\bin\../lib/gcc/mingw32/4.7.1/../../../../include/winsock2.h:223:8: note: originally defined here
In file included from c:\mingw32\bin\../lib/gcc/mingw32/4.7.1/../../../../include/netinet/in.h:14:0,
                 from E:\projectzzz\Second\Server\main.c:19:
C:\Cygwin\usr\include\cygwin\in.h:116:13: error: expected ':', ',', ';', '}' or '__attribute__' before '.' token
C:\Cygwin\usr\include\cygwin\in.h:183:8: error: redefinition of 'struct sockaddr_in'
In file included from c:\mingw32\bin\../lib/gcc/mingw32/4.7.1/../../../../include/windows.h:98:0,
                 from E:\projectzzz\Second\Server\main.c:9:
c:\mingw32\bin\../lib/gcc/mingw32/4.7.1/../../../../include/winsock2.h:254:8: note: originally defined here
In file included from C:\Cygwin\usr\include\cygwin\in.h:250:0,
                 from c:\mingw32\bin\../lib/gcc/mingw32/4.7.1/../../../../include/netinet/in.h:14,
                 from E:\projectzzz\Second\Server\main.c:19:
C:\Cygwin\usr\include\asm\byteorder.h:26:17: error: conflicting types for 'ntohl'
In file included from c:\mingw32\bin\../lib/gcc/mingw32/4.7.1/../../../../include/windows.h:98:0,
                 from E:\projectzzz\Second\Server\main.c:9:
c:\mingw32\bin\../lib/gcc/mingw32/4.7.1/../../../../include/winsock2.h:629:35: note: previous declaration of 'ntohl' was here
In file included from C:\Cygwin\usr\include\cygwin\in.h:250:0,
                 from c:\mingw32\bin\../lib/gcc/mingw32/4.7.1/../../../../include/netinet/in.h:14,
                 from E:\projectzzz\Second\Server\main.c:19:
C:\Cygwin\usr\include\asm\byteorder.h:27:17: error: conflicting types for 'ntohs'
In file included from c:\mingw32\bin\../lib/gcc/mingw32/4.7.1/../../../../include/windows.h:98:0,
                 from E:\projectzzz\Second\Server\main.c:9:
c:\mingw32\bin\../lib/gcc/mingw32/4.7.1/../../../../include/winsock2.h:631:36: note: previous declaration of 'ntohs' was here
In file included from C:\Cygwin\usr\include\cygwin\in.h:250:0,
                 from c:\mingw32\bin\../lib/gcc/mingw32/4.7.1/../../../../include/netinet/in.h:14,
                 from E:\projectzzz\Second\Server\main.c:19:
C:\Cygwin\usr\include\asm\byteorder.h:28:17: error: conflicting types for 'htonl'
In file included from c:\mingw32\bin\../lib/gcc/mingw32/4.7.1/../../../../include/windows.h:98:0,
                 from E:\projectzzz\Second\Server\main.c:9:
c:\mingw32\bin\../lib/gcc/mingw32/4.7.1/../../../../include/winsock2.h:628:35: note: previous declaration of 'htonl' was here
In file included from C:\Cygwin\usr\include\cygwin\in.h:250:0,
                 from c:\mingw32\bin\../lib/gcc/mingw32/4.7.1/../../../../include/netinet/in.h:14,
                 from E:\projectzzz\Second\Server\main.c:19:
C:\Cygwin\usr\include\asm\byteorder.h:29:17: error: conflicting types for 'htons'
In file included from c:\mingw32\bin\../lib/gcc/mingw32/4.7.1/../../../../include/windows.h:98:0,
                 from E:\projectzzz\Second\Server\main.c:9:
c:\mingw32\bin\../lib/gcc/mingw32/4.7.1/../../../../include/winsock2.h:630:36: note: previous declaration of 'htons' was here
In file included from c:\mingw32\bin\../lib/gcc/mingw32/4.7.1/../../../../include/unistd.h:12:0,
                 from E:\projectzzz\Second\Server\main.c:20:
c:\mingw32\bin\../lib/gcc/mingw32/4.7.1/../../../../include/io.h:288:22: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'lseek64'
c:\mingw32\bin\../lib/gcc/mingw32/4.7.1/../../../../include/io.h:289:22: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'lseek64'
In file included from c:\mingw32\bin\../lib/gcc/mingw32/4.7.1/../../../../include/unistd.h:13:0,
                 from E:\projectzzz\Second\Server\main.c:20:
c:\mingw32\bin\../lib/gcc/mingw32/4.7.1/../../../../include/process.h:60:51: error: unknown type name '_pid_t'
c:\mingw32\bin\../lib/gcc/mingw32/4.7.1/../../../../include/process.h:62:40: error: expected ',' or ';' before '_getpid'
In file included from E:\projectzzz\Second\Server\main.c:21:0:
c:\mingw32\bin\../lib/gcc/mingw32/4.7.1/../../../../include/netdb.h:79:8: error: redefinition of 'struct hostent'
Process terminated with status 1 (0 minutes, 5 seconds)
50 errors, 0 warnings
 

any ideas to get rid of this i'm trying for 5 days no results i've modifies several files no results the same errors
Title: Re: my 1st thread need help friends
Post by: stahta01 on October 23, 2012, 12:54:53 am
I strongly recommend NOT mixing Cygwin and MinGW GCC.

NOTE: This IS NOT a programming support site; this thread is likely to be locked or deleted with no warning.

Tim S. 
Title: Re: my 1st thread need help friends
Post by: nafatrue on October 23, 2012, 09:40:06 pm
thnx frind for the reply sorry i didn't know that i shouldnt post something like this in here,,,,,
Title: Re: my 1st thread need help friends
Post by: ouch on October 24, 2012, 09:49:06 pm
The problem is that mingw has it's own headers, and cygwin has it's headers as well. So when you compile, a little of both headers get used and you wind up with conflicts and missing stuff. So to fix this use mingw OR cygwin, not both.

But this is a compiler set up issue and not related to codeblocks, that's why it will likely get locked or deleted.