(Edit: 1 November 2007)
Found out this is a bug of MinGW, and has nothing to do with Dev-C++.
Recently I installed Dev-C++ under Windows Vista, but when I try to compile the template DLL, it gives the following error in compile log.
gcc.exe: installation problem, cannot exec `cc1′: No such file or directory
In Dev-C++, go to Tools -> Compiler Options -> Directories -> Binaries, add this following directory
\Dev-Cpp\libexec\gcc\mingw32\3.4.2
Compile the project again. Okay, now what?
ld: crt2.o: No such file: No such file or directory
ld: dllcrt2.o: No such file: No such file or directory
ld: crtbegin.o: No such file: No such file or directory
ld: crtend.o: No such file: No such file or directory
ld: cannot find -lgcc
(Update: 1 November 2007)
To workaround this errors, you need to do the following steps:
- Copy dllcrt2.o and crt2.o from \Dev-Cpp\lib to \MinGW\lib.
- Copy crtbegin.o and crtend.o from \Dev-Cpp\lib\gcc\mingw32\3.4.2 (version may vary depending on your mingw version) to \MinGW\lib.
- In Dev-C++, go to Tools -> Compiler Options -> Directories -> Libraries, add this following directory
\Dev-Cpp\lib\gcc\mingw32\3.4.2
(again, version may vary depending on your mingw version)
Compile your project, it should work now. Now I try to compile the C version, oh no more errors.
In file included from dllmain.c:3:
C:/Dev-Cpp/include/windows.h:47:20: stdarg.h: No such file or directory
In file included from C:/Dev-Cpp/include/winnt.h:37,
from C:/Dev-Cpp/include/windef.h:253,
from C:/Dev-Cpp/include/windows.h:48,
from dllmain.c:3:
C:/Dev-Cpp/include/string.h:24:20: stddef.h: No such file or directory
In file included from C:/Dev-Cpp/include/winnt.h:37,
from C:/Dev-Cpp/include/windef.h:253,
from C:/Dev-Cpp/include/windows.h:48,
from dllmain.c:3:
…
blah blah blah
…
Here’s the fix. In Dev-C++, go to Tools -> Compiler Options -> Directories -> C Includes, add this directory
\Dev-Cpp\lib\gcc\mingw32\3.4.2\include
(I dont want to repeat that again)
Okay now everything is working. Hopefully these should solve your problem regarding compiling with Dev-C++ under Windows Vista.