c++ 无法从源构建Open3D

fumotvh3  于 2023-01-03  发布在  其他
关注(0)|答案(1)|浏览(205)

我试图从源代码构建Open 3D在c++。我已经按照方法解释here,但当它启用标志-DBUILD_SHARED_LIBS=ON我得到这个消息:

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

当我禁用BUILD_WEBRTC时,我可以生成该项目。但是,当我尝试在Visual Studio中生成INSTALL时,我会出现以下错误:

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

希望有人知道如何解决这个问题:)

hpcdzsge

hpcdzsge1#

根据Open3D的CMakeLists.txt,当您设置BUILD_SHARED_LIBS=ON时,也会设置以下内容:

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()

您确定您拥有STATIC_WINDOWS_RUNTIME=OFF,但仍在使用BUILD_SHARED_LIBS=ON吗?

相关问题