Author Topic: I'm bouncing back and forth between two problems.  (Read 7417 times)

Offline homesar

  • Single posting newcomer
  • *
  • Posts: 2
I'm bouncing back and forth between two problems.
« on: February 05, 2011, 06:15:09 am »
Before I even start, I have to say this:  These two problems are very common and I know it might bother some people that I'm creating a new topic to ask about them.  However, I've read all of the topics about these problems, and I've taken the recommended steps to fix them.  But when I solve one problem, a new one pops up....then when I solve THAT problem, the old one comes back!  It's getting frustrating so I'm hoping that this topic will point out precisely what I'm doing wrong.

I'm using Windows XP, btw

SO! Here is my problem:

I downloaded Code:Blocks and everything works fine.  I'm blasting through an online tutorial and picking everything up.  Things are going smooth.  I close Code:blocks.  The next day I re-open it and as I try to build and run my program, I get this message:

"cannot open bin/debug/myfile.exe Permission Denied"

So I look on the forum here and see a few topics about it.  They say that I've probably saved my code:blocks under programfiles which, in XP, cannot be written over.  So, I take steps to move my Code:Blocks to a new location which is NOT under program files.  In fact, just to be completely safe, I create a new folder under my C drive called CodeBlocks and I re-install Code:Blocks into that.

This time, as I try to compile and run I get this message:

"myfile" uses an invalid compiler [YOUR ANSWER IS ALREADY THERE. SEARCH THE FORUMS!]. Probably the toolchain path within the compiler options is not setup correctly?! Skipping...
Nothing to be done."

Once again, I search these forums for an answer and I find one.  So I go to settings - compiler and debugger - reset defaults....just like it was recommended to do in other topics.  So I do this.

NOW I'm back to square one!  I try to run and I get the same message I got the first time!

"cannot open bin/debug/myfile.exe Permission Denied"

Rinse and repeat.

I'm OBVIOUSLY doing something wrong.  But I don't know what!

Can anybody figure out where I'm going wrong?

I'd REALLY appreciate it.  And I apologize if I'm making you read the same problems you've read a million times before.  But like I said...I couldn't figure it out by searching the forum.

Thanks


Offline codeur

  • Multiple posting newcomer
  • *
  • Posts: 113
    • Code::Blocks EDU-Portable
Re: I'm bouncing back and forth between two problems.
« Reply #1 on: February 05, 2011, 07:00:22 am »
There is not enough information here to really be sure of what is happening, but you should understand that the location on the hard disk where you install codeblocks and the location of your projects, where you write your program code and the final .exe file are two different things.

Codeblocks can be located under C:\Program Files\Codeblocks and your programs could be located under C:\myProggies for example, and it is a good idea to create a new directory for every new project. It keeps things simple.

Re-installing codeblocks will not help in finding a solution to your problem. It is also normal that everytime you install codeblock you have to tell it what compiler it should be using. This is part of the normal installation of codeblocks.

Finally the error message that you get when trying to re-build and re-run your program a second time could occur because the program that you started the first time is still running. Make sure the first program execution is finished and the program is closed before you try to build it again.

Offline Jenna

  • Administrator
  • Lives here!
  • *****
  • Posts: 7255
Re: I'm bouncing back and forth between two problems.
« Reply #2 on: February 05, 2011, 08:41:05 am »
Code::Blocks can be installed in "Program Files" (if you use a recent MinGW).
And on XP it should also work if you create your projects there (if not some security software prevents this), but it's a bad style.

If you install MinGW in a new path (I guess you use th e MinGW shipped with C::B, what's installed below C::B's exe-folder) you have to fix the compiler installation path in "Settings -> Compiler and debugger -> Global compiler settings -> GNU GCC compiler -> Toolchain executables", otherwise C::B searches them in the wrong place.


Offline homesar

  • Single posting newcomer
  • *
  • Posts: 2
Re: I'm bouncing back and forth between two problems.
« Reply #3 on: February 05, 2011, 11:31:58 am »
Ok

I feel silly.  All it took to fix it was to change the location where I created my new project....not the location of Code:Blocks itself. Easy fix!

Codeur, you said exactly what I needed.  Thanks!

Jens, thank you too!