我是一个新手,遇到了一个问题! 我需要使用一个C++代码,并且不知道如何在Eclipse中导入和编译它(我已经成功通过命令行编译了它)。 这个代码有一个特定的结构,并且组织方式如下:
repos____lib____configure (execute the configure file inside the libraries folders)
I I___makefile (execute the make file inside the libraries folders,
requires make/make.def)
I I___ib1____.cpp
I I I____.h
I ... I____configure (it requires make/configure_lib and
make/configure_includes
I ... I____makefile (generated by configure)
I I___lib2___....
i I___.......
I I___libn____.cpp
i I____.h
i I____configure
i I____makefile (generated by configure)
I
I___make(folder)__bashrc (are set the some environment variables)
I I__configure_bin
I I__configure_includes
I I__configure_lib
I I__make.def (are set all the include path and library path used
I in the configure file)
I___application__main.cpp
I__configure
I__makefile(generated by the configure file)
为了确保你理解我的问题...(确保...:))
第一个配置文件是:
cd lib1; ./configure
cd ../lib2; ./configure
.....
....
cd ../libn; ./configure
cd
第一个 Makefile 文件是:
include /media/Dati/WORKHOME/repos/make/make.def
这是整个库的Makefile文件
lib:
make -C lib1
make -C lib2
make -C libn
配置文件示例(位于lib1内部的文件):
#!/usr/bin/perl
$INC = '$(OPENCVINC) $(FLTKINC) $(DC1394V2INC)'; ##<-DEFINED IN /make.def
$LIB = '$(OPENCVLIB) $(FLTKLIB) $(DC1394V2LIB)'; #####################
#-------------------------------------------------------------------------------
require '/media/Dati/WORKHOME/repos/make/configure_lib';
print "Created Makefile.\n";
# this will create a include file for the whole directory,
# using the template <dirname>.h.templ
require '/media/Dati/WORKHOME/repos/make/configure_includes';
print "Created $libname.h\n";
在没有使用Eclipse的情况下,简单地编译它:
- 进入lib文件夹,键入./configure
- 键入make
- 进入应用程序文件夹
- 键入./configure
- 键入make
- 运行程序
我的问题是......在Eclipse中怎么做?我已经使用“导入/导入现有代码”将这三个项目作为Makefile项目导入了,但现在我不知道如何编译它。你能帮我吗?这很重要!
非常感谢 gabriele