我一直在努力使用代码块16-01在我的Windows 10笔记本电脑上运行Boost编译库,例如Filesystem
我使用的简单基本代码如下
#include <iostream>
#include <string>
#include <boost/filesystem.hpp>
using namespace std;
int main ()
{
cout << "HEllo World" << endl;
cout << "Testing if \"C:\\Hello.txt\" exists" << endl;
boost::filesystem::path l_path("c:\\Hello.txt");
if ( boost::filesystem::exists(l_path) )
{
cout << "File does exist!" << endl;
}
else
{
cout << "File missing" << endl;
}
}
这给出了重建日志:
mingw32-g ++。exe -Wall -fexceptions -g -Weffc ++ -pedantic -Wextra -Wall -std = c ++ 11 -pg -g -I&#34; C:\ Program Files \ boost_1_61_0 \&#34; -c C:\ Users \ brend \ Dropbox \ PhD \ Code \ LBM \ testboost1 \ main.cpp -o obj \ Debug \ main.o
出现以下错误消息:
mingw32-g ++。exe:致命错误:没有输入文件
检查调试文件夹,没有创建main.o文件。
其他设置信息包括:Boost root是&#34; C:\ Program Files \ boost_1_61_0 \&#34; C :: B中指定的搜索目录包括 编译器:&#34; C:\ Program Files \ boost_1_61_0 \&#34; 链接器:&#34; C:\ Program Files \ boost_1_61_0 \ stage \ lib&#34;
我链接以下库:libboost_filesystem-mgw51-mt-d-1_61.a和libboost_system-mgw51-mt-d-1_61.a
我还尝试重新安装Code :: Blocks和MinGW无效。
非常感谢提前帮助!!