错误C3861:找不到标识符

编程入门 行业动态 更新时间:2024-10-22 05:04:40
本文介绍了错误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:找不到标识符

本文发布于:2023-10-07 15:22:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1469756.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:标识符   找不到   错误

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!