FreeType “generic” conflict with c++/cx keyword

社会主义新天地 提交于 2019-12-05 18:40:46

问题


I have a problem with putting c++ and c++/cx together. I need to use FreeType library, but they are using "generic" name for some variable. I also need to enable VC++ extensions because WinRT app, which causes name conflict (generic is keyword in c++/cx)

1>freetype2\include\freetype\freetype.h(1391): error C2059: syntax error : 'generic'

I only added freetype reference and aditional include directories to my project properties.

Is there some way to solve this case? Thank you for your help :) Tomas


回答1:


Use preprocessor to rename this keyword temporarily:

#define generic GenericFromFreeTypeLibrary
#include .... files from FreeTypeLibrary
#undef generic

This solution is not very nice but should work.



来源:https://stackoverflow.com/questions/13122266/freetype-generic-conflict-with-c-cx-keyword

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!