Code::Blocks Forums

User forums => Using Code::Blocks => Topic started by: 357mag on May 03, 2010, 07:01:03 am

Title: Just some observations
Post by: 357mag on May 03, 2010, 07:01:03 am
I've been experimenting with CodeBlocks and discovered a few things. If you go into File - New Project -Empty Project - then give your project a title and all that then click Next and then the next screen where it talks about compiler configurations(I left all that default) then click Finish. Then after that go into New - File - CPP Source - and then give it a file name. Soon you will see a check box next to "add file to active project and build target." It seems this has to be checked. I don't know if you got to check both debug and release but I checked both of them and then clicked Finish. Then if you go ahead and write in your source code and run it everythings fine.

But if you follow these steps again but this time you do not check the box next to "add file to active project and build target" when you go to compile your code you will get an error "linking stage skipped. Build target has no object files to link. Nothing to be done."

So I guess that you must put a check mark in that "add file to active project" box but I'm not sure about whether or not you have to check the debug and release options.
Title: Re: Just some observations
Post by: Jenna on May 03, 2010, 07:24:09 am
I never thought that anybody can have aroblem here.
It's all pretty much self-explaining in my opinion.

Please read the C::B manual to understand how C::B works: http://www.codeblocks.org/user-manual (http://www.codeblocks.org/user-manual) .
Title: Re: Just some observations
Post by: Folco on May 03, 2010, 08:39:43 am
I had the same "problem" the very first time I tried C::B, but after having done some tests to understand how it works, I understood the C::B behaviour quickly. :D

Nevertheless, when I create a C/C++ file, the default is that Release/Debug checkbox are unchecked, and I should prefer them to be checked. But it's just my preference, not a real problem.
Title: Re: Just some observations
Post by: oBFusCATed on May 03, 2010, 10:12:42 am
... the default is that Release/Debug checkbox are unchecked, and I should prefer them to be checked. But it's just my preference, not a real problem.
You're using an old version, for me all targets are checked.
Title: Re: Just some observations
Post by: Folco on May 03, 2010, 02:23:57 pm
svn 6206, provided by jens for Debian Lenny. But it doesn't matter at all for me. ;)
Title: Re: Just some observations
Post by: 357mag on May 03, 2010, 04:53:52 pm
I never thought that anybody can have aroblem here.
It's all pretty much self-explaining in my opinion.

Please read the C::B manual to understand how C::B works: http://www.codeblocks.org/user-manual (http://www.codeblocks.org/user-manual) .

Actually the manual does not tell you to check that box at all. It discusses very little about it. And I have never used this IDE before so you assume too much.
Title: Re: Just some observations
Post by: 357mag on May 03, 2010, 05:00:34 pm
If a guy did forget to check that box and he forgot to check the debug and release boxes, is there a way for him to fix it after the fact? Can he go backward somehow and check those boxes?
Title: Re: Just some observations
Post by: Jenna on May 03, 2010, 05:07:38 pm
If a guy did forget to check that box and he forgot to check the debug and release boxes, is there a way for him to fix it after the fact? Can he go backward somehow and check those boxes?

Either open the files properties via context-menu (right-click the file in the project-manager or if it's open right-click into the editor or the according tab) and go to the "Build"-tab and add it to the targets you want, or open the projects-properties (right-click the project in the project-manager or use the menu),  click the "Build targets"-tab and make sure the checkboxes for all "Build target files" that should belong to the target are checked.
Title: Re: Just some observations
Post by: 357mag on May 03, 2010, 05:17:07 pm
Thank You! Good to have a backup plan.