error c2065帮我解决一下

simalaya 2004-06-14 05:01:07
编译windows Media Encoder的VC例子,报这个错误.

--------------------Configuration: wmschedule - Win32 Debug--------------------
Compiling...
maindlg.cpp
C:\WMSDK\WMEncSDK9\samples\vc\scheduler\maindlg.cpp(96) : error C2065: 'wnsprintf' : undeclared identifier
C:\WMSDK\WMEncSDK9\samples\vc\scheduler\maindlg.cpp(550) : error C2065: 'SHGetFolderPath' : undeclared identifier
C:\WMSDK\WMEncSDK9\samples\vc\scheduler\maindlg.cpp(550) : error C2065: 'CSIDL_PROGRAM_FILES' : undeclared identifier
wmschedule.cpp
Generating Code...
Error executing cl.exe.

wmschedule.exe - 3 error(s), 0 warning(s)
...全文
2295 5 打赏 收藏 转发到动态 举报
AI 作业
写回复
用AI写文章
5 条回复
切换为时间正序
请发表友善的回复…
发表回复
simalaya 2004-06-15
  • 打赏
  • 举报
回复
不对啊。还是不行。
taianmonkey 2004-06-14
  • 打赏
  • 举报
回复
Compiler Error C2065
'identifier' : undeclared identifier

The specified identifier was not declared.

A variable’s type must be specified in a declaration before it can be used. The parameters that a function uses must be specified in a declaration, or prototype, before the function can be used.

Tips

Make sure any include file containing the required declaration is not omitted.


Make sure you are including any necessary header files if you have defined VC_EXTRALEAN, WIN32_LEAN_AND_MEAN, or WIN32_EXTRA_LEAN. Defining these symbols excludes some functionality (certain header files are excluded) from windows.h and afxv_w32.h (for MFC applications) to speed compiles. Search windows.h and afxv_w32.h for these symbols for the most up-to-date description of what is excluded.


Make sure the identifier name is spelled correctly.


Make sure the identifier is using the correct upper- and lowercase letters.


Make sure all string constants have closing quotes.


This error can be caused by having a newline character in a string constant without a continuation character. For example:
#include <stdio.h>
main() {
printf("\n %s
%s // error: 's' : undeclared identifier
%s",
"this", "is", "it");
}

Special considerations must be taken when splitting a constant string over several lines. The most common method is to change the format string. Strings separated only by whitespace (spaces, tabs, newlines) are concatenated. For example:
#include <stdio.h>
main() {
printf("\n %s"
" %s"
" %s",
"this", "is", "it");
}

An older, less-preferred method is to use line continuation by typing a backslash at the end of a line. For example:
printf("\n %s %s %s",
"this", "is", "it");

This method is not often used because the spaces at the beginning of each continued line become part of the string.

Make sure you're using proper namespace scope. For example, in order to properly resolve ANSI C++ Standard Library functions and operators, you must state that you're using the std namespace with the using directive.
For example, unless the using directive is uncommented, the following sample will fail to compile because the cout stream is defined in the std namespace:

#include <iostream>
// using namespace std;
void main()
{
cout << "Hello" << endl;
}

Kudeet 2004-06-14
  • 打赏
  • 举报
回复
'CSIDL_PROGRAM_FILES'
'SHGetFolderPath'
'wnsprintf'
他们的头文件没有包含进去
dawnwinds 2004-06-14
  • 打赏
  • 举报
回复
#include "Shlwapi.h"
#include "shlobj.h"

在你的maindlg.cpp前面添加这两行看看。

16,548

社区成员

发帖
与我相关
我的任务
社区描述
VC/MFC相关问题讨论
社区管理员
  • 基础类社区
  • AIGC Browser
  • encoderlee
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告

        VC/MFC社区版块或许是CSDN最“古老”的版块了,记忆之中,与CSDN的年龄几乎差不多。随着时间的推移,MFC技术渐渐的偏离了开发主流,若干年之后的今天,当我们面对着微软的这个经典之笔,内心充满着敬意,那些曾经的记忆,可以说代表着二十年前曾经的辉煌……
        向经典致敬,或许是老一代程序员内心里面难以释怀的感受。互联网大行其道的今天,我们期待着MFC技术能够恢复其曾经的辉煌,或许这个期待会永远成为一种“梦想”,或许一切皆有可能……
        我们希望这个版块可以很好的适配Web时代,期待更好的互联网技术能够使得MFC技术框架得以重现活力,……

试试用AI创作助手写篇文章吧