std::experimental::filesystem::v1::status link error even after -lstdc++ flag












0















I try c++1z feature to use std::experimental::filesystem



After adding -lstdc++fs flag with g++, I can see that I am able to link std::experimental::filesystem::v1::__cxx11::path::_M_split_cmpts() with my program.



i.e I am not getting this error anymore




sdc.cpp:(.text+0x7e5): undefined reference to `std::experimental::filesystem::v1::__cxx11::path::_M_split_cmpts()'




However, even after linking, I get the following error.




g++ -std=c++1z timer.cpp -lstdc++fs -O2 -I include -L lib -lOpenTimer -lpthread -o timer.out
lib/libOpenTimer.a(spef.cpp.o): In function spef::Spef::read(std::experimental::filesystem::v1::__cxx11::path const&)':
spef.cpp:(.text._ZN4spef4Spef4readERKNSt12experimental10filesystem2v17__cxx114pathE[_ZN4spef4Spef4readERKNSt12experimental10filesystem2v17__cxx114pathE]+0x2e): undefined reference to
std::experimental::filesystem::v1::status(std::experimental::filesystem::v1::__cxx11::path const&)'
lib/libOpenTimer.a(sdc.cpp.o): In function ot::sdc::home[abi:cxx11]()':
sdc.cpp:(.text+0x414): undefined reference to
std::experimental::filesystem::v1::status(std::experimental::filesystem::v1::__cxx11::path const&)'
sdc.cpp:(.text+0x7ab): undefined reference to std::experimental::filesystem::v1::status(std::experimental::filesystem::v1::__cxx11::path const&)'
lib/libOpenTimer.a(sdc.cpp.o): In function
ot::sdc::SDC::read(std::experimental::filesystem::v1::__cxx11::path const&)':
sdc.cpp:(.text+0x2fa1): undefined reference to std::experimental::filesystem::v1::status(std::experimental::filesystem::v1::__cxx11::path const&)'
sdc.cpp:(.text+0x3084): undefined reference to
std::experimental::filesystem::v1::status(std::experimental::filesystem::v1::__cxx11::path const&)'
sdc.cpp:(.text+0x30db): undefined reference to std::experimental::filesystem::v1::current_path[abi:cxx11]()'
sdc.cpp:(.text+0x30f7): undefined reference to
std::experimental::filesystem::v1::absolute(std::experimental::filesystem::v1::__cxx11::path const&, std::experimental::filesystem::v1::__cxx11::path const&)'
sdc.cpp:(.text+0x3788): undefined reference to std::experimental::filesystem::v1::remove(std::experimental::filesystem::v1::__cxx11::path const&)'
lib/libOpenTimer.a(os.cpp.o): In function
ot::user_homeabi:cxx11':
os.cpp:(.text+0x30d): undefined reference to `std::experimental::filesystem::v1::current_pathabi:cxx11'
collect2: error: ld returned 1 exit status




Any help to resolve this would be much appreciated.










share|improve this question



























    0















    I try c++1z feature to use std::experimental::filesystem



    After adding -lstdc++fs flag with g++, I can see that I am able to link std::experimental::filesystem::v1::__cxx11::path::_M_split_cmpts() with my program.



    i.e I am not getting this error anymore




    sdc.cpp:(.text+0x7e5): undefined reference to `std::experimental::filesystem::v1::__cxx11::path::_M_split_cmpts()'




    However, even after linking, I get the following error.




    g++ -std=c++1z timer.cpp -lstdc++fs -O2 -I include -L lib -lOpenTimer -lpthread -o timer.out
    lib/libOpenTimer.a(spef.cpp.o): In function spef::Spef::read(std::experimental::filesystem::v1::__cxx11::path const&)':
    spef.cpp:(.text._ZN4spef4Spef4readERKNSt12experimental10filesystem2v17__cxx114pathE[_ZN4spef4Spef4readERKNSt12experimental10filesystem2v17__cxx114pathE]+0x2e): undefined reference to
    std::experimental::filesystem::v1::status(std::experimental::filesystem::v1::__cxx11::path const&)'
    lib/libOpenTimer.a(sdc.cpp.o): In function ot::sdc::home[abi:cxx11]()':
    sdc.cpp:(.text+0x414): undefined reference to
    std::experimental::filesystem::v1::status(std::experimental::filesystem::v1::__cxx11::path const&)'
    sdc.cpp:(.text+0x7ab): undefined reference to std::experimental::filesystem::v1::status(std::experimental::filesystem::v1::__cxx11::path const&)'
    lib/libOpenTimer.a(sdc.cpp.o): In function
    ot::sdc::SDC::read(std::experimental::filesystem::v1::__cxx11::path const&)':
    sdc.cpp:(.text+0x2fa1): undefined reference to std::experimental::filesystem::v1::status(std::experimental::filesystem::v1::__cxx11::path const&)'
    sdc.cpp:(.text+0x3084): undefined reference to
    std::experimental::filesystem::v1::status(std::experimental::filesystem::v1::__cxx11::path const&)'
    sdc.cpp:(.text+0x30db): undefined reference to std::experimental::filesystem::v1::current_path[abi:cxx11]()'
    sdc.cpp:(.text+0x30f7): undefined reference to
    std::experimental::filesystem::v1::absolute(std::experimental::filesystem::v1::__cxx11::path const&, std::experimental::filesystem::v1::__cxx11::path const&)'
    sdc.cpp:(.text+0x3788): undefined reference to std::experimental::filesystem::v1::remove(std::experimental::filesystem::v1::__cxx11::path const&)'
    lib/libOpenTimer.a(os.cpp.o): In function
    ot::user_homeabi:cxx11':
    os.cpp:(.text+0x30d): undefined reference to `std::experimental::filesystem::v1::current_pathabi:cxx11'
    collect2: error: ld returned 1 exit status




    Any help to resolve this would be much appreciated.










    share|improve this question

























      0












      0








      0








      I try c++1z feature to use std::experimental::filesystem



      After adding -lstdc++fs flag with g++, I can see that I am able to link std::experimental::filesystem::v1::__cxx11::path::_M_split_cmpts() with my program.



      i.e I am not getting this error anymore




      sdc.cpp:(.text+0x7e5): undefined reference to `std::experimental::filesystem::v1::__cxx11::path::_M_split_cmpts()'




      However, even after linking, I get the following error.




      g++ -std=c++1z timer.cpp -lstdc++fs -O2 -I include -L lib -lOpenTimer -lpthread -o timer.out
      lib/libOpenTimer.a(spef.cpp.o): In function spef::Spef::read(std::experimental::filesystem::v1::__cxx11::path const&)':
      spef.cpp:(.text._ZN4spef4Spef4readERKNSt12experimental10filesystem2v17__cxx114pathE[_ZN4spef4Spef4readERKNSt12experimental10filesystem2v17__cxx114pathE]+0x2e): undefined reference to
      std::experimental::filesystem::v1::status(std::experimental::filesystem::v1::__cxx11::path const&)'
      lib/libOpenTimer.a(sdc.cpp.o): In function ot::sdc::home[abi:cxx11]()':
      sdc.cpp:(.text+0x414): undefined reference to
      std::experimental::filesystem::v1::status(std::experimental::filesystem::v1::__cxx11::path const&)'
      sdc.cpp:(.text+0x7ab): undefined reference to std::experimental::filesystem::v1::status(std::experimental::filesystem::v1::__cxx11::path const&)'
      lib/libOpenTimer.a(sdc.cpp.o): In function
      ot::sdc::SDC::read(std::experimental::filesystem::v1::__cxx11::path const&)':
      sdc.cpp:(.text+0x2fa1): undefined reference to std::experimental::filesystem::v1::status(std::experimental::filesystem::v1::__cxx11::path const&)'
      sdc.cpp:(.text+0x3084): undefined reference to
      std::experimental::filesystem::v1::status(std::experimental::filesystem::v1::__cxx11::path const&)'
      sdc.cpp:(.text+0x30db): undefined reference to std::experimental::filesystem::v1::current_path[abi:cxx11]()'
      sdc.cpp:(.text+0x30f7): undefined reference to
      std::experimental::filesystem::v1::absolute(std::experimental::filesystem::v1::__cxx11::path const&, std::experimental::filesystem::v1::__cxx11::path const&)'
      sdc.cpp:(.text+0x3788): undefined reference to std::experimental::filesystem::v1::remove(std::experimental::filesystem::v1::__cxx11::path const&)'
      lib/libOpenTimer.a(os.cpp.o): In function
      ot::user_homeabi:cxx11':
      os.cpp:(.text+0x30d): undefined reference to `std::experimental::filesystem::v1::current_pathabi:cxx11'
      collect2: error: ld returned 1 exit status




      Any help to resolve this would be much appreciated.










      share|improve this question














      I try c++1z feature to use std::experimental::filesystem



      After adding -lstdc++fs flag with g++, I can see that I am able to link std::experimental::filesystem::v1::__cxx11::path::_M_split_cmpts() with my program.



      i.e I am not getting this error anymore




      sdc.cpp:(.text+0x7e5): undefined reference to `std::experimental::filesystem::v1::__cxx11::path::_M_split_cmpts()'




      However, even after linking, I get the following error.




      g++ -std=c++1z timer.cpp -lstdc++fs -O2 -I include -L lib -lOpenTimer -lpthread -o timer.out
      lib/libOpenTimer.a(spef.cpp.o): In function spef::Spef::read(std::experimental::filesystem::v1::__cxx11::path const&)':
      spef.cpp:(.text._ZN4spef4Spef4readERKNSt12experimental10filesystem2v17__cxx114pathE[_ZN4spef4Spef4readERKNSt12experimental10filesystem2v17__cxx114pathE]+0x2e): undefined reference to
      std::experimental::filesystem::v1::status(std::experimental::filesystem::v1::__cxx11::path const&)'
      lib/libOpenTimer.a(sdc.cpp.o): In function ot::sdc::home[abi:cxx11]()':
      sdc.cpp:(.text+0x414): undefined reference to
      std::experimental::filesystem::v1::status(std::experimental::filesystem::v1::__cxx11::path const&)'
      sdc.cpp:(.text+0x7ab): undefined reference to std::experimental::filesystem::v1::status(std::experimental::filesystem::v1::__cxx11::path const&)'
      lib/libOpenTimer.a(sdc.cpp.o): In function
      ot::sdc::SDC::read(std::experimental::filesystem::v1::__cxx11::path const&)':
      sdc.cpp:(.text+0x2fa1): undefined reference to std::experimental::filesystem::v1::status(std::experimental::filesystem::v1::__cxx11::path const&)'
      sdc.cpp:(.text+0x3084): undefined reference to
      std::experimental::filesystem::v1::status(std::experimental::filesystem::v1::__cxx11::path const&)'
      sdc.cpp:(.text+0x30db): undefined reference to std::experimental::filesystem::v1::current_path[abi:cxx11]()'
      sdc.cpp:(.text+0x30f7): undefined reference to
      std::experimental::filesystem::v1::absolute(std::experimental::filesystem::v1::__cxx11::path const&, std::experimental::filesystem::v1::__cxx11::path const&)'
      sdc.cpp:(.text+0x3788): undefined reference to std::experimental::filesystem::v1::remove(std::experimental::filesystem::v1::__cxx11::path const&)'
      lib/libOpenTimer.a(os.cpp.o): In function
      ot::user_homeabi:cxx11':
      os.cpp:(.text+0x30d): undefined reference to `std::experimental::filesystem::v1::current_pathabi:cxx11'
      collect2: error: ld returned 1 exit status




      Any help to resolve this would be much appreciated.







      g++ c++17






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Nov 24 '18 at 15:09









      BragadeeshBragadeesh

      11




      11
























          1 Answer
          1






          active

          oldest

          votes


















          0














          It was me who posted the question. It seems like I was able to resolve it myself.



          I added the -lstdc++fs at the end instead of middle and it started working.



          Here's the updated command




          g++ -std=c++1z timerapp.cpp -O2 -I include -L lib -lOpenTimer -lpthread -o timer.out -lstdc++fs




          compared to the previous command




          g++ -std=c++1z timerapp.cpp -lstdc++fs -O2 -I include -L lib -lOpenTimer -lpthread -o timer.out




          Don't know why some linking flags are expected to be added in the end though.






          share|improve this answer























            Your Answer






            StackExchange.ifUsing("editor", function () {
            StackExchange.using("externalEditor", function () {
            StackExchange.using("snippets", function () {
            StackExchange.snippets.init();
            });
            });
            }, "code-snippets");

            StackExchange.ready(function() {
            var channelOptions = {
            tags: "".split(" "),
            id: "1"
            };
            initTagRenderer("".split(" "), "".split(" "), channelOptions);

            StackExchange.using("externalEditor", function() {
            // Have to fire editor after snippets, if snippets enabled
            if (StackExchange.settings.snippets.snippetsEnabled) {
            StackExchange.using("snippets", function() {
            createEditor();
            });
            }
            else {
            createEditor();
            }
            });

            function createEditor() {
            StackExchange.prepareEditor({
            heartbeatType: 'answer',
            autoActivateHeartbeat: false,
            convertImagesToLinks: true,
            noModals: true,
            showLowRepImageUploadWarning: true,
            reputationToPostImages: 10,
            bindNavPrevention: true,
            postfix: "",
            imageUploader: {
            brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
            contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
            allowUrls: true
            },
            onDemand: true,
            discardSelector: ".discard-answer"
            ,immediatelyShowMarkdownHelp:true
            });


            }
            });














            draft saved

            draft discarded


















            StackExchange.ready(
            function () {
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53459491%2fstdexperimentalfilesystemv1status-link-error-even-after-lstdc-flag%23new-answer', 'question_page');
            }
            );

            Post as a guest















            Required, but never shown

























            1 Answer
            1






            active

            oldest

            votes








            1 Answer
            1






            active

            oldest

            votes









            active

            oldest

            votes






            active

            oldest

            votes









            0














            It was me who posted the question. It seems like I was able to resolve it myself.



            I added the -lstdc++fs at the end instead of middle and it started working.



            Here's the updated command




            g++ -std=c++1z timerapp.cpp -O2 -I include -L lib -lOpenTimer -lpthread -o timer.out -lstdc++fs




            compared to the previous command




            g++ -std=c++1z timerapp.cpp -lstdc++fs -O2 -I include -L lib -lOpenTimer -lpthread -o timer.out




            Don't know why some linking flags are expected to be added in the end though.






            share|improve this answer




























              0














              It was me who posted the question. It seems like I was able to resolve it myself.



              I added the -lstdc++fs at the end instead of middle and it started working.



              Here's the updated command




              g++ -std=c++1z timerapp.cpp -O2 -I include -L lib -lOpenTimer -lpthread -o timer.out -lstdc++fs




              compared to the previous command




              g++ -std=c++1z timerapp.cpp -lstdc++fs -O2 -I include -L lib -lOpenTimer -lpthread -o timer.out




              Don't know why some linking flags are expected to be added in the end though.






              share|improve this answer


























                0












                0








                0







                It was me who posted the question. It seems like I was able to resolve it myself.



                I added the -lstdc++fs at the end instead of middle and it started working.



                Here's the updated command




                g++ -std=c++1z timerapp.cpp -O2 -I include -L lib -lOpenTimer -lpthread -o timer.out -lstdc++fs




                compared to the previous command




                g++ -std=c++1z timerapp.cpp -lstdc++fs -O2 -I include -L lib -lOpenTimer -lpthread -o timer.out




                Don't know why some linking flags are expected to be added in the end though.






                share|improve this answer













                It was me who posted the question. It seems like I was able to resolve it myself.



                I added the -lstdc++fs at the end instead of middle and it started working.



                Here's the updated command




                g++ -std=c++1z timerapp.cpp -O2 -I include -L lib -lOpenTimer -lpthread -o timer.out -lstdc++fs




                compared to the previous command




                g++ -std=c++1z timerapp.cpp -lstdc++fs -O2 -I include -L lib -lOpenTimer -lpthread -o timer.out




                Don't know why some linking flags are expected to be added in the end though.







                share|improve this answer












                share|improve this answer



                share|improve this answer










                answered Nov 24 '18 at 15:39









                BragadeeshBragadeesh

                11




                11
































                    draft saved

                    draft discarded




















































                    Thanks for contributing an answer to Stack Overflow!


                    • Please be sure to answer the question. Provide details and share your research!

                    But avoid



                    • Asking for help, clarification, or responding to other answers.

                    • Making statements based on opinion; back them up with references or personal experience.


                    To learn more, see our tips on writing great answers.




                    draft saved


                    draft discarded














                    StackExchange.ready(
                    function () {
                    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53459491%2fstdexperimentalfilesystemv1status-link-error-even-after-lstdc-flag%23new-answer', 'question_page');
                    }
                    );

                    Post as a guest















                    Required, but never shown





















































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown

































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown







                    Popular posts from this blog

                    404 Error Contact Form 7 ajax form submitting

                    How to know if a Active Directory user can login interactively

                    TypeError: fit_transform() missing 1 required positional argument: 'X'