Note that there are some explanatory texts on larger screens.

plurals
  1. POLinking program with Boost.Asio using waf build system
    primarykey
    data
    text
    <p>I'm trying to build <a href="http://www.boost.org/doc/libs/1_40_0/doc/html/boost_asio/tutorial/tuttimer1/src.html" rel="nofollow noreferrer">simplest Boost.Asio tutorial example "timer1"</a> (it's in timer.cpp) with waf on Debian squeeze, python 2.6.6.</p> <blockquote> <p>root@ds:/var/timer# ls</p> <p>timer.cpp wscript</p> </blockquote> <p>wscript here is a config of waf:</p> <pre><code>#! /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 </code></pre> <p><code>waf configure</code> is successfull.</p> <p>But <code>waf --verbose build</code> finishes with error (I inserted <code>&lt;*&gt;</code> below to mark a line)</p> <pre><code>Waf: Entering directory `/var/timer' [1/2] cxx: timer.cpp -&gt; timer.cpp.1.o [2/2] cxxprogram: timer.cpp.1.o -&gt; 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 -&gt; task in 'timer' failed (exit status 1): {task 38446736: cxxprogram timer.cpp.1.o -&gt; timer} &lt;*&gt; ['/usr/bin/g++', '--verbose -L/usr/local/lib -lboost_system', 'timer.cpp.1.o', '-o', '/var/timer/timer', '-Wl,-Bstatic', '-Wl,-Bdynamic'] </code></pre> <p>It seems gcc called by waf didn't find boost_system library during linkage.</p> <p>But everything works fine if I build example by gcc without waf.</p> <pre><code>root@ds:/var/timer# /usr/bin/g++ --verbose -I/var/flake/lib/boost timer.cpp -c -o timer.cpp.1.o ... &lt;**&gt; 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 </code></pre> <p>As you can see command line used by waf (marked by <code>&lt;*&gt;</code> ) is identical with command line marked by <code>&lt;**&gt;</code>. But the result is completely different. Why? And how can I force waf to build that thing? Solution from <a href="https://stackoverflow.com/questions/9151304/waf-cannot-find-an-existing-library">here</a> doesn't work for me too. Also tried </p> <pre><code>... opt.tool_options('boost') ... conf.load('compiler_cxx boost') conf.check_boost() ... tgen.uselib = 'BOOST' ... </code></pre> <p>but without any effect</p> <p>And another question. Output of <code>gcc --verbose</code> is much more extensive than output of <code>waf --verbose</code>. It seemed to me that <code>verbose</code> option must force waf to display all such info. Why isn't that true? waf option -vvv doesn't display this info as well.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload