日期:2014-05-16  浏览次数:20947 次

用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〉