【发布时间】:2019-07-03 23:20:46
【问题描述】:
我收到关于缺少 boost 文件的错误,但据我所知,我已经通过 YAST (OpenSUSE) 安装了它们。但是,我仍然收到错误。我需要帮助解决这个问题。
当从 YAST 包安装不起作用时,我从源代码安装了 boost。它仍然没有工作。我安装了 boost-1.70.0
/usr/lib64/gcc/x86_64-suse-linux/7/../../../../x86_64-suse-linux/bin/ld: cannot find -lboost_date_time
/usr/lib64/gcc/x86_64-suse-linux/7/../../../../x86_64-suse-linux/bin/ld: cannot find -lboost_filesystem
/usr/lib64/gcc/x86_64-suse-linux/7/../../../../x86_64-suse-linux/bin/ld: cannot find -lboost_system
/usr/lib64/gcc/x86_64-suse-linux/7/../../../../x86_64-suse-linux/bin/ld: cannot find -lboost_regex
collect2: error: ld returned 1 exit status
make: *** [/home/hafiz/OpenFOAM/OpenFOAM-6/wmake/makefiles/general:142: /home/hafiz/OpenFOAM/hafiz-6/platforms/linux64GccDPInt64Opt/bin/laminarBuoyantSimpleSMOKE] Error 1
我希望通过源代码安装 boost,这个错误会得到解决,但它仍然存在。 boost 编译成功,如此处所述:
...updated 184 targets...
The Boost C++ Libraries were successfully built!
The following directory should be added to compiler include paths:
/home/hafiz/Softwares/boost/boost_1_70_0
The following directory should be added to linker library paths:
/home/hafiz/Softwares/boost/boost_1_70_0/stage/lib
我不确定编译器包含路径和链接器库路径是否会自动添加。请帮助解决这个问题!谢谢
【问题讨论】:
-
如您的 boost 安装输出中所述,您需要告诉编译器在哪里可以找到 boost 包含和库目录。
-
@AlexHodges 我该如何设置路径?
-
@hphys 这取决于您的编译器。你用的是哪一个?
-
@Chipster 我正在使用 GNU 编译器
-
当这些消息说“应该添加”时,意思是你应该添加。 (该消息并不意味着“发生了表明添加已完成的事情”——在这种情况下,该工具会检查并报告成功或失败,而不是胡思乱想。)
标签: openfoam