CloudCompare-PythonPlugin icon indicating copy to clipboard operation
CloudCompare-PythonPlugin copied to clipboard

NormsIndexesTableType symbol errors

Open tmontaigu opened this issue 3 years ago • 1 comments

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 methods

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

tmontaigu avatar Mar 28 '21 18:03 tmontaigu