我正在尝试使用Ubuntu 14.04在我的机器上用C / C ++编写的旧项目添加一个新的二进制文件。首先,我需要运行运行以下脚本的./setup_configure
:
#!/bin/tcsh -f
2
3 # For a new dev/ environment, before running configure,
4 # and anytime after a Makefile.am file has changed,
5 # the following commands must be executed within the
6 # dev/ directory:
7
8 set cmd1=(rm -rf autom4te.cache)
9 if ( "`uname -s`" == "Darwin" ) then
10 set cmd2=(glibtoolize --force)
11 else
12 #set cmd2=(libtoolize --force)
13 set cmd2=(libtoolize -f -v)
14 endif
15 set cmd3=(aclocal)
16 #automake --add-missing is necessary because config.sub
17 # and config.guess are links, and make not be present,
18 # so if missing, --add-missing will add them for this
19 # platform
20 #set cmd4=(automake --add-missing -Wno-portability)
21 set cmd4=(automake -a -c)
22 set cmd5=(autoreconf --force -Wno-portability)
23 #automake Note: autoreconf --force runs automake
24 set cmd6=(autoconf -Wno-portability)
25
26 echo $cmd1
27 $cmd1
28 if ($status) exit $status
29 echo $cmd2
30 $cmd2
31 if ($status) exit $status
32 echo $cmd3
33 $cmd3
34 if ($status) exit $status
35 echo $cmd4
36 $cmd4
37 #if ($status) exit $status
38 echo $cmd5
39 $cmd5
40 if ($status) exit $status
41 echo $cmd6
42 $cmd6
43 if ($status) exit $status
44
45 # The first three commands create the platform specific
46 # tools needed by configure (use glibtoolize on the Mac
47 # in place of libtoolize). These platform specific tools
48 # are placed in the dev/config directory.
49 # Autoreconf --force and automake create the Makefile.in
50 # files from the Makefile.am files in each directory.
51 # Following successful execution of these commands, the
52 # configure command can be executed.
53
然后我需要运行./configure。因为我不想将整个项目cd
编译到我添加并运行make
的新子目录中,但是,该过程并不顺利,并以下列错误结束:
/bin/bash ../libtool --tag=CC --mode=link g++ -I../include -L/usr/lib64 -L/usr/X11R6/lib64 -L/opt/mni_library/lib -L/opt/vxl/build/lib -o mri_segment_ms mri_segment_ms.o ../utils/libutils.a ../fsgdf/libfsgdf.a ../rgb/librgb.a ../unix/libunix.a ../dicom/libdicom.a ../hipsstubs/libhipsstubs.a ../log/liblog.a ../xml2/libxml2.a ../jpeg/libjpeg.a ../tiff/libtiff.a ../expat/libexpat.a -lz -lm -lcrypt -ldl -lpthread -lnetcdf -lvolume_io -lminc -lvnl_algo -lvnl -lvcl -lnetlib -lv3p_netlib
../libtool: line 469: CDPATH: command not found
libtool: Version mismatch error. This is libtool 2.4.2 Debian-2.4.2-1.7ubuntu1, but the
libtool: definition of this LT_INIT comes from an older release.
libtool: You should recreate aclocal.m4 with macros from libtool 2.4.2 Debian-2.4.2-1.7ubuntu1
libtool: and run autoconf again.
make: *** [mri_segment_ms] Error 63
我发现很多Q& As关于互联网上的类似问题,其中大多数建议用户运行autoreconf -ivf
。 Stackoverflow here和here中还有一个全面的答案。我已经执行了所有建议的步骤,遗憾的是问题仍然存在。我想知道是否有人能给我一个提示。
编辑:如果我从整个项目的根目录尝试make
,就会发生同样的事情。