Code::Blocks Forums
User forums => Using Code::Blocks => Topic started by: saritr on February 17, 2016, 06:15:08 pm
-
I use Code::Blocks 13.12.
I created an new poject. At first (without adding new classes) the buils passes, but after I add new class (with the dialog) I got the following error:
(.text+0x20): undefined reference to `main'
I tried to search a solution and encounter a similar issue in stackover flow"
http://stackoverflow.com/questions/24537874/undefined-reference-to-main-after-adding-a-class-to-project
Only after I read and implement the soluttion I succeeded to build it (I'm using 13.12 on 64 bit Ubuntu 14.04. I get the same problem and it does seem to be the class addition dialog that is to blame. Use it to create the class files but Don't add it to the project. Right click the project title in the 'Projects' tab (left pane in window) and use the 'Add Files' from the context menu. Should compile ok then.)
Why doesn't it work properly?
-
You can get the latest stable build version of code blocks which is 16.01 for Ubuntu here
Code::Blocks Ubuntu binaries, Download (https://launchpad.net/~damien-moore/+archive/ubuntu/codeblocks-stable)
Edit: Removed non-English content.
-
I know...bot I want to know why there was a problem.
-
It might be a bug in the old version, that's why i suggested that you update to 16.01.
I program in C, but let's dive into this, i just tried to replicate your problem in the new version but it doesn't seem to have any problems.
Maybe the class template have some typos, can you take a screenshot of your class box settings when you press new > class
I don't know where the template is, but if there's one it might be in /usr/share/codeblocks
Edit: Removed non-English content.
-
Why doesn't it work properly?
There was a bug... i don't remember the exact cause, but i think there was a white space where it shouldn't be... You can post a full rebuild log of the not working project and i may can tell you what is wrong. You can also search the forum, or you can try to search in the svn log for a bugfix of the new class plugin... There should be the answer somewhere out there.
greetings