Menu

About executing itpp programs

Help
ELMEHDI
2015-03-27
2018-11-19
  • ELMEHDI

    ELMEHDI - 2015-03-27

    Hello everyone.

    I'm new at Linux environment developpment, I just installed itpp library on my ubuntu 13.10 following these commands :

    $cd build
    $cmake ..
    $make
    $make install

    As I'm not very good at linux environment development, I want to know how to compile and execute a c++ itpp program because I tried '$g++ test.cpp -o test', a 'undefined reference to...' error appears.

    please help me with commands to compile and run my programs.

     
  • Bogdan Cristea

    Bogdan Cristea - 2015-03-27

    Hi

    You need to compile by providing the path to the header file and the IT++ library with its path:

    g++ test.cpp -o test -I/usr/local/include -L/usr/local/lib -litpp

    regards
    Bogdan

     
  • ELMEHDI

    ELMEHDI - 2015-03-27

    Hello Bogdan.
    First of all thanks for your solution.
    When I tried your command there was no error such 'undefined reference to', but when I try to run it by './test' another error appears :

    ./test: error while loading shared libraries: libitpp.so.8: cannot open shared object file: No such file or directory

    how can I deal with this situation ?

    And thanks.

     
  • Bogdan Cristea

    Bogdan Cristea - 2015-03-27

    Check the path where you installed IT++ library: either /usr/local/lib or /usr/lib and the installed libraries

     
  • ELMEHDI

    ELMEHDI - 2015-03-27

    In /usr/local/lib there is 3 files "libitpp.so.8.2.1", "libitpp.so.8" and "libitpp.so", I think these should be the library files ?

    that's a problem, Whenever I try to run m program (./test) the same error appears !

     
  • Bogdan Cristea

    Bogdan Cristea - 2015-03-27

    do as root

    ldconfig /usr/local/lib

    then restart your terminal

     
    • Yunhong Xu

      Yunhong Xu - 2015-08-21

      It works for me, thanks a lot.

       
    • Ahmed Shahein

      Ahmed Shahein - 2018-11-18

      Hi,
      I am sorry for bothering again. I am getting exactly the same error message. I have done all the steps in the thread. I don't get any compilation errors but I get the error when I execute the output file:

      error while loading shared libraries: libitpp.so.8: cannot open shared object file: No such file or directory

      I tried both commands, and I get the same error message with both.
      g++ exp_itpp.cpp -I$ITPP_HOME/include -L$ITPP_HOME/lib -litpp
      g++ itpp-config --cflags -o example exp_itpp.cpp itpp-config --libs

      How can I overcome this issue?

      Thanks in advance.

       
      • Bogdan Cristea

        Bogdan Cristea - 2018-11-18

        you need to set the library search path to the location where libitpp.so is installed: use either LD_LIBRARY_PATH or ldconfig application

         
        • Ahmed Shahein

          Ahmed Shahein - 2018-11-19

          Done, working fine at last.
          Many many thanks.
          Regards.

           
  • ELMEHDI

    ELMEHDI - 2015-03-27

    thanks so much my friend, it seems that it's working properly, even if there is some programs having some issues but the essential that some of them works at least.

    Best Regards.

    Elmehdi

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.