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

  • Home
  • SEARCH
  • 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 8090633
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T19:47:16+00:00 2026-06-05T19:47:16+00:00

I’m trying to build simplest Boost.Asio tutorial example "timer1" (it’s in timer.cpp) with waf

  • 0

I’m trying to build simplest Boost.Asio tutorial example "timer1" (it’s in timer.cpp) with waf on Debian squeeze, python 2.6.6.

root@ds:/var/timer# ls

timer.cpp wscript

wscript here is a config of waf:

#! /usr/bin/env python
top = '.'
out = '.'

def options(opt):
    opt.load('compiler_cxx')

def configure(conf):
    conf.load('compiler_cxx')
    conf.env['LINKFLAGS'] = '--verbose -L/usr/local/lib -lboost_system'

def build(bld):
    tgen = bld.new_task_gen()
    tgen.features = 'cxx cxxprogram'
    tgen.source = 'timer.cpp'
    tgen.target = 'timer'
    tgen.includes = '.'
    tgen.update_outputs = True

waf configure is successfull.

But waf --verbose build finishes with error (I inserted <*> below to mark a line)

Waf: Entering directory `/var/timer'
[1/2] cxx: timer.cpp -> timer.cpp.1.o
[2/2] cxxprogram: timer.cpp.1.o -> timer
timer.cpp.1.o: In function `__static_initialization_and_destruction_0(int, int)':
timer.cpp:(.text+0x103): undefined reference to `boost::system::generic_category()'
timer.cpp:(.text+0x10f): undefined reference to `boost::system::generic_category()'
...
Build failed
-> task in 'timer' failed (exit status 1): 
{task 38446736: cxxprogram timer.cpp.1.o -> timer}
<*>
['/usr/bin/g++', '--verbose -L/usr/local/lib -lboost_system', 'timer.cpp.1.o', '-o', '/var/timer/timer', '-Wl,-Bstatic', '-Wl,-Bdynamic']    

It seems gcc called by waf didn’t find boost_system library during linkage.

But everything works fine if I build example by gcc without waf.

root@ds:/var/timer# /usr/bin/g++ --verbose -I/var/flake/lib/boost timer.cpp -c -o timer.cpp.1.o
...
<**>
root@ds:/var/timer# /usr/bin/g++ --verbose -L/usr/local/lib -lboost_system timer.cpp.1.o -o timer -Wl,-Bstatic -Wl,-Bdynamic   
...
root@ds:/var/timer# ls
timer.cpp  timer.cpp.1.o  timer  wscript

As you can see command line used by waf (marked by <*> ) is identical with command line marked by <**>. But the result is completely different. Why? And how can I force waf to build that thing? Solution from here doesn’t work for me too. Also tried

...
opt.tool_options('boost')
...
conf.load('compiler_cxx boost')
conf.check_boost()
...
tgen.uselib = 'BOOST'
...

but without any effect

And another question. Output of gcc --verbose is much more extensive than output of waf --verbose. It seemed to me that verbose option must force waf to display all such info. Why isn’t that true? waf option -vvv doesn’t display this info as well.

  • 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-05T19:47:17+00:00Added an answer on June 5, 2026 at 7:47 pm

    If you use the boost tool, you should check the waf boost example in playground/boost, and you will see that check_boost takes arguments. It will solve your issue.

    Alternatively if you don’t use the tool, and using a real OS where libraries are set up in an accessible folder, you can just do:

    conf.env.LIB_BOOST = ['boost_system']
    
    ...
    
    bld(
     ...,
     use='BOOST',
     ...,
    )
    

    Note for your future scripts:

    • avoid using CFLAGS, CXXFLAGS, LINKFLAGS as it’s not portable.
    • don’t set out=’.’ if possible
    • use bld(…) vs. the old syntax
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to understand how to use SyndicationItem to display feed which is
Basically, what I'm trying to create is a page of div tags, each has
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I am trying to render a haml file in a javascript response like so:
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
We're building an app, our first using Rails 3, and we're having to build
I'm trying to decode HTML entries from here NYTimes.com and I cannot figure out
i got an object with contents of html markup in it, for example: string
I'm trying to use string.replace('’','') to replace the dreaded weird single-quote character: ’ (aka

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.