[RESOLVED] Plugin exportation

Questions related to plugins development
polienn
Posts: 6
Joined: Tue Apr 05, 2022 3:16 pm

[RESOLVED] Plugin exportation

Post by polienn »

Hello,

I have developed a plugin that works well with both the source-generated version of Cloud Compare and the standalone version installed from the site. (Windows 11, VS 2019)

However, as soon as I want to test this plugin on another computer or on a virtual machine, CC does not load it and displays an error message like:
MyPlugin.dll does not seem to be a valid plugin (Cannot load library MyPlugin.dll : la procédure spécifiée est introuvable )
Plugin's makefile :

Code: Select all

project(MyPlugin )
 
AddPlugin( NAME ${PROJECT_NAME} )

set(CloudCompare_SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/../../../qCC)
include_directories( ${CloudCompare_SOURCE_DIR} )

add_subdirectory( include )
add_subdirectory( src )
I use qCC and CCoreLib methods, so have try adding

Code: Select all

target_link_libraries( ${PROJECT_NAME} CCCoreLib::CCCoreLib )
and

Code: Select all

target_link_libraries( ${PROJECT_NAME} QCC_DB_LIB )
without results...

According to Depency Walker, "QCC_DB_LIB is not found", but adding QCC_DB_LIB.dll in the same folder of the plugin doesn't work either...

Any ideas ?
Thanks
Last edited by polienn on Tue May 03, 2022 8:22 pm, edited 1 time in total.
daniel
Site Admin
Posts: 7710
Joined: Wed Oct 13, 2010 7:34 am
Location: Grenoble, France
Contact:

Re: Plugin exportation

Post by daniel »

Normally, qCC_db.dll should already be present (next to CloudCompare.exe). So it should not be due to this indeed.

Do you have any other dependency?

And which version of Qt are you using by the way? (the official release uses 5.15.2).
Daniel, CloudCompare admin
polienn
Posts: 6
Joined: Tue Apr 05, 2022 3:16 pm

Re: Plugin exportation

Post by polienn »

daniel wrote: Sat Apr 09, 2022 10:55 am Normally, qCC_db.dll should already be present (next to CloudCompare.exe). So it should not be due to this indeed.

Do you have any other dependency?

And which version of Qt are you using by the way? (the official release uses 5.15.2).
It seems to me that there is no external dependency apart from Qt or CCCoreLib or qCC (but maybe these functions have their own dependency ? ) :

Code: Select all

// SYS
#include <sstream>
#include <string>

// QT
#include <QInputDialog>


// Cloud compare
#include "CCCoreLib.h"
#include "CCMath.h"
#include "ccMainAppInterface.h"
#include "ccPointCloud.h"
#include "ccMesh.h"
#include "ccOctree.h"
#include <ccRegistrationTools.h>

#include <CloudSamplingTools.h>
#include <DgmOctreeReferenceCloud.h>
#include <DistanceComputationTools.h>
#include <GenericProgressCallback.h>
#include <ReferenceCloud.h>
#include <ScalarField.h>
#include <ScalarFieldTools.h>
#include "ReferenceCloud.h"
#include <ccRegistrationTools.cpp>
#include <mainwindow.h>
#include <GeometricalAnalysisTools.h>
#include <ManualSegmentationTools.h>
I also use Qt 5.15.2
daniel
Site Admin
Posts: 7710
Joined: Wed Oct 13, 2010 7:34 am
Location: Grenoble, France
Contact:

Re: Plugin exportation

Post by daniel »

As long as it's Qt or CloudCompare's own libraries, I would say that you should be good...

But maybe it's the compiler then? We are using Visual 2017 (v141).
Daniel, CloudCompare admin
polienn
Posts: 6
Joined: Tue Apr 05, 2022 3:16 pm

Re: Plugin exportation

Post by polienn »

thank you for your availability

i've tried with VS 2017 (v.141 also) and VS 2019 but no more results...
daniel
Site Admin
Posts: 7710
Joined: Wed Oct 13, 2010 7:34 am
Location: Grenoble, France
Contact:

Re: Plugin exportation

Post by daniel »

Maybe I could try to compile it on my side if you want to test if that works better?
Daniel, CloudCompare admin
polienn
Posts: 6
Joined: Tue Apr 05, 2022 3:16 pm

Re: Plugin exportation

Post by polienn »

I would like to, thanks !
myPlugin.rar
plugin sources
(23.24 KiB) Downloaded 1041 times
daniel
Site Admin
Posts: 7710
Joined: Wed Oct 13, 2010 7:34 am
Location: Grenoble, France
Contact:

Re: Plugin exportation

Post by daniel »

Mind that the code was outdated (not compiling with the 2.12 version), so I had to update it here and there. Hopefully it works the same as intended.

Here is the binary:
VirtualReassociationPlugin.7z
(48.15 KiB) Downloaded 1364 times
And it will probably only work with the latest 2.12 version.
Daniel, CloudCompare admin
polienn
Posts: 6
Joined: Tue Apr 05, 2022 3:16 pm

Re: Plugin exportation

Post by polienn »

I'm quite surprised that it doesn't compile with 1.12 when I debugged it on 1.12 alpha...

But I just tested, the plugin loads well and the operation with the dataset is as expected

Thank you very much for getting this version to work !
Could I have the code with the modifications please?
daniel
Site Admin
Posts: 7710
Joined: Wed Oct 13, 2010 7:34 am
Location: Grenoble, France
Contact:

Re: Plugin exportation

Post by daniel »

Ah sorry I didn't keep it!

The modifications were quite easy (a missing 'nullptr' parameter twice, and the code to determine the best radius for the normals computation which has moved from the NormalVectors class to the octree - and with slightly more complex parameters, but you can copy paste what's done in the command line version of the normals computation).
Daniel, CloudCompare admin
Post Reply