Menu

Cannot file -lantlr

Help
2016-02-09
2016-02-10
  • Phil Rosenberg

    Phil Rosenberg - 2016-02-09

    Hi
    I am building on Cygwin. I have just reported a bug regarding M_PI, but if I fix that then I get an error during linking

    make[3]: Entering directory '/usr/local/src/nco/src/nco++'
    /bin/sh ../../libtool --tag=CXX --tag=CXX --mode=link g++ -g -O2 -L../nco -lnco -lantlr -L/usr/lib -lnetcdf -o ncap2.exe Invoke.o ncap2.o ncap2_utl.o sdo_utl.o sym_cls.o fmc_cls.o fmc_all_cls.o fmc_gsl_cls.o prs_cls.o NcapVar.o NcapVarVector.o ncoLexer.o ncoParser.o ncoTree.o nco_gsl.o -ludunits2 -lexpat -lresolv -lintl -lm -lnetcdf -lnetcdf -lnetcdf -lcurl -ludunits2
    libtool: link: g++ -g -O2 -o .libs/ncap2.exe Invoke.o ncap2.o ncap2_utl.o sdo_utl.o sym_cls.o fmc_cls.o fmc_all_cls.o fmc_gsl_cls.o prs_cls.o NcapVar.o NcapVarVector.o ncoLexer.o ncoParser.o ncoTree.o nco_gsl.o -L../nco /usr/local/src/nco/src/nco/.libs/libnco.a -L/usr/lib -lantlr -lexpat -lresolv -lintl -lnetcdf -lcurl -ludunits2 -fopenmp
    /usr/lib/gcc/x86_64-pc-cygwin/4.9.3/../../../../x86_64-pc-cygwin/bin/ld: cannot find -lantlr
    collect2: error: ld returned 1 exit status
    Makefile:493: recipe for target 'ncap2.exe' failed
    make[3]: *** [ncap2.exe] Error 1
    make[3]: Leaving directory '/usr/local/src/nco/src/nco++'
    Makefile:382: recipe for target 'all-recursive' failed
    make[2]: *** [all-recursive] Error 1
    make[2]: Leaving directory '/usr/local/src/nco/src'
    Makefile:444: recipe for target 'all-recursive' failed
    make[1]: *** [all-recursive] Error 1
    make[1]: Leaving directory '/usr/local/src/nco'
    Makefile:376: recipe for target 'all' failed
    make: *** [all] Error 2

    my libantlr.a file is in /usr/local/lib as I had to build it from source. If I caopy it to /usr/lib, then the build works fine. Given that ./configure appeared to find antlr fine, I guess antlr should be found correctly in the original location.

     
  • Charlie Zender

    Charlie Zender - 2016-02-09

    I agree. Try
    export LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:'/usr/local/lib'
    cz

     
    • Phil Rosenberg

      Phil Rosenberg - 2016-02-10

      That seems to work, I had tried
      LDFLAGS="-L/usr/local/lib" make
      Which I had thought was equivalent but obviously not. I also thought /usr/local/lib would be searched anyway. Oh, well you know know what they say about assumtions...

      Thanks for the help
      Phil

       

Log in to post a comment.

MongoDB Logo MongoDB