如何使用提升获取当前文件路径?

How can I get current file path using boost?

本文关键字:文件 路径 获取 何使用      更新时间:2023-10-16

如何使用boost获取当前文件路径?就像在.cpp一样,我可以得到

/home/src/a.cpp

我可以使用_FILE_宏来获取此内容,但由于某种原因,我无法使用_FILE_

有什么想法吗?

我想你正在寻找

#include <boost/filesystem.hpp>
boost::filesystem::path full_path(boost::filesystem::current_path());

auto p = boost::filesystem::current_path()