Author Topic: help!!!  (Read 4697 times)

Offline yanglianxiang

  • Single posting newcomer
  • *
  • Posts: 5
help!!!
« 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.

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9694
Re: help!!!
« Reply #1 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.
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: https://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: https://wiki.codeblocks.org/index.php?title=FAQ

Offline yanglianxiang

  • Single posting newcomer
  • *
  • Posts: 5
Re: help!!!
« Reply #2 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.

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9694
Re: help!!!
« Reply #3 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.
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: https://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: https://wiki.codeblocks.org/index.php?title=FAQ

Offline yanglianxiang

  • Single posting newcomer
  • *
  • Posts: 5
Re: help!!!
« Reply #4 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.

Offline Jenna

  • Administrator
  • Lives here!
  • *****
  • Posts: 7255
Re: help!!!
« Reply #5 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.

Offline yanglianxiang

  • Single posting newcomer
  • *
  • Posts: 5
Re: help!!!
« Reply #6 on: October 27, 2010, 10:54:34 am »
Oh,I got it,thank you very much!