小编Lip*_*z3k的帖子

FreeType"generic"与c ++/cx关键字冲突

我把c ++和c ++/cx放在一起有问题.我需要使用FreeType库,但它们对某些变量使用"通用"名称.我还需要启用VC++扩展,因为WinRT应用程序会导致名称冲突(通用是c ++/cx中的关键字)

1>freetype2\include\freetype\freetype.h(1391): error C2059: syntax error : 'generic'
Run Code Online (Sandbox Code Playgroud)

我只在我的项目属性中添加了freetype引用和aditional include目录.

有没有办法解决这个案子?谢谢你的帮助:) Tomas

c++ freetype windows-runtime c++-cx

9
推荐指数
1
解决办法
2321
查看次数

将WRL用于C ++ / CX函数-链接器错误

可能重复:
什么是未定义的引用/未解决的外部符号错误,我该如何解决?

我正在尝试使WinRT库不使用CX扩展名。我需要获取程序包的名称,漫游数据文件夹等。我写了一些包装器,但是当我将此库链接到可执行项目时,出现链接器错误

error LNK2019: unresolved external symbol _WindowsCreateStringReference@16 referenced in function "private: void __thiscall Microsoft::WRL::Wrappers::HStringReference::CreateReference(wchar_t const *,unsigned int,unsigned int)" (?CreateReference@HStringReference@Wrappers@WRL@Microsoft@@AAEXPB_WII@Z)
error LNK2019: unresolved external symbol _WindowsDeleteString@4 referenced in function "public: __thiscall Microsoft::WRL::Wrappers::HStringReference::~HStringReference(void)" (??1HStringReference@Wrappers@WRL@Microsoft@@QAE@XZ)
error LNK2019: unresolved external symbol _WindowsGetStringRawBuffer@8 referenced in function "long __cdecl aponialib::winrt::GetFullName(class std::basic_string<wchar_t,struct std::char_traits<wchar_t>,class std::allocator<wchar_t> > &)" (?GetFullName@winrt@aponialib@@YAJAAV?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@@Z)
error LNK2019: unresolved external symbol __imp__RoGetActivationFactory@12 referenced in function "long __cdecl Windows::Foundation::GetActivationFactory<struct ABI::Windows::Storage::IApplicationDataStatics>(struct HSTRING__ *,struct ABI::Windows::Storage::IApplicationDataStatics * *)" (??$GetActivationFactory@UIApplicationDataStatics@Storage@Windows@ABI@@@Foundation@Windows@@YAJPAUHSTRING__@@PAPAUIApplicationDataStatics@Storage@1ABI@@@Z)
Run Code Online (Sandbox Code Playgroud)

这是包裹名称包装

// including in .h
#include <windows.h>
#include <string> …
Run Code Online (Sandbox Code Playgroud)

c++ visual-c++ windows-runtime wrl

6
推荐指数
0
解决办法
2740
查看次数

VC++ 11 map和multimap迭代器(重载)C2535

我正在玩新的VS 2012,我可能会遇到新的C++ 11问题.当我在项目设置中将平台工具集设置为VS2010(v100)时,这种代码很有效.

.H:

typedef std::multimap<unsigned, unsigned>   SizeMap;
typedef std::map<unsigned, unsigned>        OffsetMap;

private:
    inline void _RemoveBlockL(SizeMap::iterator sizeI);
    inline void _RemoveBlockL(OffsetMap::iterator offsetI);
Run Code Online (Sandbox Code Playgroud)

的.cpp:

inline void Foo::_RemoveBlockL(SizeMap::iterator sizeI)
{
// impementation
}

inline void Foo::_RemoveBlockL(OffsetMap::iterator offsetI)
{
// impementation
}
Run Code Online (Sandbox Code Playgroud)

但是当我为VS2012(v110)更改它时,我会收到以下错误:

Error   61  error C2535: 'void
Boo::system::Foo::_RemoveBlockL(std::_Tree_iterator<_Mytree>)' : member function already
defined or declared D:\_work\wp-test\boo\system\foo.h
Run Code Online (Sandbox Code Playgroud)

为什么重载不能在VC++ 11中运行?

c++ stl map multimap visual-c++-2012

4
推荐指数
1
解决办法
346
查看次数