首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 操作系统 > UNIXLINUX >

用g++ 编译c++ 时为何有些头文件找不到,有些却能找到?该怎么解决

2012-03-01 
用g++ 编译c++ 时为何有些头文件找不到,有些却能找到?test.cpp的前部分文件:#includeiostream#includei

用g++ 编译c++ 时为何有些头文件找不到,有些却能找到?
test.cpp的前部分文件:
#include   <iostream>
#include   <iomanip>
#include   <fstream>
#include   <string>
#include   <math>
#include   <stdio>
#include   <stdlib>
#include   <ctype>
#include   <float>
#include   <string>
#include   <stdarg>
using     namespace     std;
-----------------------------------------
然后编译
#g++   -o   test   test.cpp
显示错误:
test.cpp:3:16:   error:   math:   没有那个文件或目录
test.cpp:7:17:   error:   stdio:   没有那个文件或目录
test.cpp:8:18:   error:   stdlib:   没有那个文件或目录
test.cpp:9:17:   error:   ctype:   没有那个文件或目录
test.cpp:10:17:   error:   float:   没有那个文件或目录
test.cpp:12:18:   error:   stdarg:   没有那个文件或目录
------------------------
为什么有的头文件能找到而有的找不到?
而且math.h就在目录   /usr/include/math.h,这是什么原因?

我是初学者,请各位高手帮忙!谢谢!


[解决办法]
找不到的,你就用
〈xxx.h〉

热点排行