Author Topic: Building Error  (Read 5260 times)

Offline Jeman

  • Single posting newcomer
  • *
  • Posts: 4
Building Error
« 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? ???

« Last Edit: May 27, 2012, 01:32:37 am by Jeman »

Offline Alpha

  • Developer
  • Lives here!
  • *****
  • Posts: 1513
Re: Building Error
« Reply #1 on: May 27, 2012, 01:33:45 am »
Do you have a compiler installed?

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7591
    • My Best Post
Re: Building Error
« Reply #2 on: May 27, 2012, 01:44:24 am »
Do you have a compiler installed?

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

Tim S.
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 64 bit.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline Jeman

  • Single posting newcomer
  • *
  • Posts: 4
Re: Building Error
« Reply #3 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.

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7591
    • My Best Post
Re: Building Error
« Reply #4 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

Tim S.

C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 64 bit.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline Jeman

  • Single posting newcomer
  • *
  • Posts: 4
Re: Building Error
« Reply #5 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
« Last Edit: May 27, 2012, 02:48:55 am by Jeman »

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7591
    • My Best Post
Re: Building Error
« Reply #6 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.  
« Last Edit: May 27, 2012, 02:55:19 am by stahta01 »
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 64 bit.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline Jeman

  • Single posting newcomer
  • *
  • Posts: 4
Re: Building Error
« Reply #7 on: May 27, 2012, 02:58:01 am »
C:\Program Files\CodeBlocks\MinGW

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7591
    • My Best Post
Re: Building Error
« Reply #8 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.
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 64 bit.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7591
    • My Best Post
Re: Building Error
« Reply #9 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
« Last Edit: May 27, 2012, 06:50:55 am by stahta01 »
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 64 bit.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org