Hi,
I have some strange behaviour and I'm not sure how to solve these.
I'm working with Windows 10 and MSVS15.
I have a plugin project that compiles "apparently" without error, as you can see below.
The install build seems also ok
And the compiled plugin is copied into the final folder.
When I lauched CC in debug mode in msvs, I've got the lines in the log of CC and note that file does exist at this address! I'm not sure why there is a mix of / and \ in the file pathes though!
And in the log of msvs I can read the following:
'CloudCompare.exe' (Win32): Loaded 'C:\Lower9th_dev\CloudCompareCompile\CloudCompare_debug\plugins\QELITGEOMATICd.dll'. Symbols loaded.
'CloudCompare.exe' (Win32): Unloaded 'C:\Lower9th_dev\CloudCompareCompile\CloudCompare_debug\plugins\QELITGEOMATICd.dll'
Note that if I comment out a class instantiation (from an external lib) in my plugin everything works and the plugin is indeed loaded and functionnal. So it seems to be some kind of linkage issue or execution/instantiation issue of else!
The class that seems to cause the problem was tested and used in other programs successfully.
Any ideas or pointers why and where I should look to find out what is going on?
Thanks
Antoine
Plugin compiles fine... but not loading
Re: Plugin compiles fine... but not loading
If you use an external library, it probably comes with its own DLLs. These DLLs must be copied next to the plugin DLL (or next to CloudCompare.exe). The message returned by the Qt component that loads the DLL is a bit misleading, but actually if the DLL can't be loaded because its dependencies are not found, then you'll get this message stating that the 'module' could not be found...
You can use "Dependency Waker" on the DLL file of your plugin to spot the missing modules.
You can use "Dependency Waker" on the DLL file of your plugin to spot the missing modules.
Daniel, CloudCompare admin
Re: Plugin compiles fine... but not loading
Evening Daniel,
Thanks for your response.
I get the point, but have a follow-up question as I'm not fluent in DLL.
As it stands, I've compiled the external libraries (it's a set of 4 libs interconnected) as .lib as I wanted to to some static linking with CC plugin.
If I understand correctly, I'd better compile everything as .dll, is this correct? and then copy the 4 .dll in CC folder with the plugin dll.
Thanks
Antoine
Thanks for your response.
I get the point, but have a follow-up question as I'm not fluent in DLL.
As it stands, I've compiled the external libraries (it's a set of 4 libs interconnected) as .lib as I wanted to to some static linking with CC plugin.
If I understand correctly, I'd better compile everything as .dll, is this correct? and then copy the 4 .dll in CC folder with the plugin dll.
Thanks
Antoine
Re: Plugin compiles fine... but not loading
No compiling as much libraries as static libraries is a good thing (if you have the right to do so: some licences don't allow this ;). The less DLLs you have the better I think. However in your case at least one of these libraries seems to have a DLL as dependency (Dependency Walker should tell you).
Pay attention also that libraries compiled as DLLs can also have a .lib (for linkage). I mean a .lib doesn't mean that the library is actually 'static'.
Pay attention also that libraries compiled as DLLs can also have a .lib (for linkage). I mean a .lib doesn't mean that the library is actually 'static'.
Daniel, CloudCompare admin
Re: Plugin compiles fine... but not loading
Thanks Daniel, problem solved...