Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to create project dependencies in netbeans (c/c++ plugin)

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?

like image 371
Daniel Avatar asked Feb 28 '23 12:02

Daniel


1 Answers

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.

like image 199
Alexey Avatar answered Mar 07 '23 05:03

Alexey