我在Visual Studio 2012编写的Windows窗体的GUI应用程序使用C ++ CLI,我真的需要使用Boost双向映射在一些内部结构值来协调一些GUI元素的值。 我下载并解压升压包,然后在我的项目的属性菜单我加入了升压位置配置属性 - > VC ++目录 - >包含目录。
但是,当我加升压包括(而不是其他,甚至没有宣布一个boost :: bimap的对象)
#include <boost/bimap.hpp>
我得到的错误
error C3389: __declspec(dllexport) cannot be used with /clr:pure or /clr:safe
error C3395: 'boost::serialization::void_cast_register' : __declspec(dllexport) cannot be applied to a function with the __clrcall calling convention
当我跟随的编译错误,我在“void_cast_fwd.hpp”,并在低于该行包含“BOOST_DLLEXPORT”,但我不知道该怎么做就结束了。
#ifndef BOOST_SERIALIZATION_VOID_CAST_FWD_HPP
#define BOOST_SERIALIZATION_VOID_CAST_FWD_HPP
// MS compatible compilers support #pragma once
#if defined(_MSC_VER)
# pragma once
#endif
/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8
// void_cast_fwd.hpp: interface for run-time casting of void pointers.
// (C) Copyright 2005 Robert Ramey - http://www.rrsd.com .
// Use, modification and distribution is subject to the Boost Software
// License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
// gennadiy.rozental@tfn.com
// See http://www.boost.org for updates, documentation, and revision history.
#include <cstddef> // NULL
#include <boost/serialization/force_include.hpp>
namespace boost {
namespace serialization {
namespace void_cast_detail{
class void_caster;
} // namespace void_cast_detail
template<class Derived, class Base>
BOOST_DLLEXPORT
inline const void_cast_detail::void_caster & void_cast_register(
const Derived * dnull = NULL,
const Base * bnull = NULL
) BOOST_USED;
} // namespace serialization
} // namespace boost
#endif // BOOST_SERIALIZATION_VOID_CAST_HPP
我是新来的.NET和C ++ CLI和不知道如何改变编译器指令/ CLR:纯或/ CLR:安全。
我如何能使用我的应用程序受此提振库的任何想法,将不胜感激。
另外,我现在是不担心的可移植性,所有我关心的是,它编译于Windows。 我假设的事实,我在.NET中使用C ++ CLI更是一个便携的限制比试图使用Boost库,但很有兴趣听到这个意见了。
谢谢!