Code::Blocks Forums

User forums => Using Code::Blocks => Topic started by: linuser42 on November 30, 2015, 03:59:51 pm

Title: Adding new class with the class wizzard causes "undefined reference to main"
Post by: linuser42 on November 30, 2015, 03:59:51 pm
edit: see last post for solution

I'm using Code Blocks Release 13.12 rev 9501 (2013-12-25 18:25:45) gcc 5.2.1 Linux/unicode - 64 bit

This is not a new found bug by me, but has happened to a lot of people

- http://forums.codeblocks.org/index.php?topic=20115.0 (http://forums.codeblocks.org/index.php?topic=20115.0)
- http://forums.codeblocks.org/index.php?topic=19639.0 (http://forums.codeblocks.org/index.php?topic=19639.0)
- http://forums.codeblocks.org/index.php?topic=19772.0 (http://forums.codeblocks.org/index.php?topic=19772.0)
- https://stackoverflow.com/questions/24537874/undefined-reference-to-main-after-adding-a-class-to-project (https://stackoverflow.com/questions/24537874/undefined-reference-to-main-after-adding-a-class-to-project)


I didn't have this bug with the 32 bit version of Code Blocks on my previous system!
edit: I was using a svn build from https://launchpad.net/~pasgui/+archive/ubuntu/ppa (https://launchpad.net/~pasgui/+archive/ubuntu/ppa) which didn't contain the bug

As you can see from the link workarounds include:
- adding class by wizard, then closing and opening the project
- adding files manually to the project one by one
- installing the nightly builds

The most obvious one it to install the nightly builds of course.

But this seems like a minor bug to fix, especially since it has worked flawlessly for years.

Is anybody else experiencing this?
Is there a plan to add this to the stable builds?

Thanks in advance.

edit: see last post for solution
Title: Re: Adding new class with the class wizzard causes "undefined reference to main"
Post by: oBFusCATed on November 30, 2015, 04:27:47 pm
We have 15.12rc1, so if you don't use a nightly try this and tell us if the bug is really fixed.
We won't be patching 13.12 for sure.
Title: Re: Adding new class with the class wizzard causes "undefined reference to main"
Post by: linuser42 on November 30, 2015, 05:46:39 pm
So it's a bug on the 64 bit version?

How do I install that version?

I'm running Ubuntu MATE 15.10, and there's no .deb package or something similar here:

http://sourceforge.net/projects/codeblocks/files/Binaries/15.12-RC1/ (http://sourceforge.net/projects/codeblocks/files/Binaries/15.12-RC1/)


So nightly is the only option for me?
Title: Re: Adding new class with the class wizzard causes "undefined reference to main"
Post by: BlueHazzard on November 30, 2015, 06:44:31 pm
So it's a bug on the 64 bit version?

As far as i know this was a bug in 13.12. In every version not only 64 or 32 bit.

So nightly is the only option for me?
yes. Your bug is fixed there. You can find pre build packages for your os in the corresponding forum posts: http://forums.codeblocks.org/index.php/topic,20707.msg141111.html#msg141111

greetings
Title: Re: Adding new class with the class wizzard causes "undefined reference to main"
Post by: linuser42 on December 01, 2015, 01:43:22 am
As far as i know this was a bug in 13.12. In every version not only 64 or 32 bit.

I forgot to mention I used the svn build on Ubuntu 12.04 from https://launchpad.net/~pasgui/+archive/ubuntu/ppa (https://launchpad.net/~pasgui/+archive/ubuntu/ppa) and didn't have this bug.

So, which one should I use?

https://apt.jenslody.de (https://apt.jenslody.de) - I'm guessing I need the unstable? Can I use them on Ubuntu?

or

https://launchpad.net/~damien-moore/+archive/ubuntu/codeblocks (https://launchpad.net/~damien-moore/+archive/ubuntu/codeblocks) - will this work on Ubuntu 15.10?
Title: Re: Adding new class with the class wizzard causes "undefined reference to main"
Post by: BlueHazzard on December 01, 2015, 01:18:06 pm
I forgot to mention I used the svn build on Ubuntu 12.04 from https://launchpad.net/~pasgui/+archive/ubuntu/ppa (https://launchpad.net/~pasgui/+archive/ubuntu/ppa) and didn't have this bug.
note the svn in the name? this probably means that it was a nightly where this bug was fixed....

https://apt.jenslody.de (https://apt.jenslody.de) - I'm guessing I need the unstable? Can I use them on Ubuntu?
or
https://launchpad.net/~damien-moore/+archive/ubuntu/codeblocks (https://launchpad.net/~damien-moore/+archive/ubuntu/codeblocks) - will this work on Ubuntu 15.10?
probably this one of damien-moore, because it is specifically for ubuntu... but you have to try it... both are the latest svn builds (on damien-moore NOT for ubuntu ubuntu13.10.1 , ubuntu12.10.1  and ubuntu13.04.1 )

greetings
Title: Re: Adding new class with the class wizzard causes "undefined reference to main"
Post by: linuser42 on December 04, 2015, 12:48:08 pm
note the svn in the name? this probably means that it was a nightly where this bug was fixed....

I understand now, thanks.

probably this one of damien-moore, because it is specifically for ubuntu... but you have to try it... both are the latest svn builds (on damien-moore NOT for ubuntu ubuntu13.10.1 , ubuntu12.10.1  and ubuntu13.04.1 )

I sent a PM do dmoore to ask if the build would work with Ubuntu 15.10, and he uploaded his ppa with the latest Code Blocks builds for Ubuntu 15.10.
Much appreciated and awesome from him to do that.
https://launchpad.net/~damien-moore/+archive/ubuntu/codeblocks (https://launchpad.net/~damien-moore/+archive/ubuntu/codeblocks)