I’m a new user of OpenNURBS, and I’m having problems when statically linking it to another C++ project in Visual Studio 2010. To explain from the start, I should mention I downloaded the C++ OpenNURBS SDK and compiled it fine according to the instructions. After that, I linked it to my project the usual way:
- In the C/C++ -> General -> Additional Include Directories section, I added the path to the header files folder, which is the base folder of the downloaded bundle.
- In the Linker -> General -> Additional Library Directories section, I added the path to the Release and ReleaseStaticLib folders, both generated when I compiled the SDK, and the zlib\Release folder.
- In the Linker -> Input -> Additional Dependencies section, I added the three library names: opennurbs.lib, opennurbs_staticlib.lib and zlib.lib (all of them in the Release folder).
After adding the “#include <opennurbs.h>” suggested by the license to my code, everything seems to be fine, no red lines, but when I try to build my project, the linker always comes out with a “LNK2019 error: unable to find external symbol” error for every constructor, destructor and any other OpenNURBS function called in my code. What I get from that is that Visual Studio is unable to find the function’s body, but does find the declarations in the header files, since otherwise I’d had lots of red lines in my source code. The only reason I can think of is that it has problems with the library files.
I did notice the library file “opennurbs_staticlib.lib” file was located in the “Release” folder instead of “ReleaseStaticLib”. I tried moving it there, but it made no difference.
I’d be grateful if someone would be able to tell me which step I missed or if I messed up somewhere in the process, OpenNURBS has a lot of useful functions that would be very helpful in my project.