Author Topic: Adding new class messes up project build  (Read 3658 times)

Offline mendelts

  • Single posting newcomer
  • *
  • Posts: 2
Adding new class messes up project build
« on: September 12, 2014, 11:36:10 am »
Hey there,

I started to try code::blocks yesterday, therefore I cannot exclude user-error, but the following seems like a bug to me (It's perfectly reproducible).
Code::Blocks version 13.12, 64bit. (From the ubuntu-repos as of yesterday), OS is 64-Bit Ubuntu 14.04.

1) Create Console Application, C++, named TP (for "TestProject"), everything else as given.
* Build and run of the Hello-World Template works fine.
2) Add new class via File->new->class, named tc (for "testclass"), everything else as given, add to project, add to debug and release target.
* At this point build&run as well as rebuild are giving errors. "undefined reference to 'main'"
I thought this would be an error on my side, but the following fixes it:
3) Make any change under Project->Build Options, e.g. tick -pg flag and immediatly untick it, hit OK.
* Rebuild and build&run now work perfectly again. Without making any real changes, besides that the build options may have gotten flagged as "updated"?
Update on 3): I don't actually have to hit anything - opening Project->Build Options and hitting OK is enough to fix everything.

So all in all this means, that after creating a new class I have to do something in the build options (even if it has no effect, like checking and immedietly unchecking a box) to be able and build my project again.

I' be happy if anyone could give me some input on this one.

Greetings
Thomas



« Last Edit: September 12, 2014, 11:40:59 am by mendelts »

Offline cacb

  • Lives here!
  • ****
  • Posts: 536
Re: Adding new class messes up project build
« Reply #1 on: September 12, 2014, 11:27:09 pm »
I've seen this bug.

When it happens, you must close the project and re-open it, or else build does not work. Even restart C::B.

Might be fixed in one of the nightly builds. I always use that.

Offline mendelts

  • Single posting newcomer
  • *
  • Posts: 2
Re: Adding new class messes up project build
« Reply #2 on: September 15, 2014, 09:46:51 am »
Thanks for your reply - now I know that I'm not alone on this.

Opening the build options seems like a quicker fix to me than restarting CB or reloading the project ;)

Strange thing is, on my desktop with a very similar setup, this bug doesn't occur.

Greetings
Thomas

Offline Alpha

  • Developer
  • Lives here!
  • *****
  • Posts: 1513
Re: Adding new class messes up project build
« Reply #3 on: September 15, 2014, 02:09:48 pm »
Unable to reproduce...

On your machine where it does not work, have you tried a nightly?