Code::Blocks Forums

User forums => Help => Topic started by: yarly on July 16, 2015, 02:22:21 am

Title: How do I set where it writes the EXE?
Post by: yarly on July 16, 2015, 02:22:21 am
I have these settings for my compiler.  My system is Win7 64bit, i'm using Ming64
 
(http://i.imgur.com/qnLPEIb.png)

I did file..new   write a C file, saved it as c:\blah\a2.c
   
I got this error in the build window

ld.exe||cannot open output file C:\Program Files (x86)\mingw-w64\i686-5.1.0-posix-dwarf-rt_v4-rev0\mingw32\bin\a2.exe Permission denied|
||=== Build failed: 1 error(s), 0 warning(s) (0 minute(s), 0 second(s)) ===|


The file a2.exe doesn't exist  I think it can't make it 'cos it can't write to program files. 

I'd like the file written in c:\blah  which is where the .c file is  Or perhaps in another directory, not program files. Not where the gcc is.

Where do I tell code::blocker the place to put the EXE?

Title: Re: How do I set where it writes the EXE?
Post by: stahta01 on July 16, 2015, 02:36:39 am
Try using an Code::Blocks project and post the build log if you still have issues.

http://wiki.codeblocks.org/index.php?title=FAQ-Compiling_%28errors%29#Q:_How_do_I_troubleshoot_a_compiler_problem.3F (http://wiki.codeblocks.org/index.php?title=FAQ-Compiling_%28errors%29#Q:_How_do_I_troubleshoot_a_compiler_problem.3F)

Tim S.
Title: Re: How do I set where it writes the EXE?
Post by: yarly on July 16, 2015, 04:55:36 am
When I run it as a Code::Blocks project I don't have the problem

It's possible that I ran the .c file from within "program files" without realizing it.  (I was using a hard link and an administrative command prompt, so it was less obvious). It then tried to write to the same directory and failed.  That's my guess. And I guess when it's not a project, it always saves in the same directory as the source.   I thought my src file was in c:\blah but I suppose it was within "program files".  Maybe I had a file with the same name elsewhere and confused the two.

It's fine now,  whether in a project, or not in a project.  Thanks.