Code::Blocks Forums

User forums => Help => Topic started by: thed0ctor on November 22, 2011, 05:55:24 am

Title: Execution of 'g++.exe ... failed'
Post by: thed0ctor on November 22, 2011, 05:55:24 am
So i've been having this problem for months now, didn't have this problem a while ago and it's happening on all my computers. Basically I can't run anything I write in codeblocks. It's all the same error. For example if I write:

Code
//main.cpp
#include <iostream>

using namespace std;

int main()
{

      cout << "Whazzzuppp" << endl;



}


I receive the dialogue box "It seems that this file has not been built yet. Do you want to build it now?"

No matter how many times I select "yes" it still returns and doesn't do anything. Meanwhile the build log keeps saying:

Compiling: C:\Users\TheDoctor\Desktop\Untitled1.cpp
Execution of 'g++.exe    -c C:/Users/TheDoctor/Desktop/Untitled1.cpp -o C:/Users/TheDoctor/Desktop/Untitled1.o' in 'C:\Users\TheDoctor\Desktop' failed.
Nothing to be done.

Checking for existence: C:\Users\TheDoctor\Desktop\Untitled1.exe

On the dialogue box, if I select no, then the command line opens with nothing in it except "Process returned 0 (0x0) execution time : 0.000 s
Press any key to continue.

The Build log says (when I select no):

Compiling: C:\Users\TheDoctor\Desktop\Untitled1.cpp
Execution of 'g++.exe    -c C:/Users/TheDoctor/Desktop/Untitled1.cpp -o C:/Users/TheDoctor/Desktop/Untitled1.o' in 'C:\Users\TheDoctor\Desktop' failed.
Nothing to be done.

Checking for existence: C:\Users\TheDoctor\Desktop\Untitled1.exe
Executing: C:\Program Files (x86)\CodeBlocks/cb_console_runner.exe "C:\Users\TheDoctor\Desktop\Untitled1.exe" (in C:\Users\TheDoctor\Desktop)


I am using Cygwin GCC as my compiler, I have installed it and all the files are there.

Any help would be much appreciated!
Title: Re: Execution of 'g++.exe ... failed'
Post by: oBFusCATed on November 22, 2011, 09:25:50 am
Standard answer for you - read the FAQ: http://wiki.codeblocks.org/index.php?title=FAQ-Compiling_%28errors%29
And search the forum.
Also switch to mingw, if there is no serious reason to use cygwin.
Title: Re: Execution of 'g++.exe ... failed'
Post by: thed0ctor on November 22, 2011, 05:53:33 pm
Standard answer for you - read the FAQ: http://wiki.codeblocks.org/index.php?title=FAQ-Compiling_%28errors%29
And search the forum.
Also switch to mingw, if there is no serious reason to use cygwin.

The FAQ didn't have anything related to my problem. I looked at the "troubleshooting compiler" section and I can't even get past the error I posed above for it to give me more information.
 and I have searched the forums. To show you, I looked:

http://forums.codeblocks.org/index.php/topic,14893.0.html No response

http://forums.codeblocks.org/index.php/topic,15185.0.html UAC is already disabled and running as admin doesn't help

http://forums.codeblocks.org/index.php/topic,14209.0.html no real answer as I already checked the files to see if they were there, don't know if they're the correct ones, just going off what codeblocks automatically selected

http://forums.codeblocks.org/index.php/topic,15370.0.html didn't show me anything

http://forums.codeblocks.org/index.php/topic,15290.0.html I have a compiler already

http://forums.codeblocks.org/index.php/topic,6953.0.html no responses

http://forums.codeblocks.org/index.php/topic,13489.0.html tried reinstalling already

http://forums.codeblocks.org/index.php/topic,14845.0.html it detects my compiler fine

http://forums.codeblocks.org/index.php/topic,14614.0.html not using beta

http://forums.codeblocks.org/index.php/topic,12476.0.html no response and asked user to search which is what i've already done as shown above

http://forums.codeblocks.org/index.php/topic,12810.0.html not using widgets, the object file wasn't already created

http://forums.codeblocks.org/index.php/topic,12228.0.html asked to search the forums

Many responses above said to search the forum and some posted links in that same thread also asked to search the forums

For example:
http://forums.codeblocks.org/index.php/topic,13844.0.html

first response is:
Hm, what about searching before posting?

Simple fast search (by pasting the title of your post in the search field):
1. http://forums.codeblocks.org/index.php/topic,12228.0.html
2. http://forums.codeblocks.org/index.php/topic,12211.0.html
3. http://forums.codeblocks.org/index.php/topic,12950.0.html
4. http://forums.codeblocks.org/index.php/topic,13030.0.html

And some suggestions:
1. Read this: http://wiki.codeblocks.org/index.php?title=FAQ#Q:_How_do_I_troubleshoot_an_compiler_problem.3F
2. Ensure that your compiler is installed and can be run
3. Check the permissions for your project

the first link asked the user to search the forum and the two probable solutions weren't applicable to me
the second link had no replies
the third link didn't apply to me as i have no spaces in the directory path, am using a different compiler Cygwin, mine says nothing about checking existence, i'm not using a makefile
the fourth link isn't even the same error

Now I feel like I've shown that I've searched the forum, looked for answers and haven't found them and have explained on the many I looked at why these answers didn't work or weren't applicable to me. If there is an answer to this problem I haven't mentioned above I respectfully ask you to direct me to a link as I can't find any that have been helpful. My OS is Windows 7 Ultimate 64bit and codeblocks version is 10.05.
Title: Re: Execution of 'g++.exe ... failed'
Post by: zabzonk on November 22, 2011, 06:03:27 pm
One thing you may have noticed in your searching is that there is a noticeable antipathy to Cygwin (understandably so, IMHO). This means that probably you are not likely to get vast amounts of help on your problem here, simply because few forum regulars actually use the thing. If you want to compile C++ programs on Windows, and if you don't need the Cygwin POSIX emulation stuff (i.e. you are not trying to build and run  Linux/UNIX specific code on Windows) then the MinGW solution from TDM at http://tdm-gcc.tdragon.net is far superior, and works very well with CB.
Title: Re: Execution of 'g++.exe ... failed'
Post by: stahta01 on November 22, 2011, 06:09:36 pm
Link to my last answer I gave that I found.

http://forums.codeblocks.org/index.php/topic,12401.0.html

NOTE: You need to link to real exe NOT links.

Every year or so, I try using Cygwin; it is broken a lot because of changes in Cygwin and in Code::Blocks.

Tim S.
Title: Re: Execution of 'g++.exe ... failed'
Post by: oBFusCATed on November 22, 2011, 06:20:14 pm
One question: does it work if you execute the commands from the command line manually?
Title: Re: Execution of 'g++.exe ... failed'
Post by: eb on January 21, 2012, 02:55:24 am
I've just started getting this error also.

One reason to use Cygwin is that cygwin has a library that contains the clnt_create function which is unnecessary to establish an RPC connection/request.
Title: Re: Execution of 'g++.exe ... failed'
Post by: stahta01 on January 21, 2012, 03:11:51 am
Standard response do NOT use the files that are just logical links

Try the ones that end with -4 or -3.

If "gcc.exe" fails to work try "gcc-4.exe" or "gcc-3.exe".

Tim S.