CloudCompare-PythonPlugin
CloudCompare-PythonPlugin copied to clipboard
NormsIndexesTableType symbol errors
The issue is more related to CloudCompare than this plugin but:
The type NormsIndexesTableType cannot be proberly wrapped to Python.
On linux if its wrapped or used in as an argument / return type at runtime we get such error:
libPythonPlugin.so does not seem to be a valid plugin (Cannot load library /usr/local/lib/cloudcompare/plugins/libPythonPlugin.so: (/usr/local/lib/cloudcompare/plugins/libPythonPlugin.so: undefined symbol: _ZTI21NormsIndexesTableType))
Inspecting libQCC_DB_LIB.so
indeed shows that the symbol is not exported.
nm -gD libQCC_DB_LIB.so | grep _ZTI21NormsIndexesTableType
# nothing
The fix would be to put QCC_DB_LIB_API
to the class:
# qCC_db\include\ccAdvancedTypes.h
// From
class NormsIndexesTableType : public ccArray<CompressedNormType, 1, CompressedNormType> { ... }
// To
class QCC_DB_LIB_API NormsIndexesTableType : public ccArray<CompressedNormType, 1, CompressedNormType> { ... }
However doing this creates link errors on windows about symbols being define multiple times (LNK2005, LNK1169) on std::vector
QCC_DB_LIB.lib(QCC_DB_LIB.dll) : error LNK2005: "public: __cdecl std::vector<unsigned int,class std::allocator<unsigned int> >::vector<unsigned int,class std::allocator<unsigned int> >(void)" (??0?$vector@IV?$allocator@I@std@@@std@@QEAA@XZ) d‚j… d‚fini(e) dans ccHistogramWindow.cpp.obj
QCC_DB_LIB.lib(QCC_DB_LIB.dll) : error LNK2005: "public: __cdecl std::vector<unsigned int,class std::allocator<unsigned int> >::~vector<unsigned int,class std::allocator<unsigned int> >(void)" (??1?$vector@IV?$allocator@I@std@@@std@@QEAA@XZ) d‚j… d‚fini(e) dans ccHistogramWindow.cpp.obj
QCC_DB_LIB.lib(QCC_DB_LIB.dll) : error LNK2005: "public: void __cdecl std::vector<unsigned int,class std::allocator<unsigned int> >::resize(unsigned __int64)" (?resize@?$vector@IV?$allocator@I@std@@@std@@QEAAX_K@Z) d‚j… d‚fini(e) dans ccHistogramWindow.cpp.obj
QCC_DB_LIB.lib(QCC_DB_LIB.dll) : error LNK2005: "public: bool __cdecl std::vector<unsigned int,class std::allocator<unsigned int> >::empty(void)const " (?empty@?$vector@IV?$allocator@I@std@@@std@@QEBA_NXZ) d‚j… d‚fini(e) dans ccHistogramWindow.cpp.obj
QCC_DB_LIB.lib(QCC_DB_LIB.dll) : error LNK2005: "public: unsigned __int64 __cdecl std::vector<unsigned int,class std::allocator<unsigned int> >::size(void)const " (?size@?$vector@IV?$allocator@I@std@@@std@@QEBA_KXZ) d‚j… d‚fini(e) dans ccHistogramWindow.cpp.obj
QCC_DB_LIB.lib(QCC_DB_LIB.dll) : error LNK2005: "public: unsigned int & __cdecl std::vector<unsigned int,class std::allocator<unsigned int> >::operator[](unsigned __int64)" (??A?$vector@IV?$allocator@I@std@@@std@@QEAAAEAI_K@Z) d‚j… d‚fini(e) dans ccHistogramWindow.cpp.obj
QCC_DB_LIB.lib(QCC_DB_LIB.dll) : error LNK2005: "public: void __cdecl std::vector<unsigned int,class std::allocator<unsigned int> >::resize(unsigned __int64,unsigned int const &)" (?resize@?$vector@IV?$allocator@I@std@@@std@@QEAAX_KAEBI@Z) d‚j… d‚fini(e) dans ccHistogramWindow.cpp.obj
QCC_DB_LIB.lib(QCC_DB_LIB.dll) : error LNK2005: "public: unsigned __int64 __cdecl std::vector<unsigned int,class std::allocator<unsigned int> >::max_size(void)const " (?max_size@?$vector@IV?$allocator@I@std@@@std@@QEBA_KXZ) d‚j… d‚fini(e) dans ccHistogramWindow.cpp.obj
QCC_DB_LIB.lib(QCC_DB_LIB.dll) : error LNK2005: "public: unsigned int const & __cdecl std::vector<unsigned int,class std::allocator<unsigned int> >::operator[](unsigned __int64)const " (??A?$vector@IV?$allocator@I@std@@@std@@QEBAAEBI_K@Z) d‚j… d‚fini(e) dans ccHistogramWindow.cpp.obj
QCC_DB_LIB.lib(QCC_DB_LIB.dll) : error LNK2005: "public: unsigned __int64 __cdecl std::vector<unsigned int,class std::allocator<unsigned int> >::capacity(void)const " (?capacity@?$vector@IV?$allocator@I@std@@@std@@QEBA_KXZ) d‚j… d‚fini(e) dans ccHistogramWindow.cpp.obj
CloudCompare.exe : fatal error LNK1169: un ou plusieurs symboles définis à différentes reprises ont été rencontrés
It seems that It's due (not 100% sure) to the fact that CloudCompare has multiple classes that inherits from std::vector. But then no idea on how to fix this without refactoring alot of CC's internals