Thread: Error, ld returned 1 exit status while installing a tool in ubonto

  1. #1
    Registered User
    Join Date
    Jan 2016
    Posts
    1

    Lightbulb Error, ld returned 1 exit status while installing a tool in ubonto

    hi,
    i typed make command to install a program on ubuntu but i got this error:

    make -C latbin
    make[1]: Entering directory `/usr/local/bin/Kaldi/kaldi-svn-archive-master/src/latbin'
    g++ -rdynamic -Wl,-rpath=/usr/local/bin/Kaldi/kaldi-svn-archive-master/tools/openfst/lib lattice-reverse.o ../lat/kaldi-lat.a ../lm/kaldi-lm.a ../hmm/kaldi-hmm.a ../tree/kaldi-tree.a ../util/kaldi-util.a ../matrix/kaldi-matrix.a ../thread/kaldi-thread.a ../base/kaldi-base.a -L/usr/local/bin/Kaldi/kaldi-svn-archive-master/tools/openfst/lib -lfst /usr/lib/libatlas.so.3 /usr/lib/libf77blas.so.3 /usr/lib/libcblas.so.3 /usr/lib/liblapack_atlas.so.3 -lm -lpthread -ldl -o lattice-reverse
    lattice-reverse.o: In function `main':
    /home/tjr/kaldi-trunk/src/latbin/lattice-reverse.cc:44: undefined reference to `kaldi::ParseOptions::NumArgs()'
    /home/tjr/kaldi-trunk/src/latbin/lattice-reverse.cc:49: undefined reference to `kaldi::ParseOptions::GetArg(int)'
    /home/tjr/kaldi-trunk/src/latbin/lattice-reverse.cc:50: undefined reference to `kaldi::ParseOptions::GetArg(int)'
    collect2: error: ld returned 1 exit status
    make[1]: *** [lattice-reverse] Error 1
    Code:
     
    this is the lattice-reverse.cc code: 
     
    #include "base/kaldi-common.h" 
    #include "util/common-utils.h" 
    #include "fstext/fstext-lib.h" 
    #include "lat/kaldi-lattice.h" 
    //#include "lat/lattice-functions.h" 
     
    int main(int argc, char *argv[]) { 
    try { 
    using namespace kaldi; 
    typedef kaldi::int32 int32; 
    typedef kaldi::int64 int64; 
    using fst::VectorFst; 
    using fst::StdArc; 
     
    const char *usage = 
    "Time reversal of compact lattice and write out as lattice\n" 
    "Usage: lattice-reverse [options] lattice-rspecifier lattice-wspecifier\n" 
    " e.g.: lattice-reverse ark:1.lats ark:1.reverse.lats\n"; 
     
    ParseOptions po(usage); 
     
    po.Read(argc, argv); 
     
    if (po.NumArgs() != 2) { 
    po.PrintUsage(); 
    exit(1); 
    } 
     
    std::string lats_rspecifier = po.GetArg(1), 
    lats_wspecifier = po.GetArg(2); 
     
    SequentialCompactLatticeReader clat_reader(lats_rspecifier); 
     
    // Write as compact lattice. 
    CompactLatticeWriter compact_lat_writer(lats_wspecifier); 
     
    int32 n_done = 0; 
     
    for (; !clat_reader.Done(); clat_reader.Next()) { 
    std::string key = clat_reader.Key(); 
    CompactLattice clat = clat_reader.Value(); 
    clat_reader.FreeCurrent(); 
     
    Lattice lat; 
    ConvertLattice(clat, &lat); 
    Lattice reverse_lat; 
    fst::Reverse(lat, &reverse_lat); 
    RemoveEpsLocal(&reverse_lat); 
    CompactLattice reverse_clat; 
    ConvertLattice(reverse_lat, &reverse_clat); 
    RemoveEpsLocal(&reverse_clat); 
     
    compact_lat_writer.Write(key, reverse_clat); 
    n_done++; 
    } 
    KALDI_LOG << "Done converting " << n_done << " to best path"; 
    return (n_done != 0 ? 0 : 1); 
    } catch(const std::exception &e) { 
    std::cerr << e.what(); 
    return -1; 
    } 
    }
    please help me to solve this error.
    thanks

  2. #2
    Ticked and off
    Join Date
    Oct 2011
    Location
    La-la land
    Posts
    1,728
    This is a link-time error: the linker cannot find the implementation of the listed functions anywhere (in the compiled object files (.o) and object archives (.a) specified). Did you check that the referred to libraries and objects exist?
    /usr/local/bin/Kaldi/kaldi-svn-archive-master/src/lat/kaldi-lat.a
    /usr/local/bin/Kaldi/kaldi-svn-archive-master/src/lat/lm/kaldi-lm.a
    /usr/local/bin/Kaldi/kaldi-svn-archive-master/src/lat/hmm/kaldi-hmm.a
    /usr/local/bin/Kaldi/kaldi-svn-archive-master/src/lat/tree/kaldi-tree.a
    /usr/local/bin/Kaldi/kaldi-svn-archive-master/src/lat/util/kaldi-util.a
    /usr/local/bin/Kaldi/kaldi-svn-archive-master/src/lat/matrix/kaldi-matrix.a
    /usr/local/bin/Kaldi/kaldi-svn-archive-master/src/lat/thread/kaldi-thread.a
    /usr/local/bin/Kaldi/kaldi-svn-archive-master/src/lat/base/kaldi-base.a

    It looks like you tried a shortcut, to compile only the latbin component of the project, but that is not going to work: it relies on all those other parts in the project, and you need to compile the entire thing to get it to compile right.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Id returned 1 exit status
    By swathi.s in forum C Programming
    Replies: 6
    Last Post: 07-07-2015, 09:23 AM
  2. collect2.exe: error: ld returned 1 exit status
    By umutefiloglu in forum C Programming
    Replies: 4
    Last Post: 05-11-2014, 09:37 AM
  3. collect2: ld returned 1 exit status error??
    By blindchicken11 in forum C Programming
    Replies: 11
    Last Post: 11-07-2011, 08:38 PM
  4. Getting an error with OpenGL: collect2: ld returned 1 exit status
    By Lorgon Jortle in forum C++ Programming
    Replies: 6
    Last Post: 05-08-2009, 08:18 PM
  5. ERROR collect2: ld returned 1 exit status
    By meili100 in forum C++ Programming
    Replies: 13
    Last Post: 12-04-2007, 12:20 PM