我从VC ++ 6.0获得旧项目,升级到VS2008并修复了一些错误,然后编译成功。但从VS2008升级到VS2013或VS2015后, 我得到753错误,如:
1> bitbuf.cpp
1>C:\Program Files\Microsoft Visual Studio 12.0\VC\atlmfc\include\atlcomcli.h(166): warning C4003: not enough actual parameters for macro 'Swap'
1>C:\Program Files\Microsoft Visual Studio 12.0\VC\atlmfc\include\atlcomcli.h(166): error C2062: type 'void' unexpected
1> C:\Program Files\Microsoft Visual Studio 12.0\VC\atlmfc\include\atlcomcli.h(312) : see reference to class template instantiation 'ATL::CComPtrBase<T>' being compiled
1>C:\Program Files\Microsoft Visual Studio 12.0\VC\atlmfc\include\atlcomcli.h(166): error C2334: unexpected token(s) preceding '{'; skipping apparent function body
1>C:\Program Files\Microsoft Visual Studio 12.0\VC\atlmfc\include\atlcomcli.h(167): error C2059: syntax error : '{'
1>C:\Program Files\Microsoft Visual Studio 12.0\VC\atlmfc\include\atlcomcli.h(167): error C2334: unexpected token(s) preceding '{'; skipping apparent function body
1>C:\Program Files\Microsoft Visual Studio 12.0\VC\atlmfc\include\atlcomcli.h(334): warning C4003: not enough actual parameters for macro 'Swap'
1>C:\Program Files\Microsoft Visual Studio 12.0\VC\atlmfc\include\atlcomcli.h(351): warning C4003: not enough actual parameters for macro 'Swap'
1>C:\Program Files\Microsoft Visual Studio 12.0\VC\atlmfc\include\atlcomcli.h(358): warning C4003: not enough actual parameters for macro 'Swap'
1>C:\Program Files\Microsoft Visual Studio 12.0\VC\atlmfc\include\atlcomcli.h(364): warning C4003: not enough actual parameters for macro 'Swap'
1>C:\Program Files\Microsoft Visual Studio 12.0\VC\atlmfc\include\atlcomcli.h(391): warning C4003: not enough actual parameters for macro 'Swap'
1>C:\Program Files\Microsoft Visual Studio 12.0\VC\atlmfc\include\atlcomcli.h(399): warning C4003: not enough actual parameters for macro 'Swap'
1>C:\Program Files\Microsoft Visual Studio 12.0\VC\atlmfc\include\atlcomcli.h(411): warning C4003: not enough actual parameters for macro 'Swap'
来自atlcomcli.h的753错误
我也尝试使用VS2010,出现了不同的错误,但仍然不知道在哪里修复
1> bitbuf.cpp
1>C:\Program Files\Microsoft Visual Studio 10.0\VC\include\limits(117): error C2059: syntax error : 'constant'
1> C:\Program Files\Microsoft Visual Studio 10.0\VC\include\limits(131) : see reference to class template instantiation 'std::numeric_limits<_Ty>' being compiled
1>C:\Program Files\Microsoft Visual Studio 10.0\VC\include\limits(118): error C2334: unexpected token(s) preceding '{'; skipping apparent function body
1>C:\Program Files\Microsoft Visual Studio 10.0\VC\include\limits(224): error C2059: syntax error : 'constant'
1>C:\Program Files\Microsoft Visual Studio 10.0\VC\include\limits(225): error C2334: unexpected token(s) preceding '{'; skipping apparent function body
1>C:\Program Files\Microsoft Visual Studio 10.0\VC\include\limits(289): error C2059: syntax error : 'constant'
1>C:\Program Files\Microsoft Visual Studio 10.0\VC\include\limits(290): error C2334: unexpected token(s) preceding '{'; skipping apparent function body
1>C:\Program Files\Microsoft Visual Studio 10.0\VC\include\limits(355): error C2059: syntax error : 'constant'
1>C:\Program Files\Microsoft Visual Studio 10.0\VC\include\limits(356): error C2334: unexpected token(s) preceding '{'; skipping apparent function body
1>C:\Program Files\Microsoft Visual Studio 10.0\VC\include\limits(419): error C2059: syntax error : 'constant'
1>C:\Program Files\Microsoft Visual Studio 10.0\VC\include\limits(420): error C2334: unexpected token(s) preceding '{'; skipping apparent function body
1>C:\Program Files\Microsoft Visual Studio 10.0\VC\include\limits(482): error C2059: syntax error : 'constant'
1>C:\Program Files\Microsoft Visual Studio 10.0\VC\include\limits(483): error C2334: unexpected token(s) preceding '{'; skipping apparent function body
1>C:\Program Files\Microsoft Visual Studio 10.0\VC\include\limits(545): error C2059: syntax error : 'constant'
1>C:\Program Files\Microsoft Visual Studio 10.0\VC\include\limits(546): error C2334: unexpected token(s) preceding '{'; skipping apparent function body
1>C:\Program Files\Microsoft Visual Studio 10.0\VC\include\limits(611): error C2059: syntax error : 'constant'
1>C:\Program Files\Microsoft Visual Studio 10.0\VC\include\limits(612): error C2334: unexpected token(s) preceding '{'; skipping apparent function body
1>C:\Program Files\Microsoft Visual Studio 10.0\VC\include\limits(739): error C2059: syntax error : 'constant'
1>C:\Program Files\Microsoft Visual Studio 10.0\VC\include\limits(740): error C2334: unexpected token(s) preceding '{'; skipping apparent function body
1>C:\Program Files\Microsoft Visual Studio 10.0\VC\include\limits(804): error C2059: syntax error : 'constant'
1>C:\Program Files\Microsoft Visual Studio 10.0\VC\include\limits(805): error C2334: unexpected token(s) preceding '{'; skipping apparent function body
1>C:\Program Files\Microsoft Visual Studio 10.0\VC\include\limits(869): error C2059: syntax error : 'constant'
1>C:\Program Files\Microsoft Visual Studio 10.0\VC\include\limits(870): error C2334: unexpected token(s) preceding '{'; skipping apparent function body
1>C:\Program Files\Microsoft Visual Studio 10.0\VC\include\limits(934): error C2059: syntax error : 'constant'
1>C:\Program Files\Microsoft Visual Studio 10.0\VC\include\limits(935): error C2334: unexpected token(s) preceding '{'; skipping apparent function body
1>C:\Program Files\Microsoft Visual Studio 10.0\VC\include\limits(1062): error C2059: syntax error : 'constant'
1>C:\Program Files\Microsoft Visual Studio 10.0\VC\include\limits(1063): error C2334: unexpected token(s) preceding '{'; skipping apparent function body
1>C:\Program Files\Microsoft Visual Studio 10.0\VC\include\limits(1127): error C2059: syntax error : 'constant'
1>C:\Program Files\Microsoft Visual Studio 10.0\VC\include\limits(1128): error C2334: unexpected token(s) preceding '{'; skipping apparent function body
1>C:\Program Files\Microsoft Visual Studio 10.0\VC\include\limits(1193): error C2059: syntax error : 'constant'
1>C:\Program Files\Microsoft Visual Studio 10.0\VC\include\limits(1194): error C2334: unexpected token(s) preceding '{'; skipping apparent function body
1>C:\Program Files\Microsoft Visual Studio 10.0\VC\include\limits(1260): error C2059: syntax error : 'constant'
1>C:\Program Files\Microsoft Visual Studio 10.0\VC\include\limits(1261): error C2334: unexpected token(s) preceding '{'; skipping apparent function body
1>C:\Program Files\Microsoft Visual Studio 10.0\VC\include\limits(1327): error C2059: syntax error : 'constant'
1>C:\Program Files\Microsoft Visual Studio 10.0\VC\include\limits(1328): error C2334: unexpected token(s) preceding '{'; skipping apparent function body
1> curve.cpp
1> edittext.cpp
谁能告诉我我做错了什么? 谢谢你的阅读。
答案 0 :(得分:1)
几天之后,我发现我在代码中定义了Swap函数,它与atlcomcli.h中的Swap函数冲突,然后我重命名我的交换函数,一切正常。