User forums > Using Code::Blocks

undefined reference

<< < (2/2)

stahta01:
Attached my project with your code.

spartan:
Oh, now it works....thanks!
I just have one question:when creating new ccp or header file even if I tick box that says "Add file to active project" I still have to manually add file to my project otherwise same error happens. Only way I can get rid of this error, aside from manually adding file, is to also tick off boxes bellow "Add file to active" project": "Debug" and "Release". Is this correct way to get systemtically rid of my error?

oBFusCATed:
In your case you need to have ticks in front of both release and debug in the dialog which is shown up.

If you don't do it the file won't be added to both targets. If you build a target which doesn't include the file then you'll get this undefined reference error.
You could fix this problem in both the Project -> Properties and in File -> Properties dialogs.

Navigation

[0] Message Index

[*] Previous page

Go to full version