Error when installing libssh build with make install










0















OS and CMake prehistory



I'm trying to installlibssh on Debian GNU/Linux 9.5. I have successfully built the libssh source with cmake and put all the content inside build dir that I had created as advised in the install manual. (Note that I did not built the source with zlib as it is only optional) Note: There was no error when building the source with cmake.



Install Manual of libssh



Problem: Error with make install



The install manual now prompts you to install libssh by running




make install




in the build dir. Now if I do that I get the following error message:



[ 84%] Linking CXX executable libsshpp_noexcept
CMakeFiles/libsshpp_noexcept.dir/libsshpp_noexcept.cpp.o: In function `main':
libsshpp_noexcept.cpp:(.text+0xb2): undefined reference to `std::cout'
libsshpp_noexcept.cpp:(.text+0xb7): undefined reference to `std::basic_ostream<char, std::char_traits<char> >& std::operator<< <std::char_traits<char> >(std::basic_ostream<char, std::char_traits<char> >&, char const*)'
libsshpp_noexcept.cpp:(.text+0xcd): undefined reference to `std::cout'
libsshpp_noexcept.cpp:(.text+0xd2): undefined reference to `std::basic_ostream<char, std::char_traits<char> >& std::operator<< <std::char_traits<char> >(std::basic_ostream<char, std::char_traits<char> >&, char const*)'
libsshpp_noexcept.cpp:(.text+0xdc): undefined reference to `std::basic_ostream<char, std::char_traits<char> >& std::endl<char, std::char_traits<char> >(std::basic_ostream<char, std::char_traits<char> >&)'
libsshpp_noexcept.cpp:(.text+0xe7): undefined reference to `std::ostream::operator<<(std::ostream& (*)(std::ostream&))'
CMakeFiles/libsshpp_noexcept.dir/libsshpp_noexcept.cpp.o: In function `__static_initialization_and_destruction_0(int, int)':
libsshpp_noexcept.cpp:(.text+0x163): undefined reference to `std::ios_base::Init::Init()'
libsshpp_noexcept.cpp:(.text+0x178): undefined reference to `std::ios_base::Init::~Init()'
CMakeFiles/libsshpp_noexcept.dir/libsshpp_noexcept.cpp.o:(.data.DW.ref.__gxx_personality_v0[DW.ref.__gxx_personality_v0]+0x0): undefined reference to `__gxx_personality_v0'
collect2: error: ld returned 1 exit status
examples/CMakeFiles/libsshpp_noexcept.dir/build.make:96: recipe for target 'examples/libsshpp_noexcept' failed
make[2]: *** [examples/libsshpp_noexcept] Error 1
CMakeFiles/Makefile2:431: recipe for target 'examples/CMakeFiles/libsshpp_noexcept.dir/all' failed
make[1]: *** [examples/CMakeFiles/libsshpp_noexcept.dir/all] Error 2
Makefile:149: recipe for target 'all' failed
make: *** [all] Error 2


What is causing this issue and how can I resolve it?










share|improve this question


























    0















    OS and CMake prehistory



    I'm trying to installlibssh on Debian GNU/Linux 9.5. I have successfully built the libssh source with cmake and put all the content inside build dir that I had created as advised in the install manual. (Note that I did not built the source with zlib as it is only optional) Note: There was no error when building the source with cmake.



    Install Manual of libssh



    Problem: Error with make install



    The install manual now prompts you to install libssh by running




    make install




    in the build dir. Now if I do that I get the following error message:



    [ 84%] Linking CXX executable libsshpp_noexcept
    CMakeFiles/libsshpp_noexcept.dir/libsshpp_noexcept.cpp.o: In function `main':
    libsshpp_noexcept.cpp:(.text+0xb2): undefined reference to `std::cout'
    libsshpp_noexcept.cpp:(.text+0xb7): undefined reference to `std::basic_ostream<char, std::char_traits<char> >& std::operator<< <std::char_traits<char> >(std::basic_ostream<char, std::char_traits<char> >&, char const*)'
    libsshpp_noexcept.cpp:(.text+0xcd): undefined reference to `std::cout'
    libsshpp_noexcept.cpp:(.text+0xd2): undefined reference to `std::basic_ostream<char, std::char_traits<char> >& std::operator<< <std::char_traits<char> >(std::basic_ostream<char, std::char_traits<char> >&, char const*)'
    libsshpp_noexcept.cpp:(.text+0xdc): undefined reference to `std::basic_ostream<char, std::char_traits<char> >& std::endl<char, std::char_traits<char> >(std::basic_ostream<char, std::char_traits<char> >&)'
    libsshpp_noexcept.cpp:(.text+0xe7): undefined reference to `std::ostream::operator<<(std::ostream& (*)(std::ostream&))'
    CMakeFiles/libsshpp_noexcept.dir/libsshpp_noexcept.cpp.o: In function `__static_initialization_and_destruction_0(int, int)':
    libsshpp_noexcept.cpp:(.text+0x163): undefined reference to `std::ios_base::Init::Init()'
    libsshpp_noexcept.cpp:(.text+0x178): undefined reference to `std::ios_base::Init::~Init()'
    CMakeFiles/libsshpp_noexcept.dir/libsshpp_noexcept.cpp.o:(.data.DW.ref.__gxx_personality_v0[DW.ref.__gxx_personality_v0]+0x0): undefined reference to `__gxx_personality_v0'
    collect2: error: ld returned 1 exit status
    examples/CMakeFiles/libsshpp_noexcept.dir/build.make:96: recipe for target 'examples/libsshpp_noexcept' failed
    make[2]: *** [examples/libsshpp_noexcept] Error 1
    CMakeFiles/Makefile2:431: recipe for target 'examples/CMakeFiles/libsshpp_noexcept.dir/all' failed
    make[1]: *** [examples/CMakeFiles/libsshpp_noexcept.dir/all] Error 2
    Makefile:149: recipe for target 'all' failed
    make: *** [all] Error 2


    What is causing this issue and how can I resolve it?










    share|improve this question
























      0












      0








      0








      OS and CMake prehistory



      I'm trying to installlibssh on Debian GNU/Linux 9.5. I have successfully built the libssh source with cmake and put all the content inside build dir that I had created as advised in the install manual. (Note that I did not built the source with zlib as it is only optional) Note: There was no error when building the source with cmake.



      Install Manual of libssh



      Problem: Error with make install



      The install manual now prompts you to install libssh by running




      make install




      in the build dir. Now if I do that I get the following error message:



      [ 84%] Linking CXX executable libsshpp_noexcept
      CMakeFiles/libsshpp_noexcept.dir/libsshpp_noexcept.cpp.o: In function `main':
      libsshpp_noexcept.cpp:(.text+0xb2): undefined reference to `std::cout'
      libsshpp_noexcept.cpp:(.text+0xb7): undefined reference to `std::basic_ostream<char, std::char_traits<char> >& std::operator<< <std::char_traits<char> >(std::basic_ostream<char, std::char_traits<char> >&, char const*)'
      libsshpp_noexcept.cpp:(.text+0xcd): undefined reference to `std::cout'
      libsshpp_noexcept.cpp:(.text+0xd2): undefined reference to `std::basic_ostream<char, std::char_traits<char> >& std::operator<< <std::char_traits<char> >(std::basic_ostream<char, std::char_traits<char> >&, char const*)'
      libsshpp_noexcept.cpp:(.text+0xdc): undefined reference to `std::basic_ostream<char, std::char_traits<char> >& std::endl<char, std::char_traits<char> >(std::basic_ostream<char, std::char_traits<char> >&)'
      libsshpp_noexcept.cpp:(.text+0xe7): undefined reference to `std::ostream::operator<<(std::ostream& (*)(std::ostream&))'
      CMakeFiles/libsshpp_noexcept.dir/libsshpp_noexcept.cpp.o: In function `__static_initialization_and_destruction_0(int, int)':
      libsshpp_noexcept.cpp:(.text+0x163): undefined reference to `std::ios_base::Init::Init()'
      libsshpp_noexcept.cpp:(.text+0x178): undefined reference to `std::ios_base::Init::~Init()'
      CMakeFiles/libsshpp_noexcept.dir/libsshpp_noexcept.cpp.o:(.data.DW.ref.__gxx_personality_v0[DW.ref.__gxx_personality_v0]+0x0): undefined reference to `__gxx_personality_v0'
      collect2: error: ld returned 1 exit status
      examples/CMakeFiles/libsshpp_noexcept.dir/build.make:96: recipe for target 'examples/libsshpp_noexcept' failed
      make[2]: *** [examples/libsshpp_noexcept] Error 1
      CMakeFiles/Makefile2:431: recipe for target 'examples/CMakeFiles/libsshpp_noexcept.dir/all' failed
      make[1]: *** [examples/CMakeFiles/libsshpp_noexcept.dir/all] Error 2
      Makefile:149: recipe for target 'all' failed
      make: *** [all] Error 2


      What is causing this issue and how can I resolve it?










      share|improve this question














      OS and CMake prehistory



      I'm trying to installlibssh on Debian GNU/Linux 9.5. I have successfully built the libssh source with cmake and put all the content inside build dir that I had created as advised in the install manual. (Note that I did not built the source with zlib as it is only optional) Note: There was no error when building the source with cmake.



      Install Manual of libssh



      Problem: Error with make install



      The install manual now prompts you to install libssh by running




      make install




      in the build dir. Now if I do that I get the following error message:



      [ 84%] Linking CXX executable libsshpp_noexcept
      CMakeFiles/libsshpp_noexcept.dir/libsshpp_noexcept.cpp.o: In function `main':
      libsshpp_noexcept.cpp:(.text+0xb2): undefined reference to `std::cout'
      libsshpp_noexcept.cpp:(.text+0xb7): undefined reference to `std::basic_ostream<char, std::char_traits<char> >& std::operator<< <std::char_traits<char> >(std::basic_ostream<char, std::char_traits<char> >&, char const*)'
      libsshpp_noexcept.cpp:(.text+0xcd): undefined reference to `std::cout'
      libsshpp_noexcept.cpp:(.text+0xd2): undefined reference to `std::basic_ostream<char, std::char_traits<char> >& std::operator<< <std::char_traits<char> >(std::basic_ostream<char, std::char_traits<char> >&, char const*)'
      libsshpp_noexcept.cpp:(.text+0xdc): undefined reference to `std::basic_ostream<char, std::char_traits<char> >& std::endl<char, std::char_traits<char> >(std::basic_ostream<char, std::char_traits<char> >&)'
      libsshpp_noexcept.cpp:(.text+0xe7): undefined reference to `std::ostream::operator<<(std::ostream& (*)(std::ostream&))'
      CMakeFiles/libsshpp_noexcept.dir/libsshpp_noexcept.cpp.o: In function `__static_initialization_and_destruction_0(int, int)':
      libsshpp_noexcept.cpp:(.text+0x163): undefined reference to `std::ios_base::Init::Init()'
      libsshpp_noexcept.cpp:(.text+0x178): undefined reference to `std::ios_base::Init::~Init()'
      CMakeFiles/libsshpp_noexcept.dir/libsshpp_noexcept.cpp.o:(.data.DW.ref.__gxx_personality_v0[DW.ref.__gxx_personality_v0]+0x0): undefined reference to `__gxx_personality_v0'
      collect2: error: ld returned 1 exit status
      examples/CMakeFiles/libsshpp_noexcept.dir/build.make:96: recipe for target 'examples/libsshpp_noexcept' failed
      make[2]: *** [examples/libsshpp_noexcept] Error 1
      CMakeFiles/Makefile2:431: recipe for target 'examples/CMakeFiles/libsshpp_noexcept.dir/all' failed
      make[1]: *** [examples/CMakeFiles/libsshpp_noexcept.dir/all] Error 2
      Makefile:149: recipe for target 'all' failed
      make: *** [all] Error 2


      What is causing this issue and how can I resolve it?







      cmake gnu-make libssh






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Nov 14 '18 at 0:18









      pr0f3sspr0f3ss

      12




      12






















          1 Answer
          1






          active

          oldest

          votes


















          0














          Solution



          The libssh build has some example files inside ../libssh/build/examples on how to use the library. If you want to install libssh with make install, the Makefile2 inside ../libssh/build/CMakeFiles has specified that the example files are also compiled with your installation. Now the problem was that these example files have some errors inside, which is why the compilation/installation of libssh resolved in the error stated in the question above.



          Now to resolve this issue you have to delete the libsshpp_noexcept.dir and libsshpp.dir inside the ../libssh/build/examples/CMakeFiles folder. For the installation to succeed, you must also delete the corresponding lines of code in Makefile2 (inside ../libssh/build/CMakeFiles) that are responsible to compile these two example files. Open Makefile2 in your preferred texteditor and search for examples/CMakeFiles/libsshpp_noexcept.dir/build and examples/CMakeFiles/libsshpp.dir/build in the file. You now have to delete everything that checks and installs/compiles these two files/dirs. I deleted the following parts:




          #==================================================



          delete everything inside here



          ...



          #==================================================




          By deleting the content inside the seperators, you delete the installing/compilation procedure of the two (not necessary) example files provided by libssh.



          Now run make install inside ../libssh/build and you should be good to go.






          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%2f53291370%2ferror-when-installing-libssh-build-with-make-install%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














            Solution



            The libssh build has some example files inside ../libssh/build/examples on how to use the library. If you want to install libssh with make install, the Makefile2 inside ../libssh/build/CMakeFiles has specified that the example files are also compiled with your installation. Now the problem was that these example files have some errors inside, which is why the compilation/installation of libssh resolved in the error stated in the question above.



            Now to resolve this issue you have to delete the libsshpp_noexcept.dir and libsshpp.dir inside the ../libssh/build/examples/CMakeFiles folder. For the installation to succeed, you must also delete the corresponding lines of code in Makefile2 (inside ../libssh/build/CMakeFiles) that are responsible to compile these two example files. Open Makefile2 in your preferred texteditor and search for examples/CMakeFiles/libsshpp_noexcept.dir/build and examples/CMakeFiles/libsshpp.dir/build in the file. You now have to delete everything that checks and installs/compiles these two files/dirs. I deleted the following parts:




            #==================================================



            delete everything inside here



            ...



            #==================================================




            By deleting the content inside the seperators, you delete the installing/compilation procedure of the two (not necessary) example files provided by libssh.



            Now run make install inside ../libssh/build and you should be good to go.






            share|improve this answer



























              0














              Solution



              The libssh build has some example files inside ../libssh/build/examples on how to use the library. If you want to install libssh with make install, the Makefile2 inside ../libssh/build/CMakeFiles has specified that the example files are also compiled with your installation. Now the problem was that these example files have some errors inside, which is why the compilation/installation of libssh resolved in the error stated in the question above.



              Now to resolve this issue you have to delete the libsshpp_noexcept.dir and libsshpp.dir inside the ../libssh/build/examples/CMakeFiles folder. For the installation to succeed, you must also delete the corresponding lines of code in Makefile2 (inside ../libssh/build/CMakeFiles) that are responsible to compile these two example files. Open Makefile2 in your preferred texteditor and search for examples/CMakeFiles/libsshpp_noexcept.dir/build and examples/CMakeFiles/libsshpp.dir/build in the file. You now have to delete everything that checks and installs/compiles these two files/dirs. I deleted the following parts:




              #==================================================



              delete everything inside here



              ...



              #==================================================




              By deleting the content inside the seperators, you delete the installing/compilation procedure of the two (not necessary) example files provided by libssh.



              Now run make install inside ../libssh/build and you should be good to go.






              share|improve this answer

























                0












                0








                0







                Solution



                The libssh build has some example files inside ../libssh/build/examples on how to use the library. If you want to install libssh with make install, the Makefile2 inside ../libssh/build/CMakeFiles has specified that the example files are also compiled with your installation. Now the problem was that these example files have some errors inside, which is why the compilation/installation of libssh resolved in the error stated in the question above.



                Now to resolve this issue you have to delete the libsshpp_noexcept.dir and libsshpp.dir inside the ../libssh/build/examples/CMakeFiles folder. For the installation to succeed, you must also delete the corresponding lines of code in Makefile2 (inside ../libssh/build/CMakeFiles) that are responsible to compile these two example files. Open Makefile2 in your preferred texteditor and search for examples/CMakeFiles/libsshpp_noexcept.dir/build and examples/CMakeFiles/libsshpp.dir/build in the file. You now have to delete everything that checks and installs/compiles these two files/dirs. I deleted the following parts:




                #==================================================



                delete everything inside here



                ...



                #==================================================




                By deleting the content inside the seperators, you delete the installing/compilation procedure of the two (not necessary) example files provided by libssh.



                Now run make install inside ../libssh/build and you should be good to go.






                share|improve this answer













                Solution



                The libssh build has some example files inside ../libssh/build/examples on how to use the library. If you want to install libssh with make install, the Makefile2 inside ../libssh/build/CMakeFiles has specified that the example files are also compiled with your installation. Now the problem was that these example files have some errors inside, which is why the compilation/installation of libssh resolved in the error stated in the question above.



                Now to resolve this issue you have to delete the libsshpp_noexcept.dir and libsshpp.dir inside the ../libssh/build/examples/CMakeFiles folder. For the installation to succeed, you must also delete the corresponding lines of code in Makefile2 (inside ../libssh/build/CMakeFiles) that are responsible to compile these two example files. Open Makefile2 in your preferred texteditor and search for examples/CMakeFiles/libsshpp_noexcept.dir/build and examples/CMakeFiles/libsshpp.dir/build in the file. You now have to delete everything that checks and installs/compiles these two files/dirs. I deleted the following parts:




                #==================================================



                delete everything inside here



                ...



                #==================================================




                By deleting the content inside the seperators, you delete the installing/compilation procedure of the two (not necessary) example files provided by libssh.



                Now run make install inside ../libssh/build and you should be good to go.







                share|improve this answer












                share|improve this answer



                share|improve this answer










                answered Nov 15 '18 at 22:47









                pr0f3sspr0f3ss

                12




                12



























                    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%2f53291370%2ferror-when-installing-libssh-build-with-make-install%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







                    這個網誌中的熱門文章

                    How to read a connectionString WITH PROVIDER in .NET Core?

                    In R, how to develop a multiplot heatmap.2 figure showing key labels successfully

                    Museum of Modern and Contemporary Art of Trento and Rovereto