News:

As usual while waiting for the next release - don't forget to check the nightly builds in the forum.

Main Menu

cannot compile

Started by wobien, September 10, 2018, 11:23:00 PM

Previous topic - Next topic

BlueHazzard

OK, in the CMD type this in this order:
set PATH=%PATH%;c:\MinGW\bin
and then
mingw32-g++.exe -Wall -fexceptions -g  -c main.cpp -o main.o

The first command will add the MinGW compiler directory to your path so cmd can find the compiler command. The second command will try to build your source without codeblocks, so we can see if something is blocking the compiler.

[Edit:] as soon as you close the cmd you will have to retype the first command.

wobien

Still no succes... (see attachment)

wobien

There is no file mingw32-g++.exe in the directory c:\MinGW\bin. See my second attachement in my post at 07:17:49 pm

Miguel Gimenez

Try

mingw32-gcc.exe -Wall -fexceptions -g  -c main.cpp -o main.o


wobien

Now Mingw reacts, but still no succes...

Miguel Gimenez

It seems G++ is not installed (is an option). Try

mingw-get update

and then

mingw-get install g++

After this the original command (with mingw32-g++.exe) should work. Probably the compiler executables must be configured again in CB.


wobien

Yes, it compiles!

Miguel Gimenez and BlueHazzard, many thanks!

The only thing I don't understand is how it is possible that it compiled when I started the project???

Miguel Gimenez

Do you have two MinGW installations?. Probably there was one prior installation of MinGW bundled with Code::Blocks (under Program Files) that was working, and later the automatic detection found the c:\mingw one (as it is the expected path for MinGW).

wobien

Where would that Mingw installation bundled with Code::Blocks be? In a subdirectory of the Code::Blocks directory in Program Files?

Miguel Gimenez

IIRC it was installed under Program Files\Codeblocks, but I have not installed the bundled version in years.

wobien

I don't think I have two MinGW installations. In the Directory where Code::Blocks is installed I can't find anything that looks like MinGW.