User forums > General (but related to Code::Blocks)

C Header Files Inclusion

(1/2) > >>

Anark10n:
Hey there

New to the forum, searched all over for an answer to the problem I'm having, didn't find it. New to using code blocks as well, got a problem with including my header files, probably with linking, not sure, but it keeps giving me the same error message: undefined reference to '_<function_name>'. Any clarity on the problem would be appreciated. Side note: the code compiles without problem in visual studio express.

Thanks in advance to anyone who replies...

oBFusCATed:
Read this: http://wiki.codeblocks.org/index.php?title=FAQ#Q:_How_do_I_troubleshoot_an_compiler_problem.3F

You have a linking problem... probably missing file or library

stahta01:

--- Quote from: Anark10n on April 22, 2010, 01:17:03 pm ---Side note: the code compiles without problem in visual studio express.

--- End quote ---

FYI:
Visual Studio can automatically include some libraries and also uses #pragma commands to include libraries.

Tim S

Anark10n:
Thanks for the replies, but it is still giving me the same error message. Thought it might just windows only bug so i tried it on a Linux machine seeing as it usually comes with the GCC compiler pre-installed with all the necessary files, and it still gave me the same error message.

Jenna:
The problem can happen, if you mix c++-code with c-code.
If that's the case, you should read this: http://www.parashift.com/c++-faq-lite/mixing-c-and-cpp.html .

Navigation

[0] Message Index

[#] Next page

Go to full version