Code::Blocks Forums

User forums => General (but related to Code::Blocks) => Topic started by: mathguy on November 18, 2011, 05:04:04 pm

Title: Forum or Source of Information for Programming Issues Using Code::Blocks
Post by: mathguy on November 18, 2011, 05:04:04 pm
I understand that this is not a forum for general programming help.  Where can one seek information about programming issues related to Code::Blocks?  I have some code that works in other environments (that I don't like) that I cannot get working in Code::Blocks (which I do like).  I would like to ask some questions in that regard but it is related to specific programming I think and I don't want to violate any standards here.  Where can I ask those questions?
Title: Re: Forum or Source of Information for Programming Issues Using Code::Blocks
Post by: zabzonk on November 18, 2011, 05:08:26 pm
Try http://stackoverflow.com and/or http://www.reddit.com/r/learnprogramming. As I remember you were having problems outside the CB environment too? In which case don't ask about CB, as it will only muddy the waters.
Title: Re: Forum or Source of Information for Programming Issues Using Code::Blocks
Post by: oBFusCATed on November 18, 2011, 05:10:49 pm
Read this: http://wiki.codeblocks.org/index.php?title=FAQ-General#Q:_What_Code::Blocks_is_not.3F
Then search the internet for the appropriate forums/mailing lists/manuals/whatever related to your compiler, linker, library or framework.

Have you ask your questions to your favourite search engine?
These days they are pretty good at answering :)

Edit:

If the question is related to how to setup your project then you can ask it here, but after:
1. you've read the manual
2. you've read the FAQ in the Wiki (searching the wiki could help, too)
3. you've search the forum with the questions you're having
Title: Re: Forum or Source of Information for Programming Issues Using Code::Blocks
Post by: mathguy on November 18, 2011, 05:22:58 pm
Thank you.  I will try those resources.  I've got the other issues fixed.  Now I can't seem to get my headers to compile.  They're shaded in the Workspace.
Title: Re: Forum or Source of Information for Programming Issues Using Code::Blocks
Post by: zabzonk on November 18, 2011, 05:37:12 pm
They're supposed to be shaded. They won't get compiled unless you #include them in something that is compiled.
Title: Re: Forum or Source of Information for Programming Issues Using Code::Blocks
Post by: mathguy on November 18, 2011, 05:49:47 pm
I do have them in the compiled files using the #include.  That's what's so perplexing.
Title: Re: Forum or Source of Information for Programming Issues Using Code::Blocks
Post by: oBFusCATed on November 18, 2011, 06:33:59 pm
Have you read this: http://en.wikipedia.org/wiki/Header_file ?
I guess you come from java/.net background :)
Title: Re: Forum or Source of Information for Programming Issues Using Code::Blocks
Post by: mathguy on November 18, 2011, 06:54:45 pm
Thank you.  I will look that over.  At first glance, I'm still confused.  If I have a c source file that has #include "header.h" and the workspace has the source and header files listed, why wouldn't the header files be compiled and recognized?  They are elsewhere.  Pelles C, for example, compiles this same code with no problem (but I don't like the environment as much as CodeBlocks).
Title: Re: Forum or Source of Information for Programming Issues Using Code::Blocks
Post by: zabzonk on November 18, 2011, 06:57:06 pm
It will either be compiled, or you will get an error message along the lines of:

Code
a.c:1:17: fatal error: bad.h: No such file or directory

If you are getting this message, you simply need to add the directory that contains the headers to your project's search path (and of course #include the headers) via Project|Build Options|Search Directories. Simply adding the headers to the project is not sufficient to have them compiled.
Title: Re: Forum or Source of Information for Programming Issues Using Code::Blocks
Post by: mathguy on November 18, 2011, 07:04:13 pm
I'm not getting that error.  I'm getting "undefined reference" errors.
Title: Re: Forum or Source of Information for Programming Issues Using Code::Blocks
Post by: zabzonk on November 18, 2011, 07:07:23 pm
Those are linker errors - nothing directly to do with header files! You get those errors when you have included header files but not linked in the static library or DLL that contains the functions declared in the headers. You need to add the libraries to your project via the Project|Build Options|Linker settings pane.
Title: Re: Forum or Source of Information for Programming Issues Using Code::Blocks
Post by: mathguy on November 18, 2011, 09:54:26 pm
Ok.  Added the filename.dll.a library to the link and still get the errors.
Title: Re: Forum or Source of Information for Programming Issues Using Code::Blocks
Post by: stahta01 on November 19, 2011, 04:46:27 am
Do you ever plan to turn on Full Compiler Logging?
(As I suggested on the other forum you posted in; unless there are two people with the exact same problem and forum user name.)

http://cboard.cprogramming.com/c-programming/143409-header-file-issue-codeblocks.html (http://cboard.cprogramming.com/c-programming/143409-header-file-issue-codeblocks.html)

The compiler log and a expert on your Compiler should be able to figure out the cause of the link issue.
(Note: They are likely going to need some part of your code to find the problem and the full real error message.)

Tim S.