Closed SunBlack closed 4 years ago
Which VTK version do you use?
For some reason I can't reproduce right now with the VTK9 branch I'm working on.
Though I'm not sure if it is related...
Do you have BUILD_surface_on_nurbs
enabled? (I'm using VTK 8.2)
Yes. And the example can build and run:
I did see this error before locally. But the only change since then is the vtk 8.2 -> vtk 9.
Mhm interesting. Can you try it again with VTK 8.2?
Did you build in debug? I did release.
You mention in this old PR https://github.com/PointCloudLibrary/pcl/pull/3140#issuecomment-502046839
That it happens in debug ?
Ah yes, Debug build
Think we need to add either PCL_EXPORT to this.
OR add the two defines:
ON_DLL_EXPORTS ON_COMPILING_OPENNURBS
However, it now complained about linking to: ./x64/debug/zlib.lib
Needs a bit more digging :D
Same here with ./x64/debug/zlib.lib
😢 Until now I don't have an idea why MSVC is trying to link against it.
Its happening in this file by pragmas: https://github.com/PointCloudLibrary/pcl/blob/cc7fe363c6463a0abc617b1e17e94ab4bd4169ef/surface/include/pcl/surface/3rdparty/opennurbs/examples_linking_pragmas.h
Probably easier to add the PCL_EXPORT in front of all the debug functions.
Currently you are getting following compile issue under windows in case you have
BUILD_surface_on_nurbs
enabled:Reason is the missing macro
ON_DLL_TEMPLATE
, caused by missing macroON_DLL_EXPORTS
https://github.com/PointCloudLibrary/pcl/blob/8eb47684da26d42cd8cd69c79976e8aee04a2831/surface/include/pcl/surface/3rdparty/opennurbs/opennurbs_extensions.h#L139-L167
The macro will be defined here: https://github.com/PointCloudLibrary/pcl/blob/c44061819582ac6a641b20c1bbd3b44c31deb813/surface/include/pcl/surface/3rdparty/opennurbs/opennurbs_defines.h#L88-L123
To enable this block
OPENNURBS_EXPORTS
needs to be defined https://github.com/PointCloudLibrary/pcl/blob/c44061819582ac6a641b20c1bbd3b44c31deb813/surface/include/pcl/surface/3rdparty/opennurbs/opennurbs_defines.h#L66-L70And surprise:
OPENNURBS_EXPORTS
will be never be defined.A long time ago there was already a try to fix issues with it, but this fix was incomplete.
So we have the choice:
OPENNURBS_EXPORTS
flag: In this case we need to exportOPENNURBS_IMPORTS
, too and revert the old fix. Otherwise you are getting tons of warnings:warning C4141: 'dllexport': used more than once (compiling source file C:\dev\pcl\surface\src\3rdparty\opennurbs\opennurbs_3dm_attributes.cpp)
ON_CLASS
and all other openNURBS specific macros by e.g.PCL_EXPORTS
. In this case we have currently no replacement for e.g.ON_DLL_TEMPLATE