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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T12:37:01+00:00 2026-06-02T12:37:01+00:00

I am using the following structure for a Makefile: OBJECTS := time.o PROGRAM :=

  • 0

I am using the following structure for a Makefile:

OBJECTS := time.o
PROGRAM := time
CPPFLAGS += -Iusr/include/boost_1_49_0 -Lusr/include/boost_1_49_0/stage/lib
CXXFLAGS := -Wall -ggdb3
LDFLAGS += -lboost_date_time
$(PROGRAM) : $(OBJECTS)
g++ -o time time.cpp

clean :
rm $(PROGRAM) $(OBJECTS)

But when I enter make, it gives me lots of errors – including:

undefined reference to `boost::gregorian::greg_month::as_short_string() const' time.cpp:
(.text._ZN5boost9date_time15month_formatterINS_9gregorian10greg_monthENS0_13simple_formatIcEEcE12format_monthERKS3_RSo[boost::date_time::month_formatter<boost::gregorian::greg_month, boost::date_time::simple_format<char>, char>::format_month(boost::gregorian::greg_month const&, std::basic_ostream<char, std::char_traits<char> >&)]+0x56):
    undefined reference to `boost::gregorian::greg_month::as_long_string() const'
collect2: ld returned 1 exit status

When I use g++ -Wall -Iusr/include/boost_1_49_0 -Lusr/include/boost_1_49_0/stage/lib -o time time.cpp -lboost_date_time, the code compiles fine so something is wrong with my Makefile. Please help. Note: I tried placing the -L <directory> flag in the LDFLAG variable but that didn’t work either.

  • 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-02T12:37:04+00:00Added an answer on June 2, 2026 at 12:37 pm

    LDFLAGS is not used in your Makefile – neither directly nor implicit via built-in rules. The following should work:

    $(PROGRAM): $(OBJECTS)
        $(CXX) $(LDFLAGS) $(TARGET_ARCH) $^ $(LOADLIBES) $(LDLIBS) -o $@ 
    

    make is a powerful tool. However, it is not trivial to use. If you are not forced to use make, I suggest taking a closer look at alternatives. Personally, I recommend the usage of bjam/boost-build. Here is an example for a simple Jamroot:

    project
        : requirements <cflags>-Wall <cflags>-ggdb3
        ;
    
    using gcc ;
    
    lib boost_date_time
        :
        : <search>/usr/include/boost_1_49_0/stage/lib
        :
        : <include>/usr/include/boost_1_49_0
        ;
    
    exe time
        : time.cpp foo.cpp bar.cpp boost_date_time
        ;
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am creating package using cmake I am having following structure bin/ bin1 lib/
Can anyone help? I have the following structure using associations, and as you can
Using Model->find('all') returns an array with the following structure: array( 0 => array('Model1' =>
I am using a MySQL table called login with the following structure: loginid, username,
I have a large application (~50 modules) using a structure similar to the following:
I'm using Hibernate 3.3.1 and am following along in modelling this sample table structure
I am using following structure. <div style=background:#000 url(images/heading/bg.gif) repeat-x 0 0; height:28px; color:#FFF;> <div
In our codebase we are using the following structure, using TFS / - Build
I have a database/table in SQLITE using the following structure CREATE TABLE milestones (
I am uploading data from Excel to SQL Server using the following structure: Private

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.