【发布时间】:2009-08-12 11:26:20
【问题描述】:
我在 Visual Studio 2008 下有一个 MFC C++ 项目编译器。
我在 #include 之前的 stdafx.h 中添加了一个 _AFX_NO_DEBUG_CRT 以避免 MFC 提供的所有调试新和删除(我希望提供我自己的以实现更好的跨平台兼容性)。
但是,当我这样做时,我会收到如下错误流:
>c:\program files\microsoft visual studio 9.0\vc\atlmfc\include\afxtls_.h(62) : error C2059: syntax error : '__asm'
1>c:\program files\microsoft visual studio 9.0\vc\atlmfc\include\afxtls_.h(62) : error C2143: syntax error : missing ')' before '{'
1>c:\program files\microsoft visual studio 9.0\vc\atlmfc\include\afxtls_.h(62) : error C2143: syntax error : missing ')' before '{'
1>c:\program files\microsoft visual studio 9.0\vc\atlmfc\include\afxtls_.h(62) : error C2143: syntax error : missing ')' before '{'
1>c:\program files\microsoft visual studio 9.0\vc\atlmfc\include\afxtls_.h(62) : error C2143: syntax error : missing ';' before '{'
1>c:\program files\microsoft visual studio 9.0\vc\atlmfc\include\afxtls_.h(62) : warning C4091: '' : ignored on left of 'int' when no variable is declared
1>c:\program files\microsoft visual studio 9.0\vc\atlmfc\include\afxtls_.h(62) : error C2143: syntax error : missing ';' before 'constant'
1>c:\program files\microsoft visual studio 9.0\vc\atlmfc\include\afxtls_.h(62) : error C2143: syntax error : missing ';' before '}'
1>c:\program files\microsoft visual studio 9.0\vc\atlmfc\include\afxtls_.h(62) : error C2143: syntax error : missing ';' before ','
1>c:\program files\microsoft visual studio 9.0\vc\atlmfc\include\afxtls_.h(62) : error C2059: syntax error : ')'
1>c:\program files\microsoft visual studio 9.0\vc\atlmfc\include\afxtls_.h(62) : error C2059: syntax error : ')'
1>c:\program files\microsoft visual studio 9.0\vc\atlmfc\include\afxtls_.h(62) : error C2059: syntax error : ')'
1
我“认为”它可能与 __asm int 3 调用有关,但我不能确定。以前有人遇到过这个问题吗?如果是这样,你是如何解决的?我是否坚持使用 MFC 的内存跟踪?我真的不希望因为它会让我的库少很多跨平台:(
任何帮助将不胜感激!
【问题讨论】:
标签: c++ visual-studio-2008 mfc