我知道这个问题之前已经问过很多次了,总是以相同的答案结束...将FormsAuthentication.SignOut()
添加到您的-DBOOST_LOG_DYN_LINK
文件中。
但是,很长一段时间以来,我一直在做这个事情,而且一切都正常地链接在一起。现在我决定从16.04切换到Ubuntu 18.04,并逐一更新我的项目。...
这是我的cmake文件:
CMakeLists.txt
编译后,它以已知的一长串问题失败,所有相关问题以一条消息结尾
cmake_minimum_required(VERSION 2.8.4)
project(FOO)
find_package(Boost REQUIRED COMPONENTS system timer filesystem log program_options unit_test_framework)
find_package(CGAL COMPONENTS Core)
find_library(OPEN_MESH_CORE_LIBRARY OpenMeshCore /usr/local/lib/OpenMesh REQUIRED)
find_library(YAML_CPP_LIBRARY yaml-cpp REQUIRED)
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake/Modules/")
find_package(PkgConfig REQUIRED)
pkg_check_modules(JSONCPP jsoncpp)
link_libraries(${JSONCPP_LIBRARIES})
include_directories(${JSONCPP_INCLUDE_DIRS})
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -ffast-math -fopenmp -msse2 -march=native -W -Wall -std=c++11")
add_definitions(-DBOOST_LOG_DYN_LINK=1)
add_definitions(-DUNIT_TEST_DATA="${CMAKE_SOURCE_DIR}/data")
include( ${CGAL_USE_FILE} )
include( CGAL_CreateSingleSourceCGALProgram )
set(SOURCE_FILES
Foo1.cpp
Foo2.cpp
Foo3.cpp)
add_executable(FOO main.cpp ${SOURCE_FILES})
target_include_directories(FOO PRIVATE ${JsonCpp_INCLUDE_DIRS})
target_link_libraries(FOO ${OPEN_MESH_CORE_LIBRARY} ${Boost_LIBRARIES} ${YAML_CPP_LIBRARY} ${JSONCPP_LIBRARIES})
add_library(foo SHARED ${SOURCE_FILES})
target_link_libraries(foo ${OPEN_MESH_CORE_LIBRARY} ${Boost_LIBRARIES} ${YAML_CPP_LIBRARY} ${JSONCPP_LIBRARIES})
add_executable(tests test.cpp ${SOURCE_FILES})
target_include_directories(FOO PRIVATE ${JsonCpp_INCLUDE_DIRS})
target_link_libraries(tests ${OPEN_MESH_CORE_LIBRARY} ${Boost_LIBRARIES} ${YAML_CPP_LIBRARY} ${JSONCPP_LIBRARIES})
我不是cmake忍者,很可能我做错了事,但是我找不到它是什么。
编辑:
所有尝试都遵循完全相同的过程。
答案 0 :(得分:0)
Boost或CMakeLists.txt中未出现此问题。这实际上是CGAL在调用find_package(Boost)
时在其使用协议中的某个地方再次调用include( ${CGAL_USE_FILE} )
的问题,最终以指向其自身组件的链接覆盖Boost_LIBRARIES
,从而完全忽略了我已经拥有的内容之前找到的。
这是reported issue
因为我没有修补CGAL,所以解决方案有点脏。当我打电话给include( ${CGAL_USE_FILE} )
时,只需要更改顺序并将其放在顶部即可。
find_package(CGAL COMPONENTS Core)
include( ${CGAL_USE_FILE} )
find_package(Boost REQUIRED COMPONENTS system timer filesystem log
program_options unit_test_framework)
请注意,这是一个快速修复,可能会导致其他问题,例如覆盖CGAL所需的Boost组件!