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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T18:53:04+00:00 2026-05-23T18:53:04+00:00

I installed boost using macports. The files appear to be in /opt/local/include/boost/ My makefile

  • 0

I installed boost using macports. The files appear to be in /opt/local/include/boost/

My makefile is no longer working and I get the following error

Undefined symbols:
"boost::system::generic_category()", referenced from:
  __static_initialization_and_destruction_0(int, int)in client.o
  __static_initialization_and_destruction_0(int, int)in client.o
"boost::system::system_category()", referenced from:
  boost::asio::error::get_system_category()    in client.o
  boost::system::error_code::error_code()in client.o
  __static_initialization_and_destruction_0(int, int)in client.o
ld: symbol(s) not found
collect2: ld returned 1 exit status
make: *** [client] Error 1

at school the solution was to use -lboost_system as an argument to g++, but now that I’ve taken the project home to my mac, this does not work. I think this is mostly due to the fact that at school the boost files were at usr/local/lib (or somewhere similar).

When I add the -lboost_system argument i get the following message

g++ -I/opt/local/include -lboost_system -o client client.o Packet.o
ld: library not found for -lboost_system
collect2: ld returned 1 exit status
make: *** [client] Error 1

I’ve tried a few variations using -L and -l, but I can’t seem to find a combo that works. At school I also do not have to use -L. I’ve read a few other posts here about similar problems, but they fixed it by adding -l flags which arent working for me.

Help! 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-05-23T18:53:05+00:00Added an answer on May 23, 2026 at 6:53 pm

    You’re missing a -L/opt/local/lib. You should be able to set the LDFLAGS in your Makefile:

    LDFLAGS=-L/opt/local/lib
    

    This assumes that the Boost libraries are in /opt/local/lib of course.

    If you’re not using the usual CXXFLAGS and LDFLAGS variables in your Makefile, then add the -L/opt/local/lib directly in your final rule:

    client: client.o Packet.o
        g++ -L/opt/local/lib -o client client.o Packet.o -lboost_system
    

    The -I only tells the compiler where header files are, the linker needs libraries and you use -L for that.

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

Sidebar

Related Questions

I just installed boost 1.42.0 from macports using sudo port install boost . Everything
I'm trying setup a subset of boost and get it properly compiled using bjam,
After installing Boost library using Synaptic Package Manager, the version installed is 1.42 .
I've almost completely installed Boost, but I have a problem with how to set
I have just installed boost for the first time on my Intel Mac, and
I'm quite new to using boost and I can't seem to find documentation anywhere
I'm using boost for several C++ projects. I recently made a upgrade (1.33.1 to
I'm using boost::function to enable the passing of a function to a Button constructor
im just installing the boost library using an installer. Its asking me which variants
I'm using boost.process (additional lib for boost). At the page I gave for the

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.