错误C3861:找不到标识符 [英] error C3861: identifier not found

查看:1648
本文介绍了错误C3861:找不到标识符的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个应用程序,我在不同的.cpp文件中使用相同的功能,所以我在单独的.h文件中定义了这个函数但是当我在一个.cpp文件中添加这个.h文件然后它很好但是当我在另一个.cpp文件中添加相同的.h文件,然后出现错误错误C3861:未找到标识符。我正在尝试但无法解决请帮助..



我正在开发vc ++ mfc基于对话框的应用程序,它有两个对话框,每个对话框有两个.cpp文件和一个.h与对话框分开的公共文件,我想在两个.cpp文件中使用函数(函数在.h文件中定义),所以我在.cpp文件中包含.h文件,但是它显示错误错误C3861:未找到标识符请帮助..me ..

I have an application in which I am using same function in different .cpp file so I defined this function in separate .h file but when I am adding this .h file in one .cpp file then its fine but when I am adding same .h file in another .cpp file then error comes that "error C3861: identifier not found" . I am trying but not able to solved please help..

I am developing vc++ mfc Dialog based application which have two dialog and each dialog have two .cpp file and one .h common file which separated from dialog, and I want to use function in both .cpp file(function are defined in the .h file),so I include the .h file in both the .cpp file but its shows error "error C3861: identifier not found" please help..me..

推荐答案

如果您已正确完成,这应该是完全可以接受的。确保您的标题只能使用标题后卫处理一次。

要么:

This should be perfectly acceptable if you''ve done it correctly. Make sure your header only gets processed once using a header guard.
Either:
#ifndef HEADER_NAME
#define HEADER_NAME
//All your code
#endif



-OR-


-OR-

#pragma once
//code





您的错误表明您的某些标识符未在代码中的任何位置定义(可能是原型不匹配)。如果没有更多信息,很难猜出你的实际问题出现在哪里。



Your error indicates that you have some identifier that isn''t defined anywhere in your code (might be a prototype mismatch). Without more information, it''s kind of hard to guess where your actual problem arises.


这篇关于错误C3861:找不到标识符的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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