Author Topic: Will build but will not run.  (Read 4060 times)

Offline ediscoolyo

  • Single posting newcomer
  • *
  • Posts: 3
Will build but will not run.
« on: February 17, 2011, 05:23:05 am »
I am new to Codeblocks and C++. I am trying to run my first helloworld program. When I click build, I get this message in the build log: "Target is up to date. Nothing to be done". When I click run, nothing happens. The only way for me to run the program is through the debugger. Is that the way its supposed to be?

Offline Pecan

  • Plugin developer
  • Lives here!
  • ****
  • Posts: 2778
Re: Will build but will not run.
« Reply #1 on: February 17, 2011, 02:48:15 pm »
What is your OS? What version of CB did you install?
What compiler are you using?

Read this: http://wiki.codeblocks.org/index.php?title=FAQ#Q:_How_do_I_troubleshoot_an_compiler_problem.3F

Turn on full logging (above link) and past the results withing a
code tag (by clicking the # symbol above the forum edit window)
« Last Edit: February 17, 2011, 02:51:04 pm by Pecan »

Offline ediscoolyo

  • Single posting newcomer
  • *
  • Posts: 3
Re: Will build but will not run.
« Reply #2 on: February 17, 2011, 11:21:49 pm »
Thanks for the response. I'm using Windows XP with CB 10.05. I installed MinGW but my selected compiler is Microsoft Visual C++ 2005/2008(which I do not have) because I used reset defaults, and thats the only one that works. I have full command line selected under compiler logging. Other than the debugger, I don't see anything logged.
« Last Edit: February 18, 2011, 02:10:53 am by ediscoolyo »

Offline Pecan

  • Plugin developer
  • Lives here!
  • ****
  • Posts: 2778
Re: Will build but will not run.
« Reply #3 on: February 18, 2011, 02:31:15 pm »
Thanks for the response. I'm using Windows XP with CB 10.05. I installed MinGW but my selected compiler is Microsoft Visual C++ 2005/2008(which I do not have) because I used reset defaults, and thats the only one that works. I have full command line selected under compiler logging. Other than the debugger, I don't see anything logged.

You must use the compiler that you've installed. CB cannot use a compiler that does *not* exist on your system.

Go to Settings/Compiler and Debugger and click on selected compiler.
Choose GNU GCC compiler(assuming you've installed mingw).
Click on "set as default".

Click on the "Toolchain Executables" tab. Verify that the "compiler's installation directory" is correct. It should be the parent of the "\bin" folder containing mingw.

You should regenerate the "Hello world" with a new project (main menu/file/new/project/console application) after setting the compiler above. On the second or third page of the new project wizard, be sure to choose the GNU GCC compiler.

Refer to the following to get more extensive info . The first site is very slow to load, have patients.

http://www.sci.brooklyn.cuny.edu/~goetz/codeblocks/codeblocks-instructions.pdf
http://www.codeblocks.org/docs/main_codeblocks_en.html

« Last Edit: February 18, 2011, 02:47:06 pm by Pecan »

Offline ediscoolyo

  • Single posting newcomer
  • *
  • Posts: 3
Re: Will build but will not run.
« Reply #4 on: February 18, 2011, 11:08:53 pm »
It's running now. Thank you very much!