Hello,
I am using CodeBlocks in a Ubuntu. However, I want to be able to compile windows libraries/applications. Therefore I downloaded the windows api from this source:
http://sunet.dl.sourceforge.net/project/mingw/MinGW/BaseSystem/RuntimeLibrary/Win32-API/w32api-3.14/w32api-3.14-mingw32-dev.tar.gzI extracted the archive to a folder, I created, and added <myfolder>/include to the "Search Directories" in Settings->Compiler and Debugger...
Now, when I am compiling a file including <windows.h>, i get the following errors:
/usr/include/bits/time.h|69|error: redefinition of ‘struct timeval’|
/data/Programmierung/WinAPI/include/winsock2.h|109|error: previous definition of ‘struct timeval’|
/usr/include/sys/select.h|78|error: conflicting declaration ‘typedef struct fd_set fd_set’|
/data/Programmierung/WinAPI/include/winsock2.h|64|error: ‘fd_set’ has a previous declaration as ‘typedef struct fd_set fd_set’|
/usr/include/sys/select.h|112|error: declaration of C function ‘int select(int, fd_set*, fd_set*, fd_set*, timeval*)’ conflicts with|
/data/Programmierung/WinAPI/include/winsock2.h|632|error: previous declaration ‘int select(int, fd_set*, fd_set*, fd_set*, const timeval*)’ here|
||=== Build finished: 6 errors, 0 warnings ===|
I guess this is a general problem, with a common solution. Even though I can't solve it, because I do not understand it in depth. I think the errors mean, that the standard library somehow is dependent on the api of the operating system. Does this mean that I have to install a different version of the c++ standard library for every platform I want to compile for?
Nice Greetings
sg