gpt4 book ai didi

c++ - mingw64 (win8.1) 如何让他看到boost libs?

转载 作者:太空宇宙 更新时间:2023-11-04 13:38:36 24 4
gpt4 key购买 nike

我已经安装了我的 win8.1 mingw,我想编译我的程序。当我使用命令时:

g++ -o test test.cpp -lboost_unit_test_framework-mt

我得到一个错误:

no such file od directory: 
"#include boost/test/unit_test.hpp" // in "<>" ofc.

当我使用我的 msVS 时,它工作正常。

最佳答案

您还必须使用 -L-I 选项来指定 boost 库和 header 所在的目录:

g++ -I<path_to_headers> -o test test.cpp -L<path_to_library> -lboost_unit_test_framework-mt

注意 header 路径应该是包含 boost 目录的路径。

关于c++ - mingw64 (win8.1) 如何让他看到boost libs?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28660198/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com