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 ...
随机推荐
- Keil下Debug随笔
很多时候我们需要通过硬件仿真来调试程序,在仿真时有时候会遇到这样的情况,那就是选择全速运行时,我们的全局变量无法随时更新,而在那设一个断点后发现值是变化的,那么为什么会出现这种情况呢,那就是可能是我们 ...
- 600. Non-negative Integers without Consecutive Ones
Given a positive integer n, find the number of non-negative integers less than or equal to n, whose ...
- 关于ManyToMany的一点补充
1.先看model的定义 user表: class User(models.Model): """ 用户表 """ username = m ...
- 鬼知道是啥系列之——STL(lower_bound(),upper_bound() )
引子,不明觉厉: 百度,渐入佳境: 头铁,入门到放弃: lower_bound(): 头文件: #include<algorithm>函数功能: 函数lower_bound()在f ...
- POJ 3468A Simple Problem with Integers(线段树区间更新)
A Simple Problem with Integers Time Limit: 5000MS Memory Limit: 131072K Total Submissions: 112228 ...
- jvm(1)类的加载(三)(线程上下文加载器)
简介: 类加载器从 JDK 1.0 就出现了,最初是为了满足 Java Applet 的需要而开发出来的. Java Applet 需要从远程下载 Java 类文件到浏览器中并执行. 现在类加载器在 ...
- Canvas+Js制作动量守恒的小球碰撞
目的:通过js实现小球碰撞并实现动量守恒 canvas我们就不多说了,有用着呢. 我们可以通过canvas画2D图形(圆.方块.三角形等等)3D图形(球体.正方体等待). 当然这只是基础的皮毛而已,c ...
- iOS 11 application 新特性
1.- (void)applicationWillResignActive:(UIApplication *)application 说明:当应用程序将要入非活动状态执行,在此期间,应用程序不接收消息 ...
- POJ 2301
#include<iostream> #include<stdio.h> using namespace std; int main() { //freopen("a ...
- js03
我们接着来学习js的一些基础知识点. 1.document: document是window对象的一个属性.window对象表示浏览器中打开的窗口.如果文档包含框架(frame或者iframe),浏览 ...