I wanna use OpenNurbs in C++ and create a DLL. There is no “stdafx.h” in my project, but a header named “pch.h” where, therefore, I added the following lines with the instructions.
#define OPENNURBS_PUBLIC_INSTALL_DIR “DirectoryToOpenNurbs-7x”
#include “…\opennurbs_public.h”
and when I wanted to build up the solution, it failed.
Then secondly, I tried another way. Adding opennurbs_public.dll with the “properties page” which was provided by Microsoft Learn.
But failed neither.
In both approaches, the output console concluded that
Build started…
1>------ Build started: Project: Pyramid, Configuration: Debug x64 ------
1>Bridge.cpp
1>D:\C++&Java\C++Dll_Learning\Test_Dll_5\OpenNurbs_Test_2\Pyramid\Pyramid\Test_1_PointAdd.h(19,13): warning C4251: ‘Pyramid::Pt1’: class ‘ON_3dPoint’ needs to have dll-interface to be used by clients of class ‘Pyramid’
1>D:\C++&Java\OpenNurbs_2\opennurbs-7.x\opennurbs_texture_mapping.h(32): message : see declaration of ‘ON_3dPoint’
1>D:\C++&Java\C++Dll_Learning\Test_Dll_5\OpenNurbs_Test_2\Pyramid\Pyramid\Test_1_PointAdd.h(20,13): warning C4251: ‘Pyramid::Pt2’: class ‘ON_3dPoint’ needs to have dll-interface to be used by clients of class ‘Pyramid’
1>D:\C++&Java\OpenNurbs_2\opennurbs-7.x\opennurbs_texture_mapping.h(32): message : see declaration of ‘ON_3dPoint’
1>D:\C++&Java\C++Dll_Learning\Test_Dll_5\OpenNurbs_Test_2\Pyramid\Pyramid\Test_1_PointAdd.h(21,13): warning C4251: ‘Pyramid::Pt3’: class ‘ON_3dPoint’ needs to have dll-interface to be used by clients of class ‘Pyramid’
1>D:\C++&Java\OpenNurbs_2\opennurbs-7.x\opennurbs_texture_mapping.h(32): message : see declaration of ‘ON_3dPoint’
1>D:\C++&Java\C++Dll_Learning\Test_Dll_5\OpenNurbs_Test_2\Pyramid\Pyramid\Test_1_PointAdd.h(22,13): warning C4251: ‘Pyramid::Pt4’: class ‘ON_3dPoint’ needs to have dll-interface to be used by clients of class ‘Pyramid’
1>D:\C++&Java\OpenNurbs_2\opennurbs-7.x\opennurbs_texture_mapping.h(32): message : see declaration of ‘ON_3dPoint’
1>D:\C++&Java\C++Dll_Learning\Test_Dll_5\OpenNurbs_Test_2\Pyramid\Pyramid\Bridge.cpp(11,21): error C2526: ‘GetPyramid’: C linkage function cannot return C++ class ‘std::list<ON_Line,std::allocator<ON_Line>>’
1>D:\C++&Java\C++Dll_Learning\Test_Dll_5\OpenNurbs_Test_2\Pyramid\Pyramid\Test_1_PointAdd.h(26): message : see declaration of ‘std::list<ON_Line,std::allocator<ON_Line>>’
1>D:\C++&Java\C++Dll_Learning\Test_Dll_5\OpenNurbs_Test_2\Pyramid\Pyramid\Bridge.cpp(14,3): error C2562: ‘GetPyramid’: ‘void’ function returning a value
1>D:\C++&Java\C++Dll_Learning\Test_Dll_5\OpenNurbs_Test_2\Pyramid\Pyramid\Bridge.cpp(11): message : see declaration of ‘GetPyramid’
1>Test_1_PointAdd.cpp
1>D:\C++&Java\C++Dll_Learning\Test_Dll_5\OpenNurbs_Test_2\Pyramid\Pyramid\Test_1_PointAdd.h(19,13): warning C4251: ‘Pyramid::Pt1’: class ‘ON_3dPoint’ needs to have dll-interface to be used by clients of class ‘Pyramid’
1>D:\C++&Java\OpenNurbs_2\opennurbs-7.x\opennurbs_texture_mapping.h(32): message : see declaration of ‘ON_3dPoint’
1>D:\C++&Java\C++Dll_Learning\Test_Dll_5\OpenNurbs_Test_2\Pyramid\Pyramid\Test_1_PointAdd.h(20,13): warning C4251: ‘Pyramid::Pt2’: class ‘ON_3dPoint’ needs to have dll-interface to be used by clients of class ‘Pyramid’
1>D:\C++&Java\OpenNurbs_2\opennurbs-7.x\opennurbs_texture_mapping.h(32): message : see declaration of ‘ON_3dPoint’
1>D:\C++&Java\C++Dll_Learning\Test_Dll_5\OpenNurbs_Test_2\Pyramid\Pyramid\Test_1_PointAdd.h(21,13): warning C4251: ‘Pyramid::Pt3’: class ‘ON_3dPoint’ needs to have dll-interface to be used by clients of class ‘Pyramid’
1>D:\C++&Java\OpenNurbs_2\opennurbs-7.x\opennurbs_texture_mapping.h(32): message : see declaration of ‘ON_3dPoint’
1>D:\C++&Java\C++Dll_Learning\Test_Dll_5\OpenNurbs_Test_2\Pyramid\Pyramid\Test_1_PointAdd.h(22,13): warning C4251: ‘Pyramid::Pt4’: class ‘ON_3dPoint’ needs to have dll-interface to be used by clients of class ‘Pyramid’
1>D:\C++&Java\OpenNurbs_2\opennurbs-7.x\opennurbs_texture_mapping.h(32): message : see declaration of ‘ON_3dPoint’
1>Generating Code…
1>Done building project “Pyramid.vcxproj” – FAILED.
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
How to correct it and why??