ubuntu FindBoost总是失败

tjjdgumg  于 6个月前  发布在  其他
关注(0)|答案(1)|浏览(99)

我用sudo apt-get install libboost-all-dev安装了Boost
我还尝试按照这里的文档构建并安装到自定义位置,然后在nano ~/.bashrc中的环境变量中添加路径:

## BOOST
export BOOST_ROOT=/home/user/Downloads/boost_1_66_0
export BOOST_INCLUDE_DIR=${BOOST_ROOT}
export BOOST_LIBRARYDIR=${BOOST_ROOT}/stage/lib

字符串
这些都不起作用。当我尝试使用cd android && ./gradlew clean && cd ../构建应用程序时,我得到以下错误:

Could NOT find Boost (missing: Boost_INCLUDE_DIR)


下面是CMakeLists.txtBoost设置的样子:

set(Boost_USE_STATIC_LIBS OFF) 
set(Boost_USE_MULTITHREADED ON)  
set(Boost_USE_STATIC_RUNTIME OFF) 

find_package(Boost 1.45.0 COMPONENTS filesystem) 

if(Boost_FOUND)
    include_directories(${Boost_INCLUDE_DIRS}) 
    add_executable(progname file1.cxx file2.cxx) 
    target_link_libraries(progname ${Boost_LIBRARIES})
endif()


我错过了什么?我怎么才能修复它,让它工作?
先谢谢大家。

wsewodh2

wsewodh21#

有关如何在Android和Android Studio中使用Boost的详细说明,请访问:
https://stackoverflow.com/a/77662372/1756939
并解释了如何有效地调试findboost.cmake脚本。

相关问题