Solved

Code::Blocks

Posted on 2014-07-27
2
355 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

Simplifying Server Workload Migrations

This use case outlines the migration challenges that organizations face and how the Acronis AnyData Engine supports physical-to-physical (P2P), physical-to-virtual (P2V), virtual to physical (V2P), and cross-virtual (V2V) migration scenarios to address these challenges.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
How to jump to matching brace in eclipse editor ? 1 320
Resolve Dependency Issues 4 79
outlook office 365 8 143
C qsort compare function issue 6 13
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…
Examines three attack vectors, specifically, the different types of malware used in malicious attacks, web application attacks, and finally, network based attacks.  Concludes by examining the means of securing and protecting critical systems and inf…
The goal of this video is to provide viewers with basic examples to understand opening and writing to files in the C programming language.
Video by: Grant
The goal of this video is to provide viewers with basic examples to understand and use for-loops in the C programming language.

808 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