User forums > Help

Code::Blocks doesn't seem to find .cpp files corresponding to .h files

(1/3) > >>

Mantrid:
Hi everyone,

I have a minor problem with Code::Blocks. I want to include a library (pure code, no .lib or dlls), but Code::Blocks gives me Linker errors of unresolved external symbols. When I just copy all the code from the .cpp files in the .h files, everything works fine, so I guess Code::Blocks has a problem finding the .cpp files that correspond to the .h files, even though the names are the same, so test.cpp would correspond to test.h.

Any idea what I missed or what I have to do to make Code::Blocks find the .cpp files?

Best regards
Mantrid

oBFusCATed:
Read this please:
http://wiki.codeblocks.org/index.php?title=FAQ-Compiling_%28general%29#Q:_I_would_like_to_compile_a_project_using_some_non-standard_libraries._How_can_I_indicate_to_CodeBlocks_that_these_libraries_and_include_files_exist.3F

Also read the other entries in the FAQ section of the wiki.

Mantrid:
Thanks for the fast answer. Of course I did this before I was asking the question. None of those entries is related to my problem. I added all relevant paths, otherwise the library would not work when I copy the contents of the .cpp files in the .h files, because without the propper path in the compiler search directories, Code::Blocks does not find the header files at all. My question is rather like "How can I tell Code::Blocks that the functions corresponding to the prototypes in xyz.h are written in xyz.cpp, because it does not seem to figure that out by itself".

oBFusCATed:
Have you added all cpp files to the project?

If you have read and understood this faq entry: http://wiki.codeblocks.org/index.php?title=FAQ-Compiling_%28errors%29#Q:_How_do_I_troubleshoot_a_compiler_problem.3F you would have fixed you problem.

Mantrid:
Of course I did not add the .cpp files of the library I want to use to my project....this would kind of defeat the whole purpose of a simple include of the header files.

And regarding your latter comment...look, if you have some kind of problem with people who have few posts or ask for help for the first time, let me give you a tip....nobody forces you to answer us ;)
Besides, I do understand the entry as well as the compiler output generated by my project, however I can't come up with an answer to my original question....if I could (by reading some FAQs or something else) I wouldn't be asking, because, frankly, I really dislike posting in forums....maybe because instead of getting an answer, one is just treated like an idiot...by people who probably doesn't have a clue either  ;D

Navigation

[0] Message Index

[#] Next page

Go to full version