Download your favorite Linux distribution at LQ ISO.
Go Back > Forums > Linux Forums > Linux - Software
User Name
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.


  Search this Thread
Old 12-28-2015, 05:23 AM   #1
LQ Newbie
Registered: Aug 2012
Posts: 4

Rep: Reputation: Disabled
Error: ld returned 1 exit status

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/ /usr/lib/ /usr/lib/ /usr/lib/ -lm -lpthread -ldl -o lattice-reverse
lattice-reverse.o: In function `main':
/home/tjr/kaldi-trunk/src/latbin/ undefined reference to `kaldi::ParseOptions::NumArgs()'
/home/tjr/kaldi-trunk/src/latbin/ undefined reference to `kaldi::ParseOptions::GetArg(int)'
/home/tjr/kaldi-trunk/src/latbin/ undefined reference to `kaldi::ParseOptions::GetArg(int)'
collect2: error: ld returned 1 exit status
make[1]: *** [lattice-reverse] Error 1

this is the 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) {

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();

Lattice lat;
ConvertLattice(clat, &lat);
Lattice reverse_lat;
fst::Reverse(lat, &reverse_lat);
CompactLattice reverse_clat;
ConvertLattice(reverse_lat, &reverse_clat);

compact_lat_writer.Write(key, reverse_clat);
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.
Old 12-28-2015, 09:08 AM   #2
Registered: Mar 2011
Location: USA
Distribution: MINT Debian, Angstrom, SUSE, Ubuntu, Debian
Posts: 8,457
Blog Entries: 13

Rep: Reputation: 3774Reputation: 3774Reputation: 3774Reputation: 3774Reputation: 3774Reputation: 3774Reputation: 3774Reputation: 3774Reputation: 3774Reputation: 3774Reputation: 3774
I'm wondering how you went from this directory:
to end up compiling:
For starters I would not be in the /usr/local directory as a non-root user, building code. I also would not be doing that as root either. Seems like a set of utilities needs to be compiled or installed so that you can use it as part of writing your own code, presumably There should be a readme or other file provided to inform you how to set that up.

The compiler here is complaining about lines 44, 49, and 50 in your source

The complaint is indicating that it is not seeing these external references. Thus the include file for them is not properly referenced. Since the compiler is not complaining about a bad include file path or name, then my conclusion is that you are missing an include reference which will resolve those functions.

I'd search the source tree for H files which provide the references for those functions.
Old 01-06-2016, 01:53 PM   #3
LQ Newbie
Registered: Aug 2012
Posts: 4

Original Poster
Rep: Reputation: Disabled
thanks for your response,
could you please explain more?
because i'm beginner


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] collect2: error: ld returned 1 exit status shogun1234 Programming 4 05-30-2019 02:09 PM
[SOLVED] glibc 6.9.1 make error - ld returned 1 exit status JulianD Linux From Scratch 5 01-29-2015 02:23 AM
Error Message : collect2: ld returned 1 exit status biplabbijay Programming 1 11-26-2009 06:46 PM
Error: collect 2: ld returned 1 exit status Rituparna Linux - Software 11 06-25-2009 03:54 PM
konstruct error collect2: ld returned 1 exit status X2O Linux - Software 2 08-11-2004 09:48 PM > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 08:52 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration