#include <iostream>
#include <boost/filesystem.hpp>
using namespace boost::filesystem;
int main(int argc, char* argv[])
{
if (argc < 2)
{
std::cout << "Usage: tut1 path\n";
return 1;
}
std::cout << argv[1] << " " << file_size(argv[1]) << '\n';
return 0;
}
上面是带有boost的代码块中的简单代码
由于我是新手,要增强并链接到代码块,所以我都在编译b2等附加的lib文件等错误的地方
和谐是我的项目名称和cpp文件
我不了解\杂散错误以及如何纠正和摆脱该错误
如hpp文件中所示,请提供帮助
出现错误
||=== Build: Debug in harmonious (compiler: GNU GCC Compiler) ===|
:0|2|warning: missing whitespace after the macro name|
C:\boost_1_68_0\boost\mpl\if.hpp|30|error: stray '\' in program|
C:\boost_1_68_0\boost\mpl\eval_if.hpp|27|error: stray '\' in program|
C:\boost_1_68_0\boost\mpl\eval_if.hpp|37|error: stray '\' in program|
C:\boost_1_68_0\boost\mpl\eval_if.hpp|49|error: stray '\' in program|
C:\boost_1_68_0\boost\mpl\eval_if.hpp|59|error: stray '\' in program|
C:\boost_1_68_0\boost\mpl\assert.hpp|79|error: stray '\' in program|
C:\boost_1_68_0\boost\mpl\assert.hpp|82|error: stray '\' in program|
C:\boost_1_68_0\boost\mpl\assert.hpp|83|error: stray '\' in program|
C:\boost_1_68_0\boost\mpl\assert.hpp|85|error: stray '\' in program|
C:\boost_1_68_0\boost\range\range_fwd.hpp|17|error: stray '\' in program|
C:\boost_1_68_0\boost\range\range_fwd.hpp|20|error: stray '\' in program|
C:\boost_1_68_0\boost\range\range_fwd.hpp|23|error: stray '\' in program|
C:\boost_1_68_0\boost\range\mutable_iterator.hpp|37|error: stray '\' in program|
C:\boost_1_68_0\boost\range\mutable_iterator.hpp|37|error: stray '\' in program|
C:\boost_1_68_0\boost\range\mutable_iterator.hpp|37|error: stray '\' in program|
C:\boost_1_68_0\boost\range\mutable_iterator.hpp|37|error: stray '\' in program|
C:\boost_1_68_0\boost\range\mutable_iterator.hpp|37|error: stray '\' in program|
C:\boost_1_68_0\boost\range\mutable_iterator.hpp|39|error: stray '\' in program|
C:\boost_1_68_0\boost\range\mutable_iterator.hpp|42|error: stray '\' in program|
C:\boost_1_68_0\boost\range\mutable_iterator.hpp|67|error: stray '\' in program|
C:\boost_1_68_0\boost\range\mutable_iterator.hpp|70|error: stray '\' in program|
C:\boost_1_68_0\boost\range\const_iterator.hpp|36|error: stray '\' in program|
C:\boost_1_68_0\boost\range\const_iterator.hpp|36|error: stray '\' in program|
C:\boost_1_68_0\boost\range\const_iterator.hpp|36|error: stray '\' in program|
C:\boost_1_68_0\boost\range\const_iterator.hpp|36|error: stray '\' in program|
C:\boost_1_68_0\boost\range\const_iterator.hpp|36|error: stray '\' in program|
C:\boost_1_68_0\boost\range\const_iterator.hpp|38|error: stray '\' in program|
C:\boost_1_68_0\boost\range\const_iterator.hpp|40|error: stray '\' in program|
C:\boost_1_68_0\boost\range\const_iterator.hpp|65|error: stray '\' in program|
C:\boost_1_68_0\boost\range\const_iterator.hpp|68|error: stray '\' in program|
C:\boost_1_68_0\boost\system\error_code.hpp|280|warning: 'class boost::system::error_category::std_category' has pointer data members [-Weffc++]|
C:\boost_1_68_0\boost\system\error_code.hpp|280|warning: but does not override 'boost::system::error_category::std_category(const boost::system::error_category::std_category&)' [-Weffc++]|
C:\boost_1_68_0\boost\system\error_code.hpp|280|warning: or 'operator=(const boost::system::error_category::std_category&)' [-Weffc++]|
C:\boost_1_68_0\boost\system\system_error.hpp||In constructor 'boost::system::system_error::system_error(boost::system::error_code)':|
C:\boost_1_68_0\boost\system\system_error.hpp|27|warning: 'boost::system::system_error::m_what' should be initialized in the member initialization list [-Weffc++]|
C:\boost_1_68_0\boost\system\system_error.hpp||In constructor 'boost::system::system_error::system_error(boost::system::error_code, const string&)':|
C:\boost_1_68_0\boost\system\system_error.hpp|30|warning: 'boost::system::system_error::m_what' should be initialized in the member initialization list [-Weffc++]|
C:\boost_1_68_0\boost\system\system_error.hpp||In constructor 'boost::system::system_error::system_error(boost::system::error_code, const char*)':|
C:\boost_1_68_0\boost\system\system_error.hpp|33|warning: 'boost::system::system_error::m_what' should be initialized in the member initialization list [-Weffc++]|
C:\boost_1_68_0\boost\system\system_error.hpp||In constructor 'boost::system::system_error::system_error(int, const boost::system::error_category&)':|
C:\boost_1_68_0\boost\system\system_error.hpp|36|warning: 'boost::system::system_error::m_what' should be initialized in the member initialization list [-Weffc++]|
C:\boost_1_68_0\boost\system\system_error.hpp||In constructor 'boost::system::system_error::system_error(int, const boost::system::error_category&, const string&)':|
C:\boost_1_68_0\boost\system\system_error.hpp|39|warning: 'boost::system::system_error::m_what' should be initialized in the member initialization list [-Weffc++]|
C:\boost_1_68_0\boost\system\system_error.hpp||In constructor 'boost::system::system_error::system_error(int, const boost::system::error_category&, const char*)':|
C:\boost_1_68_0\boost\system\system_error.hpp|43|warning: 'boost::system::system_error::m_what' should be initialized in the member initialization list [-Weffc++]|
:0|2|error: expected '>' before ':' token|
C:\boost_1_68_0\boost\mpl\if.hpp|30|note: in expansion of macro 'C'|
C:\boost_1_68_0\boost\mpl\if.hpp|36|error: 'T1' does not name a type|
C:\boost_1_68_0\boost\mpl\if.hpp|43|error: wrong number of template arguments (3, should be 1)|
C:\boost_1_68_0\boost\mpl\if.hpp|34|note: provided for 'template<bool <anonymous> > struct boost::mpl::if_c'|
C:\boost_1_68_0\boost\mpl\if.hpp|67|error: wrong number of template arguments (3, should be 1)|
C:\boost_1_68_0\boost\mpl\if.hpp|34|note: provided for 'template<bool <anonymous> > struct boost::mpl::if_c'|
C:\boost_1_68_0\boost\mpl\if.hpp|70|error: 'almost_type_' is not a class or namespace|
:0|2|error: expected nested-name-specifier before ':' token|
C:\boost_1_68_0\boost\mpl\aux_\na_spec.hpp|152|note: in definition of macro 'BOOST_MPL_AUX_NA_PARAM'|
C:\boost_1_68_0\boost\mpl\eval_if.hpp|27|note: in expansion of macro 'C'|
:0|2|error: expected '>' before ':' token|
C:\boost_1_68_0\boost\mpl\aux_\na_spec.hpp|152|note: in definition of macro 'BOOST_MPL_AUX_NA_PARAM'|
C:\boost_1_68_0\boost\mpl\eval_if.hpp|27|note: in expansion of macro 'C'|
C:\boost_1_68_0\boost\mpl\eval_if.hpp|37|error: template argument 1 is invalid|
C:\boost_1_68_0\boost\mpl\eval_if.hpp|37|error: expected nested-name-specifier|
C:\boost_1_68_0\boost\mpl\eval_if.hpp|37|error: typedef name may not be a nested-name-specifier|
C:\boost_1_68_0\boost\mpl\eval_if.hpp|37|error: expected ';' at end of member declaration|
C:\boost_1_68_0\boost\mpl\eval_if.hpp|37|error: 'f_' does not name a type|
C:\boost_1_68_0\boost\mpl\eval_if.hpp|38|error: 'f_' has not been declared|
C:\boost_1_68_0\boost\mpl\eval_if.hpp|38|error: redeclaration of 'typedef int boost::mpl::eval_if<<anonymous> >::type'|
C:\boost_1_68_0\boost\mpl\eval_if.hpp|37|note: previous declaration 'typedef<typeprefixerror> boost::mpl::eval_if<<anonymous> >::type'|
:0|2|error: expected '>' before ':' token|
C:\boost_1_68_0\boost\mpl\eval_if.hpp|49|note: in expansion of macro 'C'|
C:\boost_1_68_0\boost\mpl\eval_if.hpp|59|error: template argument 1 is invalid|
C:\boost_1_68_0\boost\mpl\eval_if.hpp|59|error: expected nested-name-specifier|
C:\boost_1_68_0\boost\mpl\eval_if.hpp|59|error: typedef name may not be a nested-name-specifier|
C:\boost_1_68_0\boost\mpl\eval_if.hpp|59|error: expected ';' at end of member declaration|
C:\boost_1_68_0\boost\mpl\eval_if.hpp|59|error: 'f_' does not name a type|
||More errors follow but not being shown.|
||Edit the max errors limit in compiler options...|
||=== Build failed: 50 error(s), 10 warning(s) (0 minute(s), 1 second(s)) ===|