User forums > Help
Code::Blocks doesn't seem to find .cpp files corresponding to .h files
oBFusCATed:
OK ;D
Mantrid:
Great, so back to topic:
Other IDE automatically check for missing code in equally named .cpp files if not everything is included in a header file. How can I tell Code::Blocks to do this? Does anyone know this? Is it even possible? I mean I could just use the version of the library where I copied all the code from the .cpp files in the headers but it kind of feels wrong ^^
Thanks in advance,
Mantrid
Freem:
I think I would create a static library. But this is only a workaround, if you really need to include cpp files...
Radek:
If I understand well, you have source code for a library and you want to use this library in your app. In fact, you would like something like a "source code library". You were able to smuggle the sources to your project by adding them to your INCLUDE path.
There is nothing like a "source code library" in C or C++. Either add the code to your project, perhaps indirectly (#include <source.cpp>), or build the library first. It the later case, you need 2 projects:
(1) The library. Add all sources belonging to the library to the project and create a static library. Once the library is created, it can be used in creating your apps.
(2) The app. Add source belonging to the app to the project and command the linker to link the project with your library.
Do not expect that some C or C++ IDE will search for your source code somewhere. C is a compiled language. "Source code libraries" can be found in interpreted or "network oriented" languages, like BASIC or Java.
Mantrid:
--- Quote from: Radek on May 03, 2012, 04:05:25 pm ---There is nothing like a "source code library" in C or C++. Either add the code to your project, perhaps indirectly (#include <source.cpp>), or build the library first.
--- End quote ---
I wasn't aware of that. Then I will go with the static library.
Thank you Radek and Freem :)
Ha....worked...great :D
Navigation
[0] Message Index
[#] Next page
[*] Previous page
Go to full version