magnum-plugins icon indicating copy to clipboard operation
magnum-plugins copied to clipboard

meshoptimizersceneconverter build failed because meshoptimizer has updated

Open LilyWangLL opened this issue 2 years ago • 3 comments

Hi, I installed meshoptimizersceneconverter plugin failed with the following error:

C:\Users\admin\git_projects\vcpkg2\buildtrees\magnum-plugins\src\v2020.06-79ad147c2a.clean\src\MagnumPlugins\MeshOptimizerSceneConverter\MeshOptimizerSceneConverter.cpp(318): error C2660: 'meshopt_simplifySloppy': function does not take 7 arguments
C:\Users\admin\git_projects\vcpkg2\vcpkg_installed\x64-windows\include\meshoptimizer.h(354): note: see declaration of 'meshopt_simplifySloppy'
C:\Users\admin\git_projects\vcpkg2\vcpkg_installed\x64-windows\include\meshoptimizer.h(620): note: could be 'size_t meshopt_simplifySloppy(T *,const T *,size_t,const float *,size_t,size_t,size_t,float,float *)'
C:\Users\admin\git_projects\vcpkg2\buildtrees\magnum-plugins\src\v2020.06-79ad147c2a.clean\src\MagnumPlugins\MeshOptimizerSceneConverter\MeshOptimizerSceneConverter.cpp(318): note: 'size_t meshopt_simplifySloppy(T *,const T *,size_t,const float *,size_t,size_t,size_t,float,float *)': expects 9 arguments - 7 provided
C:\Users\admin\git_projects\vcpkg2\buildtrees\magnum-plugins\src\v2020.06-79ad147c2a.clean\src\MagnumPlugins\MeshOptimizerSceneConverter\MeshOptimizerSceneConverter.cpp(318): note: while trying to match the argument list '(T *, Corrade::Containers::ArrayView<const Magnum::UnsignedInt>, Magnum::UnsignedInt, const float *, Magnum::UnsignedInt, __int64, const Magnum::UnsignedInt)'
        with
        [
            T=Magnum::UnsignedInt
        ]
C:\Users\admin\git_projects\vcpkg2\buildtrees\magnum-plugins\src\v2020.06-79ad147c2a.clean\src\MagnumPlugins\MeshOptimizerSceneConverter\MeshOptimizerSceneConverter.cpp(320): error C2660: 'meshopt_simplify': function does not take 8 arguments
C:\Users\admin\git_projects\vcpkg2\vcpkg_installed\x64-windows\include\meshoptimizer.h(339): note: see declaration of 'meshopt_simplify'
C:\Users\admin\git_projects\vcpkg2\vcpkg_installed\x64-windows\include\meshoptimizer.h(618): note: could be 'size_t meshopt_simplify(T *,const T *,size_t,const float *,size_t,size_t,size_t,float,unsigned int,float *)'
C:\Users\admin\git_projects\vcpkg2\buildtrees\magnum-plugins\src\v2020.06-79ad147c2a.clean\src\MagnumPlugins\MeshOptimizerSceneConverter\MeshOptimizerSceneConverter.cpp(320): note: 'size_t meshopt_simplify(T *,const T *,size_t,const float *,size_t,size_t,size_t,float,unsigned int,float *)': could not deduce template argument for 'const T *' from 'Corrade::Containers::ArrayView<const Magnum::UnsignedInt>'
C:\Users\admin\git_projects\vcpkg2\buildtrees\magnum-plugins\src\v2020.06-79ad147c2a.clean\src\MagnumPlugins\MeshOptimizerSceneConverter\MeshOptimizerSceneConverter.cpp(320): note: while trying to match the argument list '(T *, Corrade::Containers::ArrayView<const Magnum::UnsignedInt>, Magnum::UnsignedInt, const float *, Magnum::UnsignedInt, __int64, const Magnum::UnsignedInt, const Magnum::Float)'
        with
        [
            T=Magnum::UnsignedInt
        ]

The reason is meshoptimizer modified function meshopt_simplifySloppy and meshopt_simplify, their parameters have changed, the related link: https://github.com/zeux/meshoptimizer/commit/66040c7d7595490620d92f9a757e03354a1e206c and https://github.com/zeux/meshoptimizer/pull/217

Can someone help fix this error please? Thank you.

LilyWangLL avatar Apr 26 '23 02:04 LilyWangLL

Hi, I think this should work in current master, I did a similar fix in 408c9739c8c9098f6ea65450999767d9978e276d (August 2022).

As far as I can see, you're building version 2020.06 which is too old to work with current meshoptimizer. If you build current HEAD instead it should work, but note you have to do that for Corrade and Magnum too:

vcpkg install --head corrade magnum magnum-plugins

Unfortunately due to time pressure on my side I'm unable to tag a new version anytime soon, so you have to keep using the --head, sorry. Which also means the 2020.06 version in vcpkg either can't build with the meshoptimizer plugin or it has to pin the meshoptimizer dependency to an older version, if that's possible.

You can subscribe to https://github.com/mosra/magnum/issues/453 for updates about the new release.

mosra avatar Apr 26 '23 12:04 mosra