Code::Blocks Forums

User forums => Help => Topic started by: yanglianxiang on October 26, 2010, 09:28:50 am

Title: help!!!
Post by: yanglianxiang on October 26, 2010, 09:28:50 am
C:\Program Files\CodeBlocks\MinGW\bin\ld.exe: cannot open output file C:\Program Files\CodeBlocks\MyProjects\backward.exe: Permission denied

all new files are locked,and  .o files,after run,are also locked.
 .exe files cannot be created.
Title: Re: help!!!
Post by: MortenMacFly on October 26, 2010, 11:28:32 am
C:\Program Files\CodeBlocks\MyProjects\backward.exe: Permission denied
You forgot to say anything about your OS, version of C::B et al. But if it's Vista or later than every user does not have write permission to the "Program Files" folder by default. So it makes no sense to place your projects there, use a writeable folder (like "My Files") for your projects.
Title: Re: help!!!
Post by: yanglianxiang on October 26, 2010, 12:05:04 pm
first of all,thank you!
my os is win7,and my C::B is 8.02mingw.
i usually put my projects in the file myprojects.
after i reinstall my C::B,there is no file myprojects anymore.
Title: Re: help!!!
Post by: MortenMacFly on October 26, 2010, 09:20:35 pm
after i reinstall my C::B,there is no file myprojects anymore.
I guess you didn't understand what I said: Put the C::B installation files under Program Files, but do not put your project files or any output folders under Program Files. This is not a limitation of C::B, but Windows starting with Vista does not allow writing into these folders without explicitly using the admin mode (elevated privileges) or setting directory / file permissions accordingly (by hand) which both is a very bad thing to do.
Title: Re: help!!!
Post by: yanglianxiang on October 27, 2010, 07:21:13 am
thank you,first!
But ,if I do not put my project files and output folders under Program Files,after I run my files,there will be lots of errors and warnings in the build messages.
Title: Re: help!!!
Post by: Jenna on October 27, 2010, 07:32:16 am
That is another error.
The file-ending c makes C::B believes it's a C-file, but iostream is a c++ header, so you have to use cpp as file-ending.
Title: Re: help!!!
Post by: yanglianxiang on October 27, 2010, 10:54:34 am
Oh,I got it,thank you very much!