Code::Blocks Forums

User forums => Help => Topic started by: Jeman on May 27, 2012, 01:29:05 am

Title: Building Error
Post by: Jeman on May 27, 2012, 01:29:05 am
So I used the default script:

#include <iostream>

using namespace std;

int main()
{
    cout << "Hello world!" << endl;
    return 0;
}

I click the Build button which looks like a gear and on the log i get this error:
-------------- Build: Debug in Tutorial 1 ---------------

Compiling: main.cpp
Execution of 'mingw32-g++.exe -Wall -fexceptions  -g     -c "C:\Users\Jordan\Desktop\C++ Stuffs\Tutorials\Tutorial 1\main.cpp" -o obj\Debug\main.o' in 'C:\Users\Jordan\Desktop\C++ Stuffs\Tutorials\Tutorial 1' failed.
Nothing to be done.

It is a Console Application.
On C++.
With the GNU GCC Compiler
Solutions? ???

Title: Re: Building Error
Post by: Alpha on May 27, 2012, 01:33:45 am
Do you have a compiler installed (http://wiki.codeblocks.org/index.php?title=Installing_a_supported_compiler)?
Title: Re: Building Error
Post by: stahta01 on May 27, 2012, 01:44:24 am
Do you have a compiler installed (http://wiki.codeblocks.org/index.php?title=Installing_a_supported_compiler)?

Do you have a C++ Compiler Installed?
In this case, it is looking for "mingw32-g++.exe" as the C++ Compiler executable.

Tim S.
Title: Re: Building Error
Post by: Jeman on May 27, 2012, 02:10:33 am
Well i downloaded codeblocks-10.05mingw-setup.exe from the binaries section and it is supposed to install the compiler.
Title: Re: Building Error
Post by: stahta01 on May 27, 2012, 02:22:24 am
Well i downloaded codeblocks-10.05mingw-setup.exe from the binaries section and it is supposed to install the compiler.

I have no idea; if the user can turn off the installing of the C++ Compiler.
I would confirm the C++ Compiler was installed!

After that, I would turn on Full Compiler Logging.

http://wiki.codeblocks.org/index.php?title=FAQ-Compiling_%28errors%29#Q:_How_do_I_troubleshoot_a_compiler_problem.3F (http://wiki.codeblocks.org/index.php?title=FAQ-Compiling_%28errors%29#Q:_How_do_I_troubleshoot_a_compiler_problem.3F)

Tim S.

Title: Re: Building Error
Post by: Jeman on May 27, 2012, 02:29:27 am
I followed those instructions and this is all i get in the Build Log
-------------- Build: Debug in LOLOL ---------------

mingw32-g++.exe -Wall -fexceptions  -g     -c "C:\Users\Jordan\Desktop\C++ Stuffs\Tutorials\LOLOL\main.cpp" -o obj\Debug\main.o
Execution of 'mingw32-g++.exe -Wall -fexceptions  -g     -c "C:\Users\Jordan\Desktop\C++ Stuffs\Tutorials\LOLOL\main.cpp" -o obj\Debug\main.o' in 'C:\Users\Jordan\Desktop\C++ Stuffs\Tutorials\LOLOL' failed.
Nothing to be done.
Also when i installed it i selected full installiation
Title: Re: Building Error
Post by: stahta01 on May 27, 2012, 02:48:10 am
So you confirmed the exe existed; what folder was the exe inside of?

What folder is the Code::Blocks toolchain set to use?
(Also called the Compiler's Installation Directory)
seen via "Settings->Compiler and Debugger->Global Compiler settings->Toolchain executables"


Tim S.  
Title: Re: Building Error
Post by: Jeman on May 27, 2012, 02:58:01 am
C:\Program Files\CodeBlocks\MinGW
Title: Re: Building Error
Post by: stahta01 on May 27, 2012, 03:18:57 am
C:\Program Files\CodeBlocks\MinGW

You MUST CONFIRM
that the file mingw32-g++.exe exists inside the folder "C:\Program Files\CodeBlocks\MinGW\bin".
Does it exist?

Tim S.
Title: Re: Building Error
Post by: stahta01 on May 27, 2012, 06:27:00 am
What is needed to be done to test the command issued by CB works on the command line.
Open the CMD.exe command window and enter the below lines one at a time.
NOTE: You can skip the line(s) starting with REM.
Code
REM Set path to what CB uses
SET PATH=C:\Program Files\CodeBlocks\MinGW\bin;%PATH%

REM Directory to what CB used
CD /D "C:\Users\Jordan\Desktop\C++ Stuffs\Tutorials\LOLOL"

REM Command used by CB
mingw32-g++.exe -Wall -fexceptions -g -c "C:\Users\Jordan\Desktop\C++ Stuffs\Tutorials\LOLOL\main.cpp" -o obj\Debug\main.o