PointCloudLibrary / PointCloudLibrary/pcl
PCL_EXPORTS seems to be implemented wrong
Nobody has claimed this yet.
- Dominant language
- C++
- Stars
- 11.1k
- Forks
- 4.7k
- Avg merge
- 4d 10h
- Merged PRs (30d)
- 6
Description
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.
- Case 1: Someone build PCL and use installed libraries. In this case everything is fine, because
PCLAPI_EXPORTSis not defined - Case 2: A PCL library (
LibA) is using another PCL library (LibB). In this casePCLAPI_EXPORTSshould be true for all header files part ofLibBbut no defined forLibAduring buildingLibB. So I believe it would be correct if definePCL_LibA_EXPORTSandPCL_LibB_EXPORTSinstead of justPCL_EXPORTS.
And we use should CMake::GenerateExportHeader.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing the MSVC linker failure for Q_OBJECT classes and trace how PCL_EXPORTS and PCL_ADD_LIBRARY define export symbols. Compare the current behavior with CMake::GenerateExportHeader and verify that dependent libraries receive the correct import or export annotations without unresolved staticMetaObject symbols.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cmake, cpp
- Domain
- build-system
- Issue type
- Bug
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 25/100