title: libtool version mismatch error persists after running `autoreconf -fvi`
body: <p>I'm trying to add a new binary to an old project written in C/C++ on my machine with Ubuntu 14.04. First I need to run <code>./setup_configure</code> which runs the following script:</p>
  
  <pre><code>  #!/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 
  </code></pre>
  
  <p>and afterwards I need to run ./configure. Since I do not want to compile the whole project I <code>cd</code> into the new sub-directory I have added and run <code>make</code>, however, the process does not go smoothly and ends with the following error:</p>
  
  <pre><code>/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
  </code></pre>
  
  <p>I have found lots of Q&amp;As regarding a similar problem over internet, most of which suggest the user to run <code>autoreconf -ivf</code>. There is also a comprehensive answer in Stackoverflow <a href="https://stackoverflow.com/questions/3096989/libtool-version-mismatch-error">here</a> and <a href="https://stackoverflow.com/questions/10085554/libtool-version-mismatch">here</a>. I have performed all the suggested steps, unfortunately the problem persists. I was wondering whether anyone could give me a hint.</p>
  
  <p>EDIT: the same thing happens if I try to <code>make</code> from root directory of the whole project.</p>