|
Boost : |
From: Martin Schürch (mschuerch_at_[hidden])
Date: 2002-08-20 02:57:05
"Peter Dimov" <pdimov_at_[hidden]> wrote in message
news:<011101c2479e$cad9c730$1d00a8c0_at_pdimov2>...
>From: "Martin Schuerch" <mschuerch_at_[hidden]>
> > Hi
> >
> > In a VC project with boost, ATL and mangaged extensions I get the
>following
> > link error:
> >
> > PPFacadeNet.obj : error LNK2022: metadata operation failed (80131195) :
> > Custom attributes are not consistent: (0x0c0006cd).
> > LINK : fatal error LNK1254: metadata for symbol
> > '?InterlockedExchange_at_winapi@detail_at_boost@@$$J18YGJPCJJ_at_Z' inconsistent
>with
> > COFF symbol table
> >
> > When I include <windows.h> in winapi.hpp and make the hacks:
> >
> > typedef CRITICAL_SECTION critical_section;
> >
> >
> > inline long_type InterlockedIncrement(long_type volatile * x){ return
> > ::InterlockedIncrement(x); }
>[...]
> > Then it works.
>Yes. The point of winapi.hpp is to avoid <windows.h> but it seems that the
>.NET strict checks interfere.
>If you find a way to make winapi.hpp work in /clr mode without including
><windows.h> let me know. The other option is to include your version in
>#ifdef BOOST_USE_WINDOWS_H (or is there a predefined macro to detect /clr?)
I know of none macro.
Wouldn't it be possible to include <windows.h> only in the cpp file ( would
be winapi.cpp ). And to declare critical_sction and the used functions in
winapi.h only.
To have windows.h included in winapi.hpp would be a mess (at least it would
work) because winapi.hpp gets included also when shared_ptr.hpp is
included. Is this neccessary?
Martin
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk