As I work on a c++ application, I realize I am making a lot of classes and functions that could be used in other projects. So I'd like to put all this code in a separate net beans project that can be "included" into other projects. (with code completion etc)
I've tried creating a new "static library" project, then I added the project to my main project (by going to preferences->link->libraries and adding my "library project"), but the code completion feature does not find the .h file of my library project when i try to #include it, the project also won't build.
What is the correct way to do this?
Creating a static library and adding it to Linker->Libraries is correct. But another small step is needed: add directory with shared *.h files to project properties -> C Compiler (or C++ Compiler) -> Include Directories.
Also take a look at Subprojects sample: File -> New Project -> Samples -> C/C++ -> Subproject Application.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With