Hello,
In my plugin CC, I want to use QtXml to load/save xml file to get/save parameters. But I got errors.
What should I do in my plugin source? Modify CMakeLists file of the plugin?
The compilation error as this:
error LNK2019: unresolved external symbol "__declspec(dllimport) public: class QDomElement __cdecl QDomDocument::createElement(class QString const &)" (__imp_?createElement@QDomDocument@@QEAA?AVQDomElement@@AEBVQString@@@Z) referenced in function "public: void __cdecl qFilteringChainDlg::onFileSave(void)" (?onFileSave@qFilteringChainDlg@@QEAAXXZ) C:\Export\Users\CloudCompare\CloudCompare-2.10.2\build\plugins\3rdParty\qFilteringChain\qFilteringChainDlg.obj QFILTERING_CHAIN_PLUGIN
Thanks
(Resolved)How can I use QtXml in my plugin?
(Resolved)How can I use QtXml in my plugin?
Last edited by fblue on Wed Jul 03, 2019 8:33 am, edited 1 time in total.
Re: How can I use QtXml in my plugin?
I believe the QtXml library has to be 'linked' in the CMake file of your plugin. See how this is done in the main project for instance (https://github.com/CloudCompare/CloudCo ... ts.txt#L65).
Oh and you'll also need to copy the corresponding DLL file next to CloudCompare's executable (this must also be done in some other plugins?)
Oh and you'll also need to copy the corresponding DLL file next to CloudCompare's executable (this must also be done in some other plugins?)
Daniel, CloudCompare admin
(Resolved)Re: How can I use QtXml in my plugin?
Yes!
In my plugin CMakeLists file, I've added the following lines:
find_package(Qt5Xml REQUIRED)
target_link_libraries(${PROJECT_NAME} Qt5::Core Qt5::Gui Qt5::Widgets Qt5::OpenGL Qt5::Xml)
Then add the corresponding dlls in project and now the compilation is OK.
Ps:
I've tried many times in CMakeLists and finally the problem is because of the line find_package().
What I added was "find_package(QT5 COMPONENTS Xml REQUIRED)", and it didn't work. Frustrating!
Thanks a lot!
In my plugin CMakeLists file, I've added the following lines:
find_package(Qt5Xml REQUIRED)
target_link_libraries(${PROJECT_NAME} Qt5::Core Qt5::Gui Qt5::Widgets Qt5::OpenGL Qt5::Xml)
Then add the corresponding dlls in project and now the compilation is OK.
Ps:
I've tried many times in CMakeLists and finally the problem is because of the line find_package().
What I added was "find_package(QT5 COMPONENTS Xml REQUIRED)", and it didn't work. Frustrating!
Thanks a lot!
Re: (Resolved)How can I use QtXml in my plugin?
Thanks for the feedback ;)
Daniel, CloudCompare admin