Author Topic: Compile failure that looked successful  (Read 2345 times)

Offline vayolet

  • Single posting newcomer
  • *
  • Posts: 4
Compile failure that looked successful
« on: April 08, 2016, 11:56:19 am »
I spent all day yesterday trying to debug my code because it was failing with an old error that I though I had fixed.
I would click in compile and run, which showed me the terminal with my program running and failing. Then the debugger would give me any kind of weird errors that I didn't really understand why they were happening. It turned out that the compilation of my program had failed but 1) the messages with the errors are blue/grey (instead of the bright red errors that other features use), so I didn't bother to read them because 2) the terminal opened and showed me my program being executed (but it was actually an old version of my code).

I thought it was Codeblocks being a bit ambiguous, but I've tried now build+run, and it has failed to open the terminal and everything, which I would think it's the expected behaviour when failing.

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 12129
    • Travis build status
Re: Compile failure that looked successful
« Reply #1 on: April 08, 2016, 06:36:19 pm »
What version of cb, compiler and os are you using?
Can you give us example project that causes cb to fail to detect the errors?
(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 vayolet

  • Single posting newcomer
  • *
  • Posts: 4
Re: Compile failure that looked successful
« Reply #2 on: April 11, 2016, 11:00:24 am »
I tried to reproduce it but I haven't been able to yet. The error was that I had on my project files that didn't exist any more.

I'm on Debian Jessie, Codeblocks svn 10794, gcc 4.9.2

Online stahta01

  • Lives here!
  • ****
  • Posts: 6678
    • My Best Post
Re: Compile failure that looked successful
« Reply #3 on: April 13, 2016, 10:33:23 pm »
I always use re-build on this type of error instead of build; saves a lot of extra work that finds nothing in most cases.

FYI: If you are using an PCH file delete it; PCH means precompiled header.

Edit: Also, look at the build log instead of build messages for the cause/problem.

Tim S.
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 32 bit.
On Debian Stretch, compiling CB Trunk against wxWidgets 3.0.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org