Home > Mobile >  Cannot build Open3D from source
Cannot build Open3D from source

Time:01-03

I'm trying to build Open3D from source in c . I have followed the method explained here, but when it enable the flag -DBUILD_SHARED_LIBS=ON I get this message:

CMake Error at 3rdparty/webrtc/webrtc_download.cmake:15 (message):
Pre-built WebRTC binaries are not available for BUILD_SHARED_LIBS=ON or
STATIC_WINDOWS_RUNTIME=OFF.  Please use (a) BUILD_WEBRTC=OFF or (b)
BUILD_SHARED_LIBS=OFF and STATIC_WINDOWS_RUNTIME=ON or (c)
BUILD_WEBRTC_FROM_SOURCE=ON

When I then disable BUILD_WEBRTC I'm able to generate the project. However, when I then try to build the INSTALL in visual studio I can the following error:

error LNK2038: mismatch detected for 'RuntimeLibrary': value 'MD_DynamicRelease' doesn't match value 'MT_StaticRelease' in Open3DConfig.obj

Hopefully someone knows how to fix this problem :)

CodePudding user response:

According to the CMakeLists.txt for Open3D, when you set the BUILD_SHARED_LIBS=ON the following is also set:

if(BUILD_SHARED_LIBS)
  option(STATIC_WINDOWS_RUNTIME "Use static (MT/MTd) Windows runtime"      OFF)
else()
  option(STATIC_WINDOWS_RUNTIME "Use static (MT/MTd) Windows runtime"      ON )
endif()

Are you sure that you have the STATIC_WINDOWS_RUNTIME=OFF while still using BUILD_SHARED_LIBS=ON?

  • Related