• <bdo id='lRRIS'></bdo><ul id='lRRIS'></ul>

      <tfoot id='lRRIS'></tfoot>

      1. <i id='lRRIS'><tr id='lRRIS'><dt id='lRRIS'><q id='lRRIS'><span id='lRRIS'><b id='lRRIS'><form id='lRRIS'><ins id='lRRIS'></ins><ul id='lRRIS'></ul><sub id='lRRIS'></sub></form><legend id='lRRIS'></legend><bdo id='lRRIS'><pre id='lRRIS'><center id='lRRIS'></center></pre></bdo></b><th id='lRRIS'></th></span></q></dt></tr></i><div id='lRRIS'><tfoot id='lRRIS'></tfoot><dl id='lRRIS'><fieldset id='lRRIS'></fieldset></dl></div>

        <small id='lRRIS'></small><noframes id='lRRIS'>

        <legend id='lRRIS'><style id='lRRIS'><dir id='lRRIS'><q id='lRRIS'></q></dir></style></legend>
      2. C++ boost::filesystem 未定义引用`boost::filesystem3::path::root_n

        c++ boost::filesystem undefined reference to `boost::filesystem3::path::root_name() const#39;(C++ boost::filesystem 未定义引用`boost::filesystem3::path::root_name() const)

              <bdo id='fBSs8'></bdo><ul id='fBSs8'></ul>
              <tfoot id='fBSs8'></tfoot>

              <small id='fBSs8'></small><noframes id='fBSs8'>

                  <tbody id='fBSs8'></tbody>

              1. <legend id='fBSs8'><style id='fBSs8'><dir id='fBSs8'><q id='fBSs8'></q></dir></style></legend>
                • <i id='fBSs8'><tr id='fBSs8'><dt id='fBSs8'><q id='fBSs8'><span id='fBSs8'><b id='fBSs8'><form id='fBSs8'><ins id='fBSs8'></ins><ul id='fBSs8'></ul><sub id='fBSs8'></sub></form><legend id='fBSs8'></legend><bdo id='fBSs8'><pre id='fBSs8'><center id='fBSs8'></center></pre></bdo></b><th id='fBSs8'></th></span></q></dt></tr></i><div id='fBSs8'><tfoot id='fBSs8'></tfoot><dl id='fBSs8'><fieldset id='fBSs8'></fieldset></dl></div>
                • 本文介绍了C++ boost::filesystem 未定义引用`boost::filesystem3::path::root_name() const'的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  在尝试编译使用 boost::filesystem 库的代码时,我不断遇到错误.我不明白我得到的任何编译器输出.这是我从 http://www.highscore.de/cpp/boost/dateisystem.html# 复制的代码dateisystem_pfadangaben:

                  I keep running across errors when trying to compile code which utilizes the boost::filesystem library. I don't understand any of the compiler outputs I am getting. Here is my code copied from http://www.highscore.de/cpp/boost/dateisystem.html#dateisystem_pfadangaben:

                  #include <boost/filesystem.hpp>
                  #include <iostream>
                  
                  int main(){
                    boost::filesystem::path p("C:\Windows\System");
                    std::cout << p.root_name() << std::endl; 
                    std::cout << p.root_directory() << std::endl; 
                    std::cout << p.root_path() << std::endl; 
                    std::cout << p.relative_path() << std::endl; 
                    std::cout << p.parent_path() << std::endl; 
                    std::cout << p.filename() << std::endl; 
                  } 
                  

                  我有 Ubuntu 11.10 并且我已经安装了 libbost-dev 和 g++.这是终端的样子:

                  I have Ubuntu 11.10 and I have installed libbost-dev and g++. This is what the terminal looks like:

                  sam@sam-MT6707:~/Dokumente/Programming/Projekte/FTP-abgleicher$ g++ -o pr3 pr3.cpp
                  /tmp/ccrN7yHl.o: In function `main':
                  pr3.cpp:(.text+0x3b): undefined reference to `boost::filesystem3::path::root_name() const'
                  pr3.cpp:(.text+0x7e): undefined reference to `boost::filesystem3::path::root_directory() const'
                  pr3.cpp:(.text+0xc1): undefined reference to `boost::filesystem3::path::root_path() const'
                  pr3.cpp:(.text+0x104): undefined reference to `boost::filesystem3::path::relative_path() const'
                  pr3.cpp:(.text+0x147): undefined reference to `boost::filesystem3::path::parent_path() const'
                  pr3.cpp:(.text+0x18a): undefined reference to `boost::filesystem3::path::filename() const'
                  pr3.cpp:(.text+0x1e8): undefined reference to `boost::filesystem3::path::stem() const'
                  pr3.cpp:(.text+0x22b): undefined reference to `boost::filesystem3::path::extension() const'
                  
                  /tmp/ccrN7yHl.o: In function `__static_initialization_and_destruction_0(int, int)':
                  pr3.cpp:(.text+0x364): undefined reference to `boost::system::generic_category()'
                  pr3.cpp:(.text+0x36e): undefined reference to `boost::system::generic_category()'
                  pr3.cpp:(.text+0x378): undefined reference to `boost::system::system_category()'
                  /tmp/ccrN7yHl.o: In function `boost::filesystem3::path::codecvt()':
                  pr3.cpp:(.text._ZN5boost11filesystem34path7codecvtEv[boost::filesystem3::path::codecvt()]+0x7): undefined reference to `boost::filesystem3::path::wchar_t_codecvt_facet()'
                  collect2: ld gab 1 als Ende-Status zurück
                  
                  ^Translation of last line: ld returned an end status of 1
                  

                  我做错了什么?

                  推荐答案

                  您必须使用 -lboost_filesystem -lboost_system 链接.Boost 文件系统不是一个只有头文件的库;相反,它取决于编译的组件.

                  You have to link with -lboost_filesystem -lboost_system. Boost filesystem is not a header-only library; rather, it depends on compiled components.

                  这篇关于C++ boost::filesystem 未定义引用`boost::filesystem3::path::root_name() const'的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!

                  相关文档推荐

                  How to limit the number of running instances in C++(C++中如何限制运行实例的数量)
                  Using boost::asio::async_read with stdin?(将 boost::asio::async_read 与 stdin 一起使用?)
                  How to find out what dependencies (i.e other Boost libraries) a particular Boost library requires?(如何找出特定 Boost 库需要哪些依赖项(即其他 Boost 库)?)
                  What#39;s the purpose of a leading quot;::quot; in a C++ method call(引导“::的目的是什么?在 C++ 方法调用中)
                  Boost Spirit x3: parse into structs(Boost Spirit x3:解析为结构体)
                  How boost auto-linking makes choice?(boost自动链接如何做出选择?)
                  <tfoot id='gbYlb'></tfoot>

                  <i id='gbYlb'><tr id='gbYlb'><dt id='gbYlb'><q id='gbYlb'><span id='gbYlb'><b id='gbYlb'><form id='gbYlb'><ins id='gbYlb'></ins><ul id='gbYlb'></ul><sub id='gbYlb'></sub></form><legend id='gbYlb'></legend><bdo id='gbYlb'><pre id='gbYlb'><center id='gbYlb'></center></pre></bdo></b><th id='gbYlb'></th></span></q></dt></tr></i><div id='gbYlb'><tfoot id='gbYlb'></tfoot><dl id='gbYlb'><fieldset id='gbYlb'></fieldset></dl></div>

                  • <bdo id='gbYlb'></bdo><ul id='gbYlb'></ul>

                        <tbody id='gbYlb'></tbody>

                        <legend id='gbYlb'><style id='gbYlb'><dir id='gbYlb'><q id='gbYlb'></q></dir></style></legend>

                          1. <small id='gbYlb'></small><noframes id='gbYlb'>