各位老兄帮忙了!写makefile进行编译程序时,找不到iostream map vector
在Linux下用stl的类需要用到iostream map vector这些类库,
我编了一个最简单的hello程序,就能找到iostream。
hello.cpp:
#include <iostream>
int main()
{
cout<< " hello "<< endl
}
Makefile:
LD = ld
AR = ar
RM = rm
CP = cp
CC = gcc -E
CPP = g++
all:hello
hello:hello.o
$(CPP) -o hello hello.o
hello.o:hello.cpp
$(CPP) -c hello.cpp
而我自己的程序里的Makefile试这样写的:
STL_INL=-I../stl
CFLAG =$(STL_INL) -I../MyDoc -c
TRGTLIB = MyLib.a
OBJS=1x.o 2x.o
$(TRGTLIB) : $(OBJS)
$(AR) r $(TRGTLIB) *.o
$(CP) $(TRGTLIB) ..\..\lib
.SUFFIXES: .s .c .cpp .o .a .out
.c.o :
$(CC) $(CFLAG) -o $*.o $*.c
.s.o:
$(AS) $(AFLAG) -o $*.o $*.s
clean:
$(RM) *.o
$(RM) $(TRGTLIB)
请问高手:为什么我的程序找不到?