标题:已知makefile如何设置编译环境?
只看楼主
theblur
Rank: 1
等 级:新手上路
帖 子:15
专家分:0
注 册:2006-8-29
 问题点数:0 回复次数:0 
已知makefile如何设置编译环境?
我在Linux下编C++程序,用编辑器、gcc加terminal来工作,但是深感查错和写makefile麻烦,现在迁到集成环境里,不知集成环境怎么设置?已知终端下的编译命令如下:
-------------------------------------------------
$ gcc -I/home/intel/opencv/include -L/home/intel/opencv/lib -lopencv -lhighgui -lstdc++ opencv0.c -o opencv0
-------------------------------------------------
或者相应的makefile如下:
-------------------------------------------------
CC = gcc -O2 #-march=i686 -mcpu=i686
INC = -I/home/intel/opencv/include/opencv # opencv include path
LIB = -L/home/intel/opencv/lib # opencv libs path
OPT = -lopencv -lhighgui -lstdc++ # standard libraries needed to link
BIN = opencv0 opencv1 # executables to create
all: $(BIN) # make all creates opencv0 and opencv1
opencv0: opencv0.c Makefile
$(CC) opencv0.c $(INC) $(LIB) $(OPT) -o $@
opencv1: opencv1.c Makefile
$(CC) opencv1.c $(INC) $(LIB) $(OPT) -o $@
clean:
rm *˜ *.o $(BIN) core
--------------------------------------------------
我使用eclipse的managed make c++ project,请问该如何设置?谢啦!!
搜索更多相关主题的帖子: makefile 环境 编译 
2006-09-03 05:26



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-87654-1-1.html




关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 1.218457 second(s), 7 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved