CodeBlocks "no such file or directory" 错误解决方案(创建类找不到头文件)
在CodeBlocks下,有时候需要自己定义类,当然就要添加相应的头文件,但添加进去的头文件明明包含在项目中了,
但编译时还是会报错:no such file or directory;这是为什么呢?
其实是一个很简单的问题,但有些人(比如说我)就会困在这儿,百度也找不到(至少我是没找到),所以写了上来.
为了能让编译器找到你自己的头文件,需要把头文件的存放路径告诉编译器,操作如下:
在项目/构建选项/搜索路径选项下,点击添加按钮,添加自己的头文件的存放文件夹,搞定...
如果你的CodeBlocks是英文版本,Progect->build options->Search directories,重复上面
另外在新建类的时候
File->new->Class
中间的File policy
header and implementation file shall be in same folder
这一行前面的勾必须选上去,要不然
#include "头文件"
编译会出现找不到头文件,得将头文件的完整路径给加上去才不会出错。
将header and implementation file shall be in same folder
这一行给勾选上去,#include "头文件" 便编译能通过,不必加上完整路径
CodeBlocks "no such file or directory" 错误解决方案(创建类找不到头文件)的更多相关文章
- win8/win7中使用Git Extensions PuTTy模式提交时 git-credential-winstore.exe": No such file or directory 错误解决方案
参考:http://www.cnblogs.com/hlizard/p/3627792.html 报错类似以下错误 \"F:/GitExtensions/GitCredentialWinSt ...
- -bash: ./start.sh: /bin/sh^M: bad interpreter: No such file or directory 错误解决方案
问题描述:sh文件中,在win环境下,用WinSCP编辑,出现如下错误: -bash: ./start.sh: /bin/sh^M: bad interpreter: No such file or ...
- linux输入yum后提示: -bash: /usr/bin/yum: No such file or directory的解决方案
linux输入yum后提示: -bash: /usr/bin/yum: No such file or directory的解决方案 今天在安装程序时,发现有一个插件未安装,我就随手敲了一个命令,看都 ...
- createNewFile() 报错 open failed: ENOENT (No such file or directory) 的解决方案
在写Android应用中使用createNewFile() 遇到open failed: ENOENT (No such file or directory) 错误,在网上查了许多方法,不过都不能解决 ...
- linux e2fsprogs安装解决uuid/uuid.h: No such file or directory错误
linux查看某个包是否安装 dpkg -l libuu* 用gcc编译发生nux 错误:fatal error: uuid/uuid.h: No such file or directo ...
- /etc/rc.d/init.d/iptables: No such file or directory 错误原因
注:本文转载自cnblogs:一天学点的文章</etc/rc.d/init.d/iptables: No such file or directory 错误原因> RedHat Enter ...
- php的mysqli_connect函数显示 No such file or directory错误以及localhost换成127.0.0.1执行成功
Centos7环境-php7-MariaDB5.5.60 (新安装的php7,执行php -m 显示有mysqli模块,php.ini没有改其它) 测试代码为: <?php //~ echo d ...
- mkdir()提示No such file or directory错误的解决方法
转自:http://www.02405.com/program/php/1692.html 在php中使用mkdir()方法创建文件夹时报错:No such file or directory,出错代 ...
- Linux运行shell脚本提示No such file or directory错误的解决办法
Linux执行.sh文件,提示No such file or directory的问题: 原因:在windows中写好shell脚本测试正常,但是上传到 Linux 上以脚本方式运行命令时提示No s ...
随机推荐
- C#使用Linq对DataGridView进行模糊查找
针对DataGridView中已进行过数据绑定,即已向DataGridView中添加了一些数据,可以结合Linq查询,并让匹配查询的行高亮显示,如下图: 具体实现如下: [csharp] ...
- 974. Subarray Sums Divisible by K
Given an array A of integers, return the number of (contiguous, non-empty) subarrays that have a sum ...
- JavaWeb(HTML +css+js+Servlet....)
注意 1.不要把函数命名为add(),不然容易和自带的冲突报错 2.是createElement 不要把create中的e写掉了 3.记得是getElementsByTaxName和getElemen ...
- MySQL(分组、连表操作、备份数据库)
day58 分组 参考:https://www.cnblogs.com/xp796/p/5262187.html select dept, max(salary) from department gr ...
- day67 crm(4) stark组件的增删改 以及 model_from使用和from组件回顾
前情提要:Django stark 组件开发的 增删改, model_form组件的使用 form组件的回顾 一:list_display_link 创建 功能描述: 使包含的字段能 ...
- D03——C语言基础学习PYTHON
C语言基础学习PYTHON——基础学习D03 20180804内容纲要: 1 函数的基本概念 2 函数的参数 3 函数的全局变量与局部变量 4 函数的返回值 5 递归函数 6 高阶函数 7 匿名函数 ...
- UITableView 的常用可复制代码
UITableView是使用中最常用的工具,下面列举一个常用的tableview类,以后直接复制代码,稍作修改,就能用了. #import "ViewController.h" @ ...
- iOS-电池图标【结合贝塞尔曲线控制电量显示】
基于UIView类:WKJBatteryView WKJBatteryView.h #import <UIKit/UIKit.h> @interface WKJBatteryView : ...
- js的let语句在安卓手机端的QQ浏览器出错的问题
关于JavaScript里面的let,let 语句可以声明一个块级作用域的本地变量,并且可选的将其初始化为一个值. <ul id="list"> </ul> ...
- mysql中授权其它电脑链接指令。
grant all privileges on yourDatabaseName to 'user'@'databaseIPAddress' identified by 'password' with ...