Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9257865
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T12:15:24+00:00 2026-06-18T12:15:24+00:00

From my terminal session: Go Trojans >make all g++ -static -I/usr/include/boost -I/usr/include/boost/filesystem get_sys_info.cpp /tmp/cc6nK9EV.o:

  • 0

From my terminal session:

Go Trojans >make all
g++ -static -I/usr/include/boost -I/usr/include/boost/filesystem get_sys_info.cpp
/tmp/cc6nK9EV.o: In function `__static_initialization_and_destruction_0(int, int)':
get_sys_info.cpp:(.text+0x13a): undefined reference to `boost::system::generic_category()'
get_sys_info.cpp:(.text+0x146): undefined reference to `boost::system::generic_category()'
get_sys_info.cpp:(.text+0x152): undefined reference to `boost::system::system_category()'
collect2: ld returned 1 exit status
make: *** [all] Error 1
Go Trojans >

The C++ code importing the Boost C++ Filesystem library:

#include <iostream>
#include <string>
#include <stdio.h>
#include <stdlib.h>

// Include Boost C++ libraries
#include <boost/filesystem.hpp>
using namespace boost::filesystem;


using namespace std;

int main() {
    string my_str = "This is a string.";

    cout << my_str << endl;
/*
    my_str = system("pwd");
    my_str.append("\b\b\b\b\b\b\b\b extra");
    cout << my_str << "a\b\b\b\b\b\b=" << endl;
*/

    path p(".");
    cout << p << "==" << endl;



    return 0;
}

Snippets from the Terminal session at the directory where my Boost C++ libraries are located.

Go Trojans >pwd
/usr/include/boost
Go Trojans >ls -al
total 1308
drwxr-xr-x  86 root root 12288 Jan 29 09:30 .
drwxr-xr-x 119 root root 20480 Feb  4 08:08 ..
...
drwxr-xr-x   5 root root  4096 Jan 29 09:30 filesystem
-rw-r--r--   1 root root  1340 Jan  5  2012 filesystem.hpp

How do I resolve the undefined references? Am I importing the Boost C++ Filesystem Library correctly? Am I also compiling the code correctly?

What are my mistakes? Can you please kindly help me?

Thank you very much, and have an awesome day! Ciao!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-18T12:15:26+00:00Added an answer on June 18, 2026 at 12:15 pm

    You need to use the -L/path/to/your/library in front of the call to -lboost_system which will tell the compiler where to find the shared object. However, even if you can compile the code, it will not run because the runtime cannot locate the file anyway, so you’re forced to update your path.

    I’m assuming you’re on a school computer so editing the LD_LIBRARY_PATH or utilizing /sbin/ldconfig are illegal.

    If they’re not illegal, you can either

    export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/path/to/boost

    in your ~/.bashrc or equivalent

    or you can

    touch /etc/ld.so.conf.d/boost.conf

    vi /etc/ld.so.conf/boost.conf

    put the path to your boost library in here and then save the file. Then run:

    /sbin/ldconfig

    Which reparses everything in /etc/ld.so.conf.d and will update your runtime paths.

    Good luck!

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Please see output from my terminal session sharpair:~$ /usr/bin/ctags usage: ctags [-BFadtuwvx] [-f tagsfile]
I'm using QWINSTA.EXE to get the session/user list from a terminal server on our
When I use emacs from a terminal (xterm-color; a putty ssh session in this
I was running a process from terminal in an SSH session and started the
Want to open firefox from terminal at linux with firebug enabled // Terminal $
How can I import a database with MySQL from terminal? the syntax from this
I'm trying to open a file in Openoffice from terminal and to automatically replace
From a terminal window: When I use the rm command it can only remove
I use terminal from Mac OS X Leopard to connect to remote Linux machines
I mostly use vim from the terminal by vi command. I want to create

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.