我有一个尺寸为640x480的OpenGL窗口,需要居中显示在屏幕中间。之前我使用了以下代码:
glutInitWindowPosition((GetSystemMetrics(SM_CXSCREEN)-640)/2,
(GetSystemMetrics(SM_CYSCREEN)-480)/2);
之前是可以正常工作的。
但现在突然编译时出了问题...
Linking...
1>Project1.obj : error LNK2028: unresolved token (0A000372) "extern "C" int __stdcall GetSystemMetrics(int)" (?GetSystemMetrics@@$$J14YGHH@Z) referenced in function "int __cdecl main(int,char * *)" (?main@@$$HYAHHPAPAD@Z)
1>Project1.obj : error LNK2019: unresolved external symbol "extern "C" int __stdcall GetSystemMetrics(int)" (?GetSystemMetrics@@$$J14YGHH@Z) referenced in function "int __cdecl main(int,char * *)" (?main@@$$HYAHHPAPAD@Z)
1>C:\Users\My Computer\Documents\School Stuff\CS445\Project1\Debug\Project1.exe : fatal error LNK1120: 2 unresolved externals
有人可以帮忙吗?这对我来说非常烦人和沮丧,因为我对OpenGL和GLUT不是很了解。