我正在编译Visual C++ 2010中的项目,但是我遇到了一些Winsock重定义的问题.
首先我得到:
syntax error : identifier 'SOCKADDR_STORAGE'
Run Code Online (Sandbox Code Playgroud)
但是,如果我包含winsock或winsock2或ws2tcpip,我会收到许多错误:
error C2011: 'sockaddr' : 'struct' type redefinition
error C2011: 'WSAData' : 'struct' type redefinition
error C2011: 'linger' : 'struct' type redefinition
Run Code Online (Sandbox Code Playgroud) 我的项目出现了一些致命错误,错误来自sspi.h,我必须定义一些东西,但我不是什么,为什么,请有人解释.
sspi.h(60): fatal error C1189: #error : You must define one of SECURITY_WIN32, SECURITY_KERNEL, or SECURITY_MAC
Run Code Online (Sandbox Code Playgroud) 我在Visual Studio 10中编译项目,编译后的可执行文件在win 7上运行正常,但由于缺少msvcrt100.dll而无法在win xp上运行.我尝试使用"/ NOTDEFAULTLIB",但它也删除了我使用的其他一些外部库.有没有办法不链接最新的Microsoft运行时库?
提前致谢.
我知道大多数时候您会因为没有包含库或未在类中正确定义函数而得到“未解决的外部符号”,但是我在结构上却遇到了同样的错误。我在.hi之一中定义的文件.cpp和.h很少
extern struct MyDataStruct StructData;
Run Code Online (Sandbox Code Playgroud)
我在我的.cpp文件中包含了这个.h但我得到了
'struct MyDataStruct StructData' unresolved external symbol
Run Code Online (Sandbox Code Playgroud)
我从任何类中定义了此结构,并且没有任何类前缀就可以访问它。
提前致谢。
有人可以解释一下如何将对话框单位转换为屏幕坐标值吗?我看到有MapDialogRect函数,但它转换RECT,我想将x,y和cx,cy值转换为屏幕坐标值,我真的不明白如何实现这一点.
提前致谢.
c++ ×5
windows ×4
linker ×2
coordinates ×1
dialog ×1
header-files ×1
msvcrt ×1
redefinition ×1
winapi ×1
window ×1
winsock ×1