I think the problem is with my understanding of how the compiler and/or CB handles headers and search directories. Now for some background. I'm attempting to migrate from Dev-C++, which is the only IDE I've really used in the past couple or so years. Today I downloaded and installed Code::Blocks nightly build 4235. The default compiler is set as 'Cygwin GCC' (installed in "D:\cygwin"), which CB detected automatically. I'm attempting to create projects for my old C files that I had projects for in Dev-C++. In one project, a 'generic' DLL, an early setup of CB resulted in a successful compile. After compiling, I attempted to add a compiler 'search directory' entry to point to the Microsoft Platform SDK include directory (as this will be necessary with some of my other projects), with a path of "D:\Program Files\Microsoft SDK\include". When I attempted to re-build my project, I was deluged with build errors, the first of which are shown below.
Compiling: generic.c
In file included from D:/c/genericdll/generic.c:2:
D:/Program Files/Microsoft SDK/include/windows.h:157:19: excpt.h: No such file or directory
In file included from D:/Program Files/Microsoft SDK/include/winnt.h:116,
from D:/Program Files/Microsoft SDK/include/windef.h:166,
from D:/Program Files/Microsoft SDK/include/windows.h:161,
from D:/c/genericdll/generic.c:2:
This leads me to my first question. Why is the compiler trying to use the windows.h in my PSDK directory, instead of the default Cygwin directory that was used previously? I found the "excpt.h" file in two primary locations, "D:\Program Files\Microsoft SDK\src\crt" and "D:\cygwin\usr\include\mingw". If I add "D:\cygwin\usr\include\mingw" as a search directory, subsequent build attempts spew out many more errors, the first two of which are shown below.
Compiling: generic.c
In file included from D:/Program Files/Microsoft SDK/include/windef.h:166,
from D:/cygwin/usr/include/mingw/excpt.h:20,
from D:/Program Files/Microsoft SDK/include/windows.h:157,
from D:/c/genericdll/generic.c:2:
D:/Program Files/Microsoft SDK/include/winnt.h:237:1: warning: "_cdecl" redefined
<built-in>:77:1: warning: this is the location of the previous definition
D:/Program Files/Microsoft SDK/include/winnt.h:674:2: #error Must define a target architecture.
If I replace the "D:\cygwin\usr\include\mingw" search directory with "D:\Program Files\Microsoft SDK\src\crt", subsequent build attempts again results with a flood of errors, the first two of which are shown below.
Compiling: generic.c
In file included from D:/c/genericdll/generic.c:1:
D:/Program Files/Microsoft SDK/src/crt/stdio.h:23:2: #error ERROR: Only Win32 target supported!
D:/Program Files/Microsoft SDK/src/crt/stdio.h:31:2: #error ERROR: Use of C runtime library internal header file.
In file included from D:/Program Files/Microsoft SDK/src/crt/stdio.h:47,
from D:/c/genericdll/generic.c:1:
D:/Program Files/Microsoft SDK/src/crt/cruntime.h:27:2: #error ERROR: Use of C runtime library internal header file.
What am I doing wrong? I didn't change any of my code, I simply added a search path for future use which has resulted in an inability to build my project. I don't understand what's going on here. In my Dev-C++ installation (no longer installed), I setup my project with a 'Library Directory' of "D:\Program Files\Microsoft SDK\Lib" and an 'Include Directory' of "D:\Program Files\Microsoft SDK\include", and all was well (no problems building the project).
Please help a poor confused noob. Any input would be appreciated.