Solved

Code::Blocks

Posted on 2014-07-27
2
350 Views
Last Modified: 2014-08-01
When I try to build a simple c program I get the error.  How do I fix this?

mingw32-gcc.exe   -c "C:\Users\R\Documents\Test\Exercise 1.c" -o "C:\Users\R\Documents\Test\Exercise 1.o"
mingw32-g++.exe  -o "C:\Users\R\Documents\Test\Exercise 1.exe" "C:\Users\R\Documents\Test\Exercise 1.o"  
Execution of 'mingw32-g++.exe  -o "C:\Users\R\Documents\Test\Exercise 1.exe" "C:\Users\R\Documents\Test\Exercise 1.o"' in 'C:\Users\R\Documents\Test' failed.
Checking for existence: C:\Users\R\Documents\Test\Exercise 1.exe
0
Comment
Question by:Ray Turner
2 Comments
 
LVL 33

Accepted Solution

by:
sarabande earned 500 total points
ID: 40224253
it is not quite clear why you are switching from gcc (c and c++ compiler and linker) to g++ (c++ compiler and linker). though both are mostly invoking the same tools there are some differences:

stackoverflow.com/questions/172587/what-is-the-difference-between-g-and-gcc

generally I would recommend to using either gcc or g++ in a command window where the mingw environment already properly is installed and where you could use gcc/g++ commands instead of calling the mingw exe files. check your mingw tools in start menu for such a command window. or better, use the ide that probably came with your mingw setup and which would make your life happier.

the error messages of a compiler/linker should be taken literally. so the linker failed when checking for the existence of the exe file. it also could be that the exe file was (write-)protected somehow (for example when the program still runs). check for existence of the file and whether you could access (delete) it from windows explorer. if windows complains when you delete or execute the file, you may check whether the program is still running or whether the file attributes show a write-projection (perhaps added by version management). if another process accessed the file you may log-out from your account to get the issue solved.

if nothing helped, you may think of renaming the name "Exercise 1" to not containing a space character any more. though that shouldn't be  a stopper for a newer compiler, it might be that some additional tool has problems with that.

Sara
0
 

Author Closing Comment

by:Ray Turner
ID: 40233877
Thanks!
0

Featured Post

Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This tutorial is posted by Aaron Wojnowski, administrator at SDKExpert.net.  To view more iPhone tutorials, visit www.sdkexpert.net. This is a very simple tutorial on finding the user's current location easily. In this tutorial, you will learn ho…
This is a short and sweet, but (hopefully) to the point article. There seems to be some fundamental misunderstanding about the function prototype for the "main" function in C and C++, more specifically what type this function should return. I see so…
The goal of this video is to provide viewers with basic examples to understand opening and reading files in the C programming language.
The goal of this video is to provide viewers with basic examples to understand how to create, access, and change arrays in the C programming language.

867 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now