|
Boost : |
Subject: Re: [boost] [context] build error with -std=c++0x
From: Lars Viklund (zao_at_[hidden])
Date: 2010-11-20 18:40:11
On Sat, Nov 20, 2010 at 09:05:23AM -0800, Charlls Quarra wrote:
>
> Hi,
>
> i'm trying to get boost.context (from boost vault) to build with g++ 4.4.1 and 4.5.1 with -std=c++0x
>
> on both compilers i'm getting this error:
>
> In function `main':
> test.cpp:(.text+0x94): undefined reference to `boost::contexts::context::operator=(boost::contexts::context&&)'
> collect2: ld returned 1 exit status
>
> i built the code with this command line:
>
> g++ -std=c++0x `pkg-config --cflags boost-1.43` test.cpp -o xtest `pkg-config --libs boost-context` -lboost_context -lboost_system
>
> when i remove -std=c++0x from the command line, the code compiles and runs fine
You should most probably build both the library and the application with
the same language level.
This commonly occurs on platforms where differences in build settings
cause more errors, like on VC++ with the different runtimes and other
compiler tunables.
You're probably looking at an ODR violation, as there tends to be some
rather different types resulting from building with and without 0x,
particularly if conditionally defined around it.
-- Lars Viklund | zao_at_[hidden]
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk