User forums > Help
Code::Blocks not recognizing compiler
Haf:
Hello, I have also problems with the MinGW compiler under Vista.
Under XP my standard installation procedure works:
Download & unzip mingw-runtime (3.12), w32api, gdb, gcc-core + g++ (3.4.2) and binutils to C:\mingw\, set Gnu GCC Compiler in Codeblocks and auto-detect.
Under Vista, I received the same "cannot exec 'cc1plus': No such file or directory" error, when trying to build a project (created afterwards, default console hello world app). I just tried to set the path variable to the cc1plus directory as suggested, now I receive this error:
:: === musikRateTest, Debug ===
d:\Projekte\CPP\musikRateTest\main.cpp:1: iostream: No such file or directory
d:\Projekte\CPP\musikRateTest\main.cpp:: In function `int main()':
d:\Projekte\CPP\musikRateTest\main.cpp:7: error: `cout' undeclared (first use this function)
d:\Projekte\CPP\musikRateTest\main.cpp:7: error: (Each undeclared identifier is reported only once for each function it appears in.)
d:\Projekte\CPP\musikRateTest\main.cpp:7: error: `endl' undeclared (first use this function)
:: === Build finished: 4 errors, 0 warnings ===
I have no idea what is wrong, but I'm guessing that something in the Vista way of finding files doesn't like MingW or Code::Blocks.
Is there some (easy :)) way to fix this?
edit: Sorry, I didn't read the text above closely enough. :)
I now also added the -v option, here is the complete build log:
--- Quote ----------------- Build: Debug in musikRateTest ---------------
Compiling: main.cpp
Using built-in specs.
Configured with: ../gcc/configure --with-gcc --with-gnu-ld --with-gnu-as --host=mingw32 --target=mingw32 --prefix=/mingw --enable-threads --disable-nls --enable-languages=c,c++,f77,ada,objc,java --disable-win32-registry --disable-shared --enable-sjlj-exceptions --enable-libgcj --disable-java-awt --without-x --enable-java-gc=boehm --disable-libgcj-debug --enable-interpreter --enable-hash-synchronization --enable-libstdcxx-debug
Thread model: win32
gcc version 3.4.2 (mingw-special)
cc1plus -quiet -v -IC:\MinGW\include -iprefix ../lib/gcc/mingw32/3.4.2/ d:\Projekte\CPP\musikRateTest\main.cpp -quiet -dumpbase main.cpp -auxbase-strip obj\Debug\main.o -g -Wall -version -fexceptions -o ./ccqiaaaa.s
ignoring nonexistent directory "../lib/gcc/mingw32/3.4.2/../../../../include/c++/3.4.2"
ignoring nonexistent directory "../lib/gcc/mingw32/3.4.2/../../../../include/c++/3.4.2/mingw32"
ignoring nonexistent directory "../lib/gcc/mingw32/3.4.2/../../../../include/c++/3.4.2/backward"
ignoring nonexistent directory "../lib/gcc/mingw32/3.4.2/../../../../include"
ignoring nonexistent directory "../lib/gcc/mingw32/3.4.2/include"
ignoring nonexistent directory "../lib/gcc/mingw32/3.4.2/../../../../mingw32/include"
ignoring nonexistent directory "/mingw/include/c++/3.4.2"
ignoring nonexistent directory "/mingw/include/c++/3.4.2/mingw32"
ignoring nonexistent directory "/mingw/include/c++/3.4.2/backward"
ignoring nonexistent directory "/mingw/include"
ignoring nonexistent directory "/mingw/include"
ignoring nonexistent directory "/mingw/lib/gcc/mingw32/3.4.2/include"
ignoring nonexistent directory "/mingw/mingw32/include"
ignoring nonexistent directory "/mingw/include"
#include "..." search starts here:
#include <...> search starts here:
C:/MinGW/include
End of search list.
GNU C++ version 3.4.2 (mingw-special) (mingw32)
compiled by GNU C version 3.4.2 (mingw-special).
GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
d:\Projekte\CPP\musikRateTest\main.cpp:1:20: iostream: No such file or directory
d:\Projekte\CPP\musikRateTest\main.cpp: In function `int main()':
d:\Projekte\CPP\musikRateTest\main.cpp:7: error: `cout' undeclared (first use this function)
d:\Projekte\CPP\musikRateTest\main.cpp:7: error: (Each undeclared identifier is reported only once for each function it appears in.)
d:\Projekte\CPP\musikRateTest\main.cpp:7: error: `endl' undeclared (first use this function)
Process terminated with status 1 (0 minutes, 0 seconds)
4 errors, 0 warnings
--- End quote ---
I guess, the nonexisting directory messages point to the problem. :)
darthdespotism:
Go to your Compiler-Settings.
There I added
--- Code: ----I"C:/mingw/include/c++/3.4.2"
-I"C:/mingw/include/c++/3.4.2/mingw32"
-I"C:/mingw/include/c++/3.4.2/backward"
-I"C:/mingw/include"
-I"C:/mingw/lib/gcc/mingw32/3.4.2/include"
-I"C:/mingw/mingw32/include"
--- End code ---
EDIT://
It seems to be imposible to build a File that is not on the same Partition as MinGW ist. try out this too
Haf:
Adding these parameters to the Compiler options brings
--- Quote ----------------- Build: Debug in musikRateTest ---------------
Linking console executable: bin\Debug\musikRateTest.exe
ld: crt2.o: No such file: No such file or directory
Process terminated with status 1 (0 minutes, 0 seconds)
0 errors, 0 warnings
--- End quote ---
So compiling runs through, linking does not.
Having the project on the same partition as MinGW works, even without those parameters!
Thanks, it's not perfect, but at least I can build now. :) That's good enough for the near future. ;)
darthdespotism:
please try to add a -L"C:/mingw/lib" to your Linker - Flags
Haf:
Would that be in Settings -> Compiler -> Linker -> Other linker settings?
I tried to add it there, but it didn't have any effect.
Navigation
[0] Message Index
[#] Next page
[*] Previous page
Go to full version