Windows下如何解决C ++中的以下问题 [英] How to resolve the follwing problem in c++ under windows

查看:163
本文介绍了Windows下如何解决C ++中的以下问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

#include "stdafx.h"
 #define WINVER 0x0500
#include <stdio.h>

#include <windows.h>
#include <conio.h>

int main(int argc, char* argv[])
{
    DEVMODE  dev;
     DWORD           DispNum = 0;
    DISPLAY_DEVICE  DisplayDevice;
    ZeroMemory(&DisplayDevice,sizeof(DisplayDevice));
EnumDisplayDevices(NULL, DispNum, &DisplayDevice, 0);

    return 0;
}




这是我的编码..

首先,它在EnumDisplayDevices中给出错误,未声明..
然后,我包含了#define WINVER 0x0500.
问题已经解决了.但是现在它又带来了一些其他时间上的错误..

错误:




this is my coding ..

first it gives error in EnumDisplayDevices is undeclared ..
Then i included #define WINVER 0x0500.
the problem is solved.. But now it gives some other compilie time errors..

Error:

Compiling...
disp.cpp
NOTE: WINVER has been defined as 0x0500 or greater which enables
Windows NT 5.0 and Windows 98 features. When these headers were released,
Windows NT 5.0 beta 1 and Windows 98 beta 2.1 were the current versions.
For this release when WINVER is defined as 0x0500 or greater, you can only
build beta or test applications.  To build a retail application,
set WINVER to 0x0400 or visit http://www.microsoft.com/msdn/sdk
to see if retail Windows NT 5.0 or Windows 98 headers are available.
See the SDK release notes for more information.
D:\Users\Dharmaraj\pratice\disp\disp.cpp(13) : warning C4101: 'dev' : unreferenced local variable
Linking...
disp.obj : error LNK2001: unresolved external symbol __imp__EnumDisplayDevicesA@16
Debug/disp.exe : fatal error LNK1120: 1 unresolved externals
Error executing link.exe.






我自己增加了#define WINVER 0x0600,就像这样..然后同样的错误..

如何解决这个问题.

高级,请帮助我..






my self i increase the #define WINVER 0x0600 like that.. then also same error..

how to solve this one..

senior please help me..

推荐答案

似乎您正在使用旧的Windows SDK.从MSDN下载最新的版本.
It looks like you are using an old Windows SDK. Download the latest one from MSDN.


检查一下

http://msdn.microsoft.com/zh-cn/library/aa383745%28v=vs.85%29.aspx#setting_winver_or__win32_winnt
Check this out

http://msdn.microsoft.com/en-us/library/aa383745%28v=vs.85%29.aspx#setting_winver_or__win32_winnt


这篇关于Windows下如何解决C ++中的以下问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆