asmaloney / MeshIO

CloudCompare plugin for loading COLLADA, glTF, and IFC-SPF 3D models
BSD 3-Clause "New" or "Revised" License
32 stars 1 forks source link

Problems with version modified to use vcpkg #7

Closed Niexiaoer closed 1 year ago

Niexiaoer commented 1 year ago

Question Hello, thank you for your work. I add the plugin as described by the readme. However, when I load the cloudcompare.exe, the plugin label is disabled(grey), and I can not load the dae and gltf file.

Screenshots image

Additional context Add any other context about the problem here.

Your Environment

asmaloney commented 1 year ago
  1. Are there any messages in the console at the bottom? It should say whether the plugin was found and loaded, and if the extensions were properly registered.
  2. Does the plugin show up in the "About Plugins" window? (Not sure where that menu item is on Windows.)
  3. If it does not, make sure that the plugin DLL is in one of the paths listed at the bottom of that window.
Niexiaoer commented 1 year ago

Thank you for your reply. I checked the console and found that the software failed to load the MeshIO.dll and says that "MeshIO.dll does not seem to be a valid plugin". image And the files in the plugin folder are like this: image Do I need to add other related dll files into this folder to make the MESHIO.dll valid? image

asmaloney commented 1 year ago

Oh! Yes you'll need those.

I didn't realize Windows was building assimp as a DLL. I'll take a look at the CMake to see why.

Edit: I'm clearly intending for it to be a static build:

set( BUILD_SHARED_LIBS FALSE CACHE INTERNAL "override ASSIMP flags" FORCE )
Niexiaoer commented 1 year ago

Yes, I try to copy the three dll file into the same folder with the cloudcompare.exe and it works

asmaloney commented 1 year ago

Just to make sure we're working with the same code - you are using the MeshIO commit tagged "cloudcompare-2.11.x", right?

I'm not quite sure how to make this work properly. The assimp library is using a global CMake variable (BUILD_SHARED_LIBS) which I guess I can't turn off on Windows.

I'm also not seeing how you end up with a DLL for zlib or where pugixml is coming from.

Could you please try adding this to the MeshIO/CMakeLists.txt file?

set( ASSIMP_BUILD_ZLIB TRUE CACHE INTERNAL "override ASSIMP flags" FORCE )

Then delete the previous DLL files and build it again?

asmaloney commented 1 year ago

I just noticed that the dates on your DLLs are not consistent and the file size of MeshIO.dll is different between the build directory and what you have installed.

Did you first try to build a recent version of CloudCompare/MeshIO and then back off to the 2.11.x version? pugixml is in a recent version of assimp, but not the older one.

Could you please remove the whole build directory and rebuild from scratch to see what you get?

Niexiaoer commented 1 year ago

you are using the MeshIO commit tagged "cloudcompare-2.11.x", right?

Yes

I just noticed that the dates on your DLLs are not consistent and the file size of MeshIO.dll is different between the build directory and what you have installed.

Actually, the difference between the size of MeshIO.dll is that one is from release mode and another is from releasewithdebuginfo, sorry for the confusion.

Did you first try to build a recent version of CloudCompare/MeshIO and then back off to the 2.11.x version? pugixml is in a recent version of assimp, but not the older one.

no

I'm also not seeing how you end up with a DLL for zlib or where pugixml is coming from.

For convenience, the assimp, zlib and pugixml are all build from vcpkg.

set( ASSIMP_BUILD_ZLIB TRUE CACHE INTERNAL "override ASSIMP flags" FORCE )

I have tried this and rebuild the exe, still need to copy the three dll files

asmaloney commented 1 year ago

For convenience, the assimp, zlib and pugixml are all build from vcpkg.

I don't understand. So you've modified MeshIO's CMake files to work with externally-built libraries?

Niexiaoer commented 1 year ago

yes, I make a little adjustment to the meshio cmake files to work with vcpkg. Maybe it is due to the adjustment? Just curious, under your assumption, is only one dll file(meshio.dll) generated in the build folder?

在 2023年1月3日,下午10:44,Andy Maloney @.***> 写道:

 For convenience, the assimp, zlib and pugixml are all build from vcpkg.

I don't understand. So you've modified MeshIO's CMake files to work with externally-built libraries?

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you authored the thread.

asmaloney commented 1 year ago

🤦 That's kind of critical information that would have saved me a couple of hours of digging through CMake files.

If you have modified it to use other libraries for some reason, then I have no idea what it's doing. It's designed to use only the parts it needs from a specific version of assimp which is compiled into the MeshIO plugin.

And yes it's supposed to be one DLL - I mentioned my surprise about assimp as a DLL back here.