你源代码包含头文件的方式也要和你的CFLAGS的路径配合,举例:
1 源文件:#include <pcl/point_types.h> makefile: -I/test/ROS/ros/fuerte/include/
2 源文件:#include <point_types.h> makefile: -I/test/ROS/ros/fuerte/include/pcl
1 源文件:#include <pcl/point_types.h> makefile: -I/test/ROS/ros/fuerte/include/
2 源文件:#include <point_types.h> makefile: -I/test/ROS/ros/fuerte/include/pcl
ex:
VPATH=/home/tonyjian/bind
INCFLAG=-I/home/tonyjian/boost/bind
INCFLAG+=-I/home/tonyjian/boost/function
LIBFLAG=-lpthread
simulator:*.cpp *.hpp
g++ $(INCFLAG) $(LIBFLAG) -o simulator *.cpp
设置make查找依赖文件的路径的方法是:
用VPATH或者vpath等