Ubuntu-14.04 [SOLVED]: C++ compiler cannot find Boost libraries even after installing them

Ubuntu-14.04 [SOLVED]: C++ compiler cannot find Boost libraries even after installing them

Home Forums Ubuntu 14.04 Ubuntu-14.04 [SOLVED]: C++ compiler cannot find Boost libraries even after installing them

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #34934

    Anonymous

    QuestionQuestion

    While compiling few test applications, I get the following error:

    g++: error: ?lboost_system: No such file or directory
    g++: error: ?lboost_filesystem: No such file or directory
    

    while running the following command:

    g++ -I/usr/include/boost/ -L/usr/lib/x86_64-linux-gnu/  aescuda.cpp -o test.o ?lboost_system ?lboost_filesystem
    

    The libraries are installed and present in location as shown below:

    <prompt>$ ll  /usr/lib/x86_64-linux-gnu/libboost_system.*
    -rw-r--r-- 1 root root 49178 Jun 20  2014 /usr/lib/x86_64-linux-gnu/libboost_system.a
    lrwxrwxrwx 1 root root    25 Jun 20  2014 /usr/lib/x86_64-linux-gnu/libboost_system.so -> libboost_system.so.1.54.0
    -rw-r--r-- 1 root root 14536 Jun 20  2014 /usr/lib/x86_64-linux-gnu/libboost_system.so.1.54.0
    <prompt>$ ll  /usr/lib/x86_64-linux-gnu/libboost_filesystem.*
    -rw-r--r-- 1 root root 217628 Jun 20  2014 /usr/lib/x86_64-linux-gnu/libboost_filesystem.a
    lrwxrwxrwx 1 root root     29 Jun 20  2014 /usr/lib/x86_64-linux-gnu/libboost_filesystem.so -> libboost_filesystem.so.1.54.0
    -rw-r--r-- 1 root root  88936 Jun 20  2014 /usr/lib/x86_64-linux-gnu/libboost_filesystem.so.1.54.0
    

    Can anyone suggest where am I going wrong 🙁

    #34935

    Anonymous

    Accepted AnswerAnswer

    You have a wrong character in front of the l:

    ?lboost_system
    

    It should be an ASCII hyphen:

    -lboost_system
    

    This causes the compiler driver to treat the whole string as an input file name (which obviously does not exist, hence the No such file or directory error), and not as an option to be passed to the linker.

    (Perhaps consider switching the terminal font.)

    Source: https://stackoverflow.com/questions/47538921/c-compiler-cannot-find-boost-libraries-even-after-installing-them
    Author: Florian Weimer
    Creative Commons License
    This work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License.

Viewing 2 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic.