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 8077211
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T15:25:39+00:00 2026-06-05T15:25:39+00:00

As I am starting a project with boost lib, it seems my set-up isn’t

  • 0

As I am starting a project with boost lib, it seems my set-up isn’t working :

main.cpp :

#include <boost/asio.hpp>
int main(int argc, char* argv[])
{
    boost::asio::io_service io_service_;
    return 0;
}

Jamfile :

exe node
: main.cpp ;

bjam will produce :

...found 30 targets...
...updating 2 targets...
gcc.compile.c++ bin/gcc-4.7.0/debug/main.o
gcc.link bin/gcc-4.7.0/debug/node
bin/gcc-4.7.0/debug/main.o: In function `__static_initialization_and_destruction_0':
/usr/include/boost/system/error_code.hpp:214: undefined reference to `boost::system::generic_category()'
/usr/include/boost/system/error_code.hpp:215: undefined reference to `boost::system::generic_category()'
/usr/include/boost/system/error_code.hpp:216: undefined reference to `boost::system::system_category()'
bin/gcc-4.7.0/debug/main.o: In function `boost::system::error_code::error_code()':
/usr/include/boost/system/error_code.hpp:315: undefined reference to `boost::system::system_category()'
bin/gcc-4.7.0/debug/main.o: In function `boost::asio::error::get_system_category()':
/usr/include/boost/asio/error.hpp:216: undefined reference to `boost::system::system_category()'
bin/gcc-4.7.0/debug/main.o: In function `boost::asio::detail::posix_tss_ptr_create(unsigned int&)':
/usr/include/boost/asio/detail/impl/posix_tss_ptr.ipp:34: undefined reference to `pthread_key_create'
bin/gcc-4.7.0/debug/main.o: In function `boost::asio::detail::posix_tss_ptr<boost::asio::detail::call_stack<boost::asio::detail::task_io_service, boost::asio::detail::task_io_service::thread_info>::context>::~posix_tss_ptr()':
/usr/include/boost/asio/detail/posix_tss_ptr.hpp:48: undefined reference to `pthread_key_delete'
bin/gcc-4.7.0/debug/main.o: In function `boost::asio::detail::posix_tss_ptr<boost::asio::detail::call_stack<boost::asio::detail::strand_service::strand_impl, unsigned char>::context>::~posix_tss_ptr()':
/usr/include/boost/asio/detail/posix_tss_ptr.hpp:48: undefined reference to `pthread_key_delete'
collect2: error: ld returned 1 exit status

    "g++"    -o "bin/gcc-4.7.0/debug/node" -Wl,--start-group "bin/gcc-4.7.0/debug/main.o"  -Wl,-Bstatic  -Wl,-Bdynamic  -Wl,--end-group -g 


...failed gcc.link bin/gcc-4.7.0/debug/node...
...failed updating 1 target...
...updated 1 target...

It seems that bjam correctly find the header, but not the libs.
So I tried to tell bjam where to find boost :

Jamfile :

use-project /boost : /usr/lib/boost ;

exe node
    : main.cpp
      /boost//system
    ; 

But bjam will now produce :

/usr/share/boost-build/build/project.jam:270: in find-jamfile from module project
error: Unable to load Jamfile.
error: Could not find a Jamfile in directory '/usr/lib/boost'.
error: Attempted to find it with pattern '[Bb]uild.jam [Jj]amfile.v2 [Jj]amfile [Jj]amfile.jam'.
error: Please consult the documentation at 'http://www.boost.org'.
/usr/share/boost-build/build/project.jam:290: in load-jamfile from module project
/usr/share/boost-build/build/project.jam:68: in project.load from module project
/usr/share/boost-build/build/project.jam:718: in project.use from module project
/usr/share/boost-build/build/project.jam:94: in load-used-projects from module project
/usr/share/boost-build/build/project.jam:79: in load from module project
/usr/share/boost-build/build/project.jam:170: in project.find from module project
/usr/share/boost-build/build-system.jam:248: in load from module build-system
/usr/share/boost-build/kernel/modules.jam:261: in import from module modules
/usr/share/boost-build/kernel/bootstrap.jam:132: in boost-build from module
/usr/share/boost-build/boost-build.jam:1: in module scope from module

It unerstand that bjam want to rebuild boost, that’s why it’s looking for a Jamfile in /usr/lib/boost.

Is there anything missing ?
How could I tell bjam where are the missing libs to link against ?

Some times ago, I used

LINKLIBS = -lboost_system -lboost_filesystem ;

But I don’t know how to translate this for Boost.build v2.

Thanks.

  • 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-05T15:25:40+00:00Added an answer on June 5, 2026 at 3:25 pm

    Finally, I got the solution.
    I expected <linkflags> to be able to take more than one lib, but I was wrong.

    Here is the fix, I changed my Jamfile to :

    exe node
    : main.cpp
    : <linkflags>-lpthread
      <linkflags>-lboost_system
    ;
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am starting a new c++ project and I want to use Boost.Build /
I`m starting a project with backbone.js and as you know, my main problem was
I am starting a project which has several applications. These applications share some common
We are starting a project and our architet wants to use everything on standards
I am starting a project with MongoDB. I have my DB : mongo=null; try
I'm starting a project where I need to use OpenJPA 2.2 and run on
I'm starting a project that involves writing mailets for Apache James . As far
I'm starting new project. The client interface is based on GWT (and GXT) I
I am shortly starting a project, which requires messages to be held in a
I will be starting a project which requires communication between distributed nodes(the project is

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.