Boost logo

Boost :

Subject: Re: [boost] [test] minimal.hpp causing unresolved external with Intel on Windows
From: Beman Dawes (bdawes_at_[hidden])
Date: 2008-11-30 08:44:38


On Sat, Nov 29, 2008 at 7:50 PM, Steven Watanabe <watanabesj_at_[hidden]>wrote:

> AMDG
>
> Beman Dawes wrote:
>
>> The little program below compiles and runs fine on most compilers, but
>>>> with
>>>> the Intel compiler there is an unresolved external:
>>>>
>>>> test.obj : error LNK2019: unresolved external symbol "void __cdecl
>>>> boost::throw_exception(class std::exception const &)"
>>>> (?throw_exception_at_boost@@YAXABVexception_at_std@@@Z) referenced in
>>>> function
>>>> _main
>>>> test.exe : fatal error LNK1120: 1 unresolved externals
>>>>
>>>>
>>> Sounds like BOOST_NO_EXCEPTIONS is defined?
>>>
>>>
>>
>> Yes, but where and why? It isn't coming from the command line.I invoked
>> the
>> compilers directly, not via bjam, so it isn't a Boost.Build problem. I did
>> a
>> quick scan through the test headers and didn't see anything at all
>> suspicious.
>>
>>
>
> Well, I grepped through the headers and only boost/config/compiler/*.hpp
> sets BOOST_NO_EXCEPTIONS. I don't see how it's possible for it to
> be defined. Have you checked directly that it is defined?

Adding code to check directly...

Yep, BOOST_NO_EXCEPTIONS is being set for Intel, but not other compilers.

Hum... The problem isn't in the Boost Test library at all. It is in
boost/config/compiler/common_edg.hpp, lines 47-49:

# if !defined(__KCC) && !defined(__EXCEPTIONS)
# define BOOST_NO_EXCEPTIONS
# endif

If I comment those lines out, the problem disappears.

One thing that changed in my setup about the time the problem appeared is
that I moved from 32-bit XP to 64-bit XP. Perhaps there is an Intel bug
related to that. I'll check

Thanks for your help, Steven!

--Beman


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk