早教吧 育儿知识 作业答案 考试题库 百科 知识分享

f:\test\ado\debug\msado15.tlh(407):warningC4146:unaryminusoperatorappliedtounsignedtype,resultstillunsignedf:\test\ado\stdafx.cpp(5):errorC2501:'rename':missingstorage-classortypespecifiersf:\test\ado\stdafx.cpp(5):errorC2373:'rena

题目详情
f:\test\ado\debug\msado15.tlh(407) :warning C4146:unary minus operator applied to unsigned type,result still unsigned
f:\test\ado\stdafx.cpp(5) :error C2501:'rename' :missing storage-class or type specifiers
f:\test\ado\stdafx.cpp(5) :error C2373:'rename' :redefinition; different type modifiers
d:\program files\microsoft visual studio\vc98\include\stdio.h(335) :see declaration of 'rename'
f:\test\ado\stdafx.cpp(5) :error C2078:too many initializers
f:\test\ado\stdafx.cpp(5) :error C2440:'initializing' :cannot convert from 'char [7]' to 'int'
This conversion requires a reinterpret_cast,a C-style cast or function-style cast
f:\test\ado\stdafx.cpp(5) :error C2143:syntax error :missing ';' before 'PCH creation point'
我在使用VC++编写数据库方面的程序时,引用了“#import "C:\Program Files\Common Files\System\ado\msado15.dll" no_namespace rename("EOF","adoEOF")rename("BOF","adoBOF")”之后,就出现了上述的问题,
▼优质解答
答案和解析
很简单,如果rename是在新一行开始的,在no_namespace后面加斜杠\就可以了.改成:
#import "C:\Program Files\Common Files\System\ado\msado15.dll" no_namespace \
rename("EOF","adoEOF") rename("BOF","adoBOF")
如果不换行的话,就把从rename后面开始的内容接到no_namespace后面,不用斜杠,中间以空格隔开.