Author Topic: cannot compile  (Read 8917 times)

Offline BlueHazzard

  • Developer
  • Lives here!
  • *****
  • Posts: 3353
Re: cannot compile
« Reply #15 on: September 12, 2018, 07:03:29 pm »
OK, in the CMD type this in this order:
Code
set PATH=%PATH%;c:\MinGW\bin
and then
Code
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.

Offline wobien

  • Multiple posting newcomer
  • *
  • Posts: 69
Re: cannot compile
« Reply #16 on: September 12, 2018, 07:17:04 pm »
Still no succes... (see attachment)

Offline wobien

  • Multiple posting newcomer
  • *
  • Posts: 69
Re: cannot compile
« Reply #17 on: September 12, 2018, 07:27:06 pm »
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

Offline Miguel Gimenez

  • Developer
  • Lives here!
  • *****
  • Posts: 1553
Re: cannot compile
« Reply #18 on: September 12, 2018, 07:31:22 pm »
Try

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


Offline wobien

  • Multiple posting newcomer
  • *
  • Posts: 69
Re: cannot compile
« Reply #19 on: September 12, 2018, 07:56:14 pm »
Now Mingw reacts, but still no succes...

Offline Miguel Gimenez

  • Developer
  • Lives here!
  • *****
  • Posts: 1553
Re: cannot compile
« Reply #20 on: September 12, 2018, 08:01:41 pm »
It seems G++ is not installed (is an option). Try

Code
mingw-get update

and then

Code
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.


Offline wobien

  • Multiple posting newcomer
  • *
  • Posts: 69
Re: cannot compile
« Reply #21 on: September 12, 2018, 08:22:39 pm »
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???

Offline Miguel Gimenez

  • Developer
  • Lives here!
  • *****
  • Posts: 1553
Re: cannot compile
« Reply #22 on: September 12, 2018, 08:34:07 pm »
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).

Offline wobien

  • Multiple posting newcomer
  • *
  • Posts: 69
Re: cannot compile
« Reply #23 on: September 12, 2018, 11:16:12 pm »
Where would that Mingw installation bundled with Code::Blocks be? In a subdirectory of the Code::Blocks directory in Program Files?

Offline Miguel Gimenez

  • Developer
  • Lives here!
  • *****
  • Posts: 1553
Re: cannot compile
« Reply #24 on: September 13, 2018, 12:38:04 pm »
IIRC it was installed under Program Files\Codeblocks, but I have not installed the bundled version in years.

Offline wobien

  • Multiple posting newcomer
  • *
  • Posts: 69
Re: cannot compile
« Reply #25 on: September 14, 2018, 07:40:27 pm »
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.