PointCloudLibrary / pcl

Point Cloud Library (PCL)
https://pointclouds.org/
Other
9.88k stars 4.61k forks source link

PCL_EXPORTS seems to be implemented wrong #2708

Open SunBlack opened 5 years ago

SunBlack commented 5 years ago

I currently still trying to compile everything with MSVC. I could fix already a lot of issues, but there is an error I couldn't fix:

LNK2001 unresolved external symbol "public: static struct QMetaObject const pcl::cloud_composer::PropertiesModel::staticMetaObject" (?staticMetaObject@PropertiesModel@cloud_composer@pcl@@2UQMetaObject@@B)    pcl_cc_tool_fpfh_estimation

In general I could fix all linker errors, except where we export a target with Q_OBJECT:

    class PCL_EXPORTS AbstractTool : public QObject
    {
      Q_OBJECT
      //...
    }

If you search the web for this issue you always find, that we need __declspec(dllimport). But PCL_EXPORTS expand always to __declspec(dllexport) or empty.

Further issue: PCL_ADD_LIBRARY always add symbol PCLAPI_EXPORTS. This seems at first look correct, but I believe this is partially wrong.

And we use should CMake::GenerateExportHeader.

stale[bot] commented 4 years ago

Marking this as stale due to 30 days of inactivity. It will be closed in 7 days if no further activity occurs.

kunaltyagi commented 4 years ago

Shall we revive the discussion here again @SunBlack ?

SunBlack commented 4 years ago

Yep, I still have this in mind, as I don't know maybe this could be the reason why some libs are so big under windows.

But in general I'm currently waiting for CMake changes as I think the best order would be:

After this cleanup we may start with issues like this, but currently it is to much copy & paste between all CMake files, even we could do it also now without CMake cleanup before.

stale[bot] commented 4 years ago

Marking this as stale due to 30 days of inactivity. It will be closed in 7 days if no further activity occurs.

stale[bot] commented 4 years ago

Marking this as stale due to 30 days of inactivity. It will be closed in 7 days if no further activity occurs.