Author Topic: [SOLVED] Build and Run not working?  (Read 9583 times)

Offline Drakon

  • Multiple posting newcomer
  • *
  • Posts: 10
[SOLVED] Build and Run not working?
« on: November 27, 2013, 08:18:35 am »
Every time I want to check if my program is updating after I change something, however I click Build and Run, and it just runs the old version, I have to keep telling it to rebuild the project from scratch. This is pretty annoying, I don't remember changing any of the settings that could affect this, but if there are any settings that could do this I would love it if someone could help me with anything to get this sorted.

The headers weren't being linked for.
« Last Edit: November 27, 2013, 12:56:02 pm by Drakon »

ToApolytoXaos

  • Guest
Re: Build and Run not working?
« Reply #1 on: November 27, 2013, 08:37:58 am »
Drakon, it would be really helpful if you had provided more information please.

IDE version, compiler you use, operating system you are under while this issue happens.

Cheers.

P.S.: I had a similar issue in the past, but under Debian. I'm currently compiling code myself (both Windows and GNU / Linux) and such issue does not exist anymore.

Offline Drakon

  • Multiple posting newcomer
  • *
  • Posts: 10
Re: Build and Run not working?
« Reply #2 on: November 27, 2013, 08:45:54 am »
Sorry, it would be version 12.11. O.S. Windows XP. And the compiler just tells me it is upto date no matter how many changes I make to the file so it just runs the old version of my program, I can even put giberish non-C++ stuff and it will not detect it, I have to rebuild the project and only then it will see the changes and syntax errors.

Edit: It only seems to be this project, but when I include the files to a new project the error carries accross I can get used to it, but I would like to see if there is a fix.
« Last Edit: November 27, 2013, 09:15:07 am by Drakon »

ToApolytoXaos

  • Guest
Re: Build and Run not working?
« Reply #3 on: November 27, 2013, 09:18:49 am »
...the compiler just tells me it is upto date no matter how many changes I make to the file so it just runs the old version of my program...
This is the right behavior if you just run Build. Are you using hot keys or you do it manually using your mouse to click the proper option?

F9 is for Build and run and Ctrl-F9 for Build.

Offline Drakon

  • Multiple posting newcomer
  • *
  • Posts: 10
Re: Build and Run not working?
« Reply #4 on: November 27, 2013, 09:23:58 am »
Yeah I'm using build and run, but it is acting as if it is just run. Like i said, I can rebuild the project THEN click run and it will run the updated code, however if I click build and run it will run what ever is in there even if it has syntax errors since it doesn't check for updated code, it just sees it as the same code and all upto date.

ToApolytoXaos

  • Guest
Re: Build and Run not working?
« Reply #5 on: November 27, 2013, 10:06:58 am »
well, you could download the latest nightly build and set it in a directory without spaces, preferably C:\CodeBlocks if that's not where you have installed Code::Blocks 12.11, and test your existing project to see whether is behaves the same or not.

In case the issue gets resolved, it should be wise to uninstall 12.11 and keep working on nightly builds. I'm using it for a few years now and haven't faced any major problems thus far.

Offline Drakon

  • Multiple posting newcomer
  • *
  • Posts: 10
Re: Build and Run not working?
« Reply #6 on: November 27, 2013, 10:10:15 am »
I'll try it thanks, I hope it fixes it.

Nope same result, I am thinking it is now a project property issue but I can't see anything that is amiss.
« Last Edit: November 27, 2013, 10:18:28 am by Drakon »

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 12122
    • Travis build status
Re: Build and Run not working?
« Reply #7 on: November 27, 2013, 10:31:58 am »
Read this: http://wiki.codeblocks.org/index.php?title=FAQ-Compiling_%28errors%29#Q:_How_do_I_troubleshoot_a_compiler_problem.3F

Then: Change a file and hit build. Inspect the build log. C::B should have executed a command for building the file.
If it doesn't then check modification times of all source, object (.o or .obj) and output (.exe, .dll, .a) files. If they are in the future you'll get this behaviour.
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline Drakon

  • Multiple posting newcomer
  • *
  • Posts: 10
Re: Build and Run not working?
« Reply #8 on: November 27, 2013, 10:38:24 am »
Look at all of them checked command logging and it is still the same result.

I checked dates, they say a date in the past, which was when I rebuild it. If I say "Build and Run" it doesn't change the date whatsoever since it says it is up to date and no changes need to be made, even if I make 100 lines change.

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 12122
    • Travis build status
Re: Build and Run not working?
« Reply #9 on: November 27, 2013, 11:05:11 am »
Then do a full rebuild and inspect the paths.
Are you changing the correct file for example:)
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline Drakon

  • Multiple posting newcomer
  • *
  • Posts: 10
Re: Build and Run not working?
« Reply #10 on: November 27, 2013, 11:12:37 am »
Nope still the same paths, still the same file that I want it to edit. This is so fustrating.

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 12122
    • Travis build status
Re: Build and Run not working?
« Reply #11 on: November 27, 2013, 11:15:05 am »
Can you pastebin the cbp file for inspection?
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline Drakon

  • Multiple posting newcomer
  • *
  • Posts: 10
Re: Build and Run not working?
« Reply #12 on: November 27, 2013, 11:24:33 am »

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 12122
    • Travis build status
Re: Build and Run not working?
« Reply #13 on: November 27, 2013, 11:29:54 am »
Nothing unexpected. Can you post a full rebuild log?
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

ToApolytoXaos

  • Guest
Re: Build and Run not working?
« Reply #14 on: November 27, 2013, 11:31:37 am »
@oBFusCATed: Could it possibly be the inclusion of autoversioning? I never thought of that before.

Offline Drakon

  • Multiple posting newcomer
  • *
  • Posts: 10
Re: Build and Run not working?
« Reply #15 on: November 27, 2013, 11:34:12 am »
-------------- Clean: Release in Warefare (compiler: GNU GCC Compiler)---------------

Cleaned "Warefare - Release"

-------------- Build: Release in Warefare (compiler: GNU GCC Compiler)---------------

[ 50.0%] mingw32-g++.exe -fexceptions -O2 -IC:\pdcurs33 -IC:\pdcurs33\win32 -c "C:\Documents and Settings\hi\My Documents\C\Warefare\main.cpp" -o obj\Release\main.o
[100.0%] mingw32-g++.exe -LC:\pdcurs33 -LC:\pdcurs33\win32 -o bin\Release\Warefare.exe obj\Release\main.o  -s  C:\pdcurs33\win32\pdcurses.a
Output file is bin\Release\Warefare.exe with size 68.50 KB
Process terminated with status 0 (0 minute(s), 4 second(s))
0 error(s), 0 warning(s) (0 minute(s), 4 second(s))
 

ToApolytoXaos

  • Guest
Re: Build and Run not working?
« Reply #16 on: November 27, 2013, 12:02:17 pm »
In a project of mine, I have also set in Linker Settings > Linker Libraries C:\PDCurses34\win32\panel.a.

Maybe you need this too? I don't remember why I did so; it was a long time ago. Try it and let me know if that resolves the problem.

Offline Drakon

  • Multiple posting newcomer
  • *
  • Posts: 10
Re: Build and Run not working?
« Reply #17 on: November 27, 2013, 12:06:35 pm »
It compiled fine last night and a few hours ago, this only started after I stop working on it for a bit during tea.

But it didn't fix it, i changed it saved the project added a line of jibberish non C++ stuff and it said "Build is upto date" and ran my old code. But when I tell it to rebuild it says there is an error on the line where the jibberish is.

Offline Drakon

  • Multiple posting newcomer
  • *
  • Posts: 10
Re: Build and Run not working?
« Reply #18 on: November 27, 2013, 12:48:41 pm »
Oh I feel stupid. It is because they are in .h files. If I edit main.cpp it will compile a fresh one, but when I edit the .h files it doesn't notice. How can I tell it to compile the .h files as well?

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 12122
    • Travis build status
Re: [SOLVED] Build and Run not working?
« Reply #19 on: November 27, 2013, 12:58:55 pm »
Include them in the cpp file and it will work.
C::B should detect changes in the header files. Have you checked the timestamps of the header files?
Can you pastebin the .depends file?
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]