meshlab icon indicating copy to clipboard operation
meshlab copied to clipboard

Please help build meshlab on windows

Open HungNgoCT opened this issue 1 year ago • 12 comments

Hi,

Thank you for amazing Meshlab.

I searched and followed many links, but could not build meshlab successfully.

Can any body help me steps to download necessary libraries, and build Meshlab on windows? Specially, somethings relating to QT.

I am using:

  • Windows 11
  • Visual studio 2019/2022

When I build using cmake, got error, but did not see where is QTOpenGL

CMake Error at Qt/qt-everywhere-src-5.15.2/qtbase/src/corelib/Qt5Config.cmake:25 (include): include could not find requested file:

D:/teshMeshLabBuild/meshlab/Qt/qt-everywhere-src-5.15.2/qtbase/src/corelib/Qt5ModuleLocation.cmake

Call Stack (most recent call first): src/CMakeLists.txt:20 (find_package)

CMake Error at Qt/qt-everywhere-src-5.15.2/qtbase/src/corelib/Qt5Config.cmake:28 (find_package): Could not find a package configuration file provided by "Qt5OpenGL" with any of the following names:

Qt5OpenGLConfig.cmake
qt5opengl-config.cmake

Add the installation prefix of "Qt5OpenGL" to CMAKE_PREFIX_PATH or set "Qt5OpenGL_DIR" to a directory containing one of the above files. If "Qt5OpenGL" provides a separate development package or SDK, be sure it has been installed. Call Stack (most recent call first): src/CMakeLists.txt:20 (find_package)

Thank you for your help

HungNgoCT avatar Oct 10 '23 10:10 HungNgoCT

I am trying to compile it on Windows too. How did you passed this error:

  CMake Error at CMakeLists.txt:13 (find_package):
  By not providing "FindQt5.cmake" in CMAKE_MODULE_PATH this project has
  asked CMake to find a package configuration file provided by "Qt5", but
  CMake did not find one.

  Could not find a package configuration file provided by "Qt5" with any of
  the following names:

    Qt5Config.cmake
    qt5-config.cmake

I downloaded qt-everywhere-src-5.15.2 but i don't know what to do with it. I do not even find the Qt5Config.cmake file. I have Qt5Config.cmake.in instead.

StudenteChamp2 avatar Oct 12 '23 03:10 StudenteChamp2

I am trying to compile it on Windows too. How did you passed this error:

  CMake Error at CMakeLists.txt:13 (find_package):
  By not providing "FindQt5.cmake" in CMAKE_MODULE_PATH this project has
  asked CMake to find a package configuration file provided by "Qt5", but
  CMake did not find one.

  Could not find a package configuration file provided by "Qt5" with any of
  the following names:

    Qt5Config.cmake
    qt5-config.cmake

I downloaded qt-everywhere-src-5.15.2 but i don't know what to do with it. I do not even find the Qt5Config.cmake file. I have Qt5Config.cmake.in instead.

Hi,

In my case, I search the word qt5config.cmake. It is somewhere in meshlab folder you downloaded. Then, I used set(CMAKE_PREFIX_PATH "to the folder found")

reference: https://stackoverflow.com/questions/47647035/cmake-prefix-path-doesnt-help-cmake-in-finding-qt5

However, although can build, it still has a tons of error. But after that, I could not load any ply files.

Still somethings were wrong in my steps.

HungNgoCT avatar Oct 12 '23 07:10 HungNgoCT

I managed to pass most of the errors using Anaconda.
https://www.anaconda.com/download
I have this error remaining:

CMake Error at src/CMakeLists.txt:88 (add_subdirectory):
  The source directory

    C:/Mesh_Lab-SRC/src/vcglib

  does not contain a CMakeLists.txt file.

How did you pass it?

Full log:
full_log.txt

StudenteChamp2 avatar Oct 12 '23 20:10 StudenteChamp2

I managed to pass most of the errors using Anaconda. https://www.anaconda.com/download I have this error remaining:

CMake Error at src/CMakeLists.txt:88 (add_subdirectory):
  The source directory

    C:/Mesh_Lab-SRC/src/vcglib

  does not contain a CMakeLists.txt file.

How did you pass it?

Full log: full_log.txt

It seems you did not download vcglib. Check inside vcglib to see if there is the file CMakeList.txt?

HungNgoCT avatar Oct 13 '23 04:10 HungNgoCT

You are right thank you :) I was missing the submodule

StudenteChamp2 avatar Oct 14 '23 02:10 StudenteChamp2

I first tried the official steps inside git bash. But i had errors:

Steps

Eigen

//----------------------------------------------------------------------------------------------------------------------------------- So I decided to build by progressively fixing the errors i get. I managed to successfullly generate the Cmake Solution and launch Meshlab. Here are the steps:

1) Generate Cmake solution

  1. Get Meshlab code with all submodules:
    git clone --recurse -submodules https://github.com/cnr-isti-vclab/meshlab.git

  2. If not installed, download and install Anaconda

  3. Open the Anaconda command prompt

  4. Remove any previous QT conda uninstall qt

  5. Remove any previous PyQT conda uninstall pyqt

  6. Install QT
    conda install -c anaconda qt

  7. Install PyQT conda install -c anaconda pyqt

  8. Install Eigen conda install eigen

  9. Install Cgal conda install -c conda-forge cgal

  10. Change directory to Meshlab repository folder

  11. Generate solution. For VS2017 64 bits: cmake -G "Visual Studio 15 2017 Win64"

2) Building Mesh lab

  1. Open MeshLab.sln

  2. Set meshlab vcxproj as startup project

  3. Change build configuration to Release(Debug build fails for now)

  4. When building Ms build will complain about not finding Eigen files. A workaround is to use absolute directory when including Eigen files.
    On my case replace all "<Eigen/" by "<C:/Mesh_Lab-SRC/src/vcglib/eigenlib/Eigen/" All

  5. Build

3) Running Mesh lab

  1. When trying to run Meshlab, program will complain about not finding some DLLs. To fix this: a) Download everything
    b) For each DLL not found -> Search for the DLL using everything -> Select the DLL inside Anaconda path -> Copy the DLL to src\distrib\Release

  2. Once all DLL are present, program will complain about QT plugin not initialized.
    Failed

To fix this add an environment variable QT_PLUGIN_PATH with value your Anaconda plugin directory. In my case C:\Users\Studente\anaconda3\Library\plugins"

  1. You should be able to run MeshLab now

StudenteChamp2 avatar Oct 14 '23 02:10 StudenteChamp2

ISSUES

While I am able to compile and run the the software. I am currently unable to load meshes:

  1. Unable to open MLP file NoMLP

  2. Unable to import OBJ file NoOBJ OBJ file

Anybody has an idea?

StudenteChamp2 avatar Oct 15 '23 23:10 StudenteChamp2

ISSUES

While I am able to compile and run the the software. I am currently unable to load meshes:

  1. Unable to open MLP file NoMLP
  2. Unable to import OBJ file NoOBJ OBJ file

Anybody has an idea?

I have the same problem.

HungNgoCT avatar Oct 16 '23 04:10 HungNgoCT

I also tried to build following the official steps but inside Anaconda. Build fail with the following errors: Failed.txt

@HungNgoCT Are you able to build in Debug?

StudenteChamp2 avatar Oct 16 '23 22:10 StudenteChamp2

I also tried to build following the official steps but inside Anaconda. Build fail with the following errors: Failed.txt

@HungNgoCT Are you able to build in Debug?

@StudenteChamp2 Build in Debug can run to Meshlab GUI, but cannot load any *ply, obj... files And I don't know how to solve

HungNgoCT avatar Oct 18 '23 09:10 HungNgoCT

@HungNgoCT Please can you zip and send me the .PDB files you get when building in Debug?

StudenteChamp2 avatar Oct 18 '23 18:10 StudenteChamp2

You are modifying the build system and that's a bad idea. You are never going to get a working build with this strategy. You probably did not follow the guide correctly. For example, if you are not able to find Eigen, it means that Eigen is missing. Probably, you did not clone the repo recursively, since Eigen is bundled inside vcg.

alemuntoni avatar Feb 09 '24 08:02 alemuntoni