Boost文件系统教程将无法编译

Boost文件系统教程将无法编译

本文介绍了Boost文件系统教程将无法编译的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我尝试编译boost文件系统 in Code :: Blocks
出现这些错误

I try to compile the boost filesystem tutorial in Code::BlocksAnd it comes up these errors

Linking console executable: bin\Debug\Boost fs tut1.exe
obj\Debug\main.o: In function `_static_initialization_and_destruction_0':
D:/Documents/Coding/Libs/boost/boost/system/error_code.hpp:214: undefined reference to `boost::system::generic_category()'
D:/Documents/Coding/Libs/boost/boost/system/error_code.hpp:215: undefined reference to `boost::system::generic_category()'
D:/Documents/Coding/Libs/boost/boost/system/error_code.hpp:216: undefined reference to `boost::system::system_category()'
obj\Debug\main.o: In function `ZN5boost11filesystem34path7codecvtEv':
D:/Documents/Coding/Libs/boost/boost/filesystem/v3/path.hpp:388: undefined reference to `boost::filesystem3::path::wchar_t_codecvt_facet()'
obj\Debug\main.o: In function `convert':
D:/Documents/Coding/Libs/boost/boost/filesystem/v3/path_traits.hpp:113: undefined reference to `boost::filesystem3::path_traits::convert(char const*, char const*, std::basic_string<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> >&, std::codecvt<wchar_t, char, int> const&)'
obj\Debug\main.o: In function `file_size':
D:/Documents/Coding/Libs/boost/boost/filesystem/v3/operations.hpp:366: undefined reference to `boost::filesystem3::detail::file_size(boost::filesystem3::path const&, boost::system::error_code*)'
collect2: ld returned 1 exit status
Process terminated with status 1 (0 minutes, 0 seconds)
6 errors, 0 warnings

我在Windows 7上使用Code :: Blocks版本10.5,G ++版本4.4.1和boost版本1.47运行它

I'm running it on windows 7 with Code::Blocks version 10.5, G++ version 4.4.1, and boost version 1.47

推荐答案

p> Boost.System的一个块位于一个单独构建的库中。它不是所有的头文件。您必须建立它并链接到它。

A chunk of Boost.System lives in a library that is built seperately. It is not all header files. You have to build it and link to it.

请参阅一个例子(linux)和(CodeBlocks)

See Problem Linking Boost Library in Linux for one example (linux) and http://wiki.codeblocks.org/index.php?title=BoostWindowsQuickRef (CodeBlocks)

希望这有助于!

这篇关于Boost文件系统教程将无法编译的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-20 11:27