Boost logo

Boost Users :

Subject: Re: [Boost-users] Using Boost.Geometry with Clang/LLVM & VC14
From: degski (degski_at_[hidden])
Date: 2016-03-15 01:04:41


Hi Adam,

> I'm curious, what problems exactly did you face and when?
>
>
The problems arose while compiling the minimal example from the get started
tutorial.
Below I pasted some compiler (Clang-Cl.exe) output. It has all to do with
MSVC compiler bugs workarounds.

Is that correct that in this setup (MSVS + Clang) BOOST_CLANG is defined
> and BOOST_MSVC is NOT defined?
>
>
I've added these directives to the code:

#if !defined(__clang__)
#error __clang__ not defined.
#endif

#if !defined(_MSVC_VER)
#error _MSVC_VER not defined.
#endif

#if !defined(BOOST_CLANG)
#error BOOST_CLANG not defined.
#endif

#if !defined(BOOST_MSVC)
#error BOOST_MSVC not defined.
#endif

The compiler output is as follows:

1>------ Rebuild All started: Project: test, Configuration: Debug x64 ------
1> In file included from test.cpp:14:
1> In file included from z:\vc\x64\include\boost/geometry.hpp:22:
1> In file included from z:\vc\x64\include\boost/geometry/geometry.hpp:50:
1> In file included from
z:\vc\x64\include\boost/geometry/strategies/strategies.hpp:85:
1> In file included from
z:\vc\x64\include\boost/geometry/strategies/transform/matrix_transformers.hpp:40:
1> In file included from
z:\vc\x64\include\boost/numeric/ublas/vector.hpp:21:
1> In file included from
z:\vc\x64\include\boost/numeric/ublas/storage.hpp:26:
1> In file included from
z:\vc\x64\include\boost/numeric/ublas/traits.hpp:29:
1> In file included from z:\vc\x64\include\boost/typeof/typeof.hpp:124:
1>z:\vc\x64\include\boost/typeof/msvc/typeof_impl.hpp(150,31): error :
template specialization or definition requires a template parameter list
corresponding to the nested type 'base_type' (aka 'msvc_extract_type<ID>')
1> struct base_type::id2type // This uses nice VC6.5 and VC7.1
bugfeature
1> ~~~~~~~~~ ^
1>z:\vc\x64\include\boost/typeof/msvc/typeof_impl.hpp(150,20): error :
nested name specifier for a declaration cannot depend on a template
parameter
1> struct base_type::id2type // This uses nice VC6.5 and VC7.1
bugfeature
1> ^~~~~~~~~~~
1>test.cpp(733,2): error : _MSVC_VER not defined.
1> #error _MSVC_VER not defined.
1> ^
1>test.cpp(741,2): error : BOOST_MSVC not defined.
1> #error BOOST_MSVC not defined.
1> ^
1> 4 errors generated.
========== Rebuild All: 0 succeeded, 1 failed, 0 skipped ==========

So somehow things get mingled it seems.

Looking forward to your analysis. Have a good day,

degski



Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net