问题
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