在调试c++调用c时,发生了“***was not declared in this scope"问题,特此记录
头文件中已经包含了相关.h文件

首先, 怀疑是发生了环形依赖问题,排查后发现被调用文件已经包含了条件编译

#ifndef ***_H_
#define ***_H_
...
#endif

其次,程序名也未和其他库中的头文件重名;

最后,发现在c程序的存在除了上述的条件编译外,还存在另一个条件编译

#ifdef COMPONENT

即只有满足该条件下才会编译该程序

解决方案: 在include头文件前增加宏定义即可

#define COMPONENT

排查“***was not declared in this scope“相关推荐

  1. 【C++】mingw32-make+cmake:error: ‘nullptr‘ was not declared in this scope解决方法

    ###问题 使用cmake成功(Configuring done Generating done)后,在cmd终端中执行 mingw32-make报错: error: 'nullptr' was no ...

  2. ndk error: malloc was not declared in this scope

    error: 'malloc' was not declared in this scope 解决方法: NDK_TOOLCHAIN_VERSION=4.8 APP_CPPFLAGS += -frtt ...

  3. 'imread' was not declared in this scope

    在opencv3中,会报这个异常: 'imread' was not declared in this scope 解决方法: #include <opencv2/core/core.hpp&g ...

  4. 'htons' was not declared in this scope 解决

    'htons' was not declared in this scope ndk 如果是在ndk下,引用如下即可: /* Must include in android ndk env */ #i ...

  5. 解决Cygwin编译cocos2dx 遇到的 error: 'UINT64_C' was not declared in this scope 问题

    环境工具:Win10.VS2013.cocos2d-x-2.2.6.Cygwin.ADT 问题来源:写了一个小游戏,VS2013上运行成功,就尝试着打包apk,项目导入到ADT里面,添加了cocos2 ...

  6. 调用ffmpeg库编译时出现common.h:175:47: error: 'UINT64_C' was not declared in this scope

    解决办法 出现错误:jni/ffmpeg/libavutil/common.h:175:47: error: 'UINT64_C' was not declared in this scope 解决: ...

  7. ‘close’ was not declared in this scope

    'close' was not declared in this scope 'read' was not declared in this scope 'sysconf' was not decla ...

  8. 文档源代码opencv 中的错误error: ‘SurfFeatureDetector’ was not declared in this scope

    本篇文章朋友在青岛游玩的时候突然想到的...最近就有想写几篇关于文档源代码的文章,所以回家到之后就奋笔疾书的写出来发布了     这是文档中的源代码,:但是译编的时候会有一下错误:     error ...

  9. was not declared in this scope

    "was not declared in this scope"是一个错误信息,在编译的时候会遇到.其含义为标识符在其出现的地方是未被定义的. 出现该错误的时候,会同时把未定义的变 ...

最新文章

  1. mysql查询不同用户的最新一条记录
  2. 用C++对C++语法格式进行分析
  3. 注意力机制并不是关注输入的位置
  4. golang mutex互斥锁分析
  5. 给数据库表字段设置默认值
  6. 话术php源码,恋爱话术宝典织梦源码
  7. 携程去哪儿移动端产品分析报告
  8. 项目所需的应用程序未安装,确保已安装项目类型(.csproj)的应用程序的解决办法...
  9. img src请求后台值值能判断_图片src拼接后台返回ID
  10. linux编译器下载地址,GNU Compiler Collection(gcc编译器) v4.9.1 linux版
  11. java定义类和测试类时的三种方式
  12. laypage分页java例子_基于LayUI分页和LayUI laypage分页的使用示例
  13. Spotfire10.10.0 windows10安装与配置
  14. CodeMeter:软件加密的“木桶定律”
  15. 茶叶的基本知识,喝茶的好处和坏处
  16. c语言自动贩卖机找钱,c语言趣题之“找钱的方法数量 ”
  17. 霍志刚中国科学院计算机,曙光4000系列高性能计算机研究集体
  18. windows10LTSC下载与安装
  19. 办流量卡要身份证照片,办流量卡是否需要身份证正反面照片
  20. OTA更新利用CRC保证程序的完整性

热门文章

  1. 交通中心助力打造城市交通大脑深圳样板 ⑩
  2. 21年招银网络校招电话一面问题
  3. fegin设置header
  4. HDU 多校联合第三场
  5. CRT远程连接出现中文乱码
  6. hpy计算机维护系统,HPY计算机维护系统2013(W8PE+03PE+DOS,ISO量产版)
  7. code 128 npm
  8. table( 表格)以及列表的使用
  9. VS2010离线安装包(学习版)
  10. dell 7040m 黑苹果_ARTS Tips:黑苹果核显问题解决