GIDForums  

Go Back   GIDForums > Computer Programming Forums > C++ Forum
User Name
Password
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

 
 
Thread Tools Search this Thread Rate Thread
  #1  
Old 20-Aug-2007, 10:49
Altmaniac Altmaniac is offline
New Member
 
Join Date: Aug 2007
Posts: 3
Altmaniac is on a distinguished road

Help with C++ Compiling Error


Hey guys I need some help with something. For some reason, my code isn't compiling. The weird thing is, I don't think the code is the problem... I tried putting in different codes, and it had the same error each time. I'm not going to supply the code I'm using, because nothing works, no matter what I put in. This is what the Compile error says every time:

CPP / C++ / C Code:
                                                   |   Permisson denied
                                                   |   Id returned 1 exit status
C:\Program Files\Dev-Cpp\makefile...  |   [Build Error] [examples.exe] Error 1 

And here's the actual compile log:
CPP / C++ / C Code:
Compiler: Default compiler
Building Makefile: "C:\Program Files\Dev-Cpp\Makefile.win"
Executing  make...
make.exe -f "C:\Program Files\Dev-Cpp\Makefile.win" all
g++.exe main.o  -o "examples.exe" -L"lib"  

C:\Program Files\Dev-Cpp\Bin\..\lib\gcc\mingw32\3.4.2\..\..\..\..\mingw32\bin\ld.exe: cannot open output file examples.exe: Permission denied
collect2: ld returned 1 exit status

make.exe: *** [examples.exe] Error 1

Execution terminated

So, yeah. If anybody could help me, that would be great. Thanks!
  #2  
Old 20-Aug-2007, 11:10
davekw7x davekw7x is offline
Outstanding Member
 
Join Date: Feb 2004
Location: Left Coast, USA
Posts: 4,710
davekw7x is a splendid one to beholddavekw7x is a splendid one to beholddavekw7x is a splendid one to beholddavekw7x is a splendid one to beholddavekw7x is a splendid one to beholddavekw7x is a splendid one to beholddavekw7x is a splendid one to behold

Re: Help with C++ Compiling Error


Quote:
Originally Posted by Altmaniac
Code:
C:\Program Files\Dev-Cpp\Bin\..\lib\gcc\mingw32\3.4.2\..\..\..\..\mingw32\bin\ld.exe: cannot open output file examples.exe: Permission denied collect2: ld returned 1 exit status
Perhaps there is an "examples.exe" that is already running? If you don't think so, you could open the Windows task manager (ctrl-alt-del) and click on the "Processes" tab. See if there is an image named "examples.exe".

Regards,

Dave
  #3  
Old 20-Aug-2007, 13:01
Altmaniac Altmaniac is offline
New Member
 
Join Date: Aug 2007
Posts: 3
Altmaniac is on a distinguished road

Re: Help with C++ Compiling Error


No, there's nothing else running. Thanks for trying, but that's not it. But what does this mean?:
CPP / C++ / C Code:
 |   Permisson denied
                                                   |   Id returned 1 exit status
C:\Program Files\Dev-Cpp\makefile...  |   [Build Error] [examples.exe] Error 1 
Permission Denied? I think that has something to do with it.
  #4  
Old 20-Aug-2007, 13:28
davekw7x davekw7x is offline
Outstanding Member
 
Join Date: Feb 2004
Location: Left Coast, USA
Posts: 4,710
davekw7x is a splendid one to beholddavekw7x is a splendid one to beholddavekw7x is a splendid one to beholddavekw7x is a splendid one to beholddavekw7x is a splendid one to beholddavekw7x is a splendid one to beholddavekw7x is a splendid one to behold

Re: Help with C++ Compiling Error


Quote:
Originally Posted by Altmaniac
No, there's nothing else running.
Huh? Nothing. Oh, well...
Quote:
Originally Posted by Altmaniac
Thanks for trying, but that's not it. But what does this mean?:
CPP / C++ / C Code:
 |   Permisson denied
                                                   |   Id returned 1 exit status
C:\Program Files\Dev-Cpp\makefile...  |   [Build Error] [examples.exe] Error 1 
Permission Denied? I think that has something to do with it.


That is a result of the previous error that you showed:
Code:
cannot open output file examples.exe: Permission denied

Since you say that there is no process named "examples.exe" running, maybe the file, somehow, attained a read-only status. Or some such thing.

Here is what I would do:

Close the project. Quit out of dev-cpp.

Get back into dev-cpp.

Start a new project somewhere other than C:\Program Files....

For example, create a new directory, say c:\dev_cpp_projects. Then create your new project in that directory.

Copy the source code into the new project main.cpp file (or whatever).

Try again.


Regards,

Dave
  #5  
Old 21-Aug-2007, 06:25
Couling Couling is offline
New Member
 
Join Date: Aug 2007
Posts: 6
Couling is on a distinguished road

Re: Help with C++ Compiling Error


The error you're getting is from the actual c++ compiler (g++). What its telling you is that it can't create a file (in this case "examples.exe"). This can happen for a couple of reasons. The first thing to do is to work out where "examples.exe" is supposed to appear once compiled. This may be in the project settings of dev-c++, but I'm not sure as I havn't used that IDE in a couple of years.

Once you know where the compiler is trying to put it, then makesure that location actually exists. g++ WON'T create a folder. If memory serves, then it may be trying to put the EXE in a "debug" folder within the main project folder. Also make sure that this folder isnt read-only and delete any existing copys of "examples.exe" just to be on the safe side.

Hope this helps
  #6  
Old 21-Aug-2007, 06:29
Couling Couling is offline
New Member
 
Join Date: Aug 2007
Posts: 6
Couling is on a distinguished road

Re: Help with C++ Compiling Error


g++ can't make folders (directorys).

Make sure that the target location exists (ie: check that the folder that examples.exe is supposed to appear in is there).

Also check that this folder and the folders it's in etc. are NOT read only.

Perhapse delete any existing copy of "examples.exe". just in case.

hope this helps.
 
 

Recent GIDBlogObservations of Iraq by crystalattice

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Major newbie problem cynack MS Visual C++ / MFC Forum 1 08-Apr-2007 11:25
Winsock error when compiling FLTK 2.0 Projects mauriciorossi FLTK Forum 3 16-Aug-2005 10:18
Help with syntax errors PeteGallo C Programming Language 7 08-Aug-2005 20:30
What is "Ambigious symbol" ??*( a compilation error) small_ticket C++ Forum 2 07-Jan-2005 21:10
Can enum have same name as class? crystalattice C++ Forum 3 08-Dec-2004 16:43

Network Sites: GIDNetwork · GIDWebHosts · GIDSearch · Learning Journal by J de Silva, The

All times are GMT -6. The time now is 03:19.


vBulletin, Copyright © 2000 - 2008, Jelsoft Enterprises Ltd.