Reputation: 1445
I am working on a neural network project that requires me to work with C++. I am working with the Flood Neural Network library. I am trying to use a neural network library in an unmanaged C++ project that I am developing. My goal is to create an instance of a class object within the Flood library from within another project.
There is plenty of documentation online regarding how to reference an unmanaged C++ project from within a C# project, but there is not enough information on how to reference one C++ project within another. Similar to how I would do it in C#, I added the Flood project as a reference in my other project, but I have tried all sorts of techniques to work with the object. I have attempted to use the #include directive to reference the header file, but that gives me errors stating that I need to implement the methods declared in the header file.
How to add a reference in unmanaged C++ and work with the class objects?
Upvotes: 3
Views: 1132
Reputation: 36141
Looking at the provided vcproj file, the flood distribution is really weird, and builds an exe file.
As such, the supported way to use Flood in your own project is not via two projects (being your application and a "libflood" project) - But simply to add all the flood cpp files to your own project and build that.
Upvotes: 1
Reputation: 19104
Yes. You need to do two things:
#include
the respective header files, as you didAlternatively, if you do not have the source code, or you do not wish to compile the 3rd-party code for any other reason, you may also reference a compiled binary. The best way to do it is pragma comment lib
. If this is what you need, please comment and I will edit my response.
Upvotes: 2