运行ceres-solver中 powell.cpp 出现error: ‘CERES_GFLAGS_NAMESPACE’ has not been declared CERES_GFLAGS_N

查看  ParseCommandLineFlags发现来源于gflags:

所以只要将

CERES_GFLAGS_NAMEPACE::ParseCommandLineFlags(&argc, &argv, true);

改成:

gflags::ParseCommandLineFlags(&argc, &argv, true);

 不用改变相对应的CMakeLists.txt.
 

cmake_minimum_required(VERSION 2.8)

project(  )

find_package(Ceres REQUIRED)
include_directories(${CERES_INCLUDE_DIRS})
 
###powell

add_executable(powell src/powell.cpp)
target_link_libraries(powell ${CERES_LIBRARIES})

你可能感兴趣的:(运行ceres-solver中 powell.cpp 出现error: ‘CERES_GFLAGS_NAMESPACE’ has not been declared CERES_GFLAGS_N)