目录
为 CmakeLists.txt 添加 boost 组件
boost 具有很好的平台独立性, 因此会作为首选的 api 来完成特定的功能.
我在项目中使用了 boost 的 filesystem 功能来获取程序的运行目录.
#include <boost/filesystem/path.hpp>
#include <boost/filesystem/operations.hpp>
int main()
{
...
std::string exePath = boost::filesystem::initial_path<boost::filesystem::path>().string();
...
return 0;
}
但编译的时候提示如下错误:
In function `__static_initialization_and_destruction_0(int, int)':
proc