Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have run this in a terminal.

git clone git://
cd libmtp

(answering yes to all questions)

But when I try to run the ./configure --prefix=/usr/ I get this error:

checking whether to build static libraries... yes

./configure: line 11739: AC_LIB_PREPARE_PREFIX: command not found

./configure: line 11740: AC_LIB_RPATH: command not found

./configure: line 11745: syntax error near unexpected token `iconv'

./configure: line 11745: `      AC_LIB_LINKFLAGS_BODY(iconv)'

I have built and installed the libiconv from here.

I do not know what to do, been trying for a few hours but I am pretty noob to Linux.

How can i fix this?

The lines 11739 to 11745 in the configure file looks like this:

share|improve this question

I ended up getting the tarball from here

then the package compiled without hassle.

had both iconv and gettext installed as detailed on GNU site.

share|improve this answer
apt-get install gettext
./ # this is the critical bit
share|improve this answer
Yes, that helped me, too. On Fedora: yum install gettext gettext-devel. Thanks a lot. – jogojapan Aug 24 '15 at 13:07

Hm... seems like there is a problem with the iconv installation. Could you take a look at this document and search for "iconv.m4"? There is a little section on how to use it with autotools.

Also, did you make sure that gettext is installed? (it should be)

sudo apt-get install gettext


share|improve this answer

Okay, I struggled with this for a few hours so I thought I'd share what I did to get the git install of libmtp to build.

The secret is to be sure to follow all of the instructions on the GNU libiconv page:


first libiconv, then gettext, then libiconv again,

This got the configure script for libmtp to run, but it didn't find iconv to be usable. Thus during make you would get something like:

libmtp.c: In function 'LIBMTP_Open_Raw_Device_Uncached':
libmtp.c:1854:17: error: 'PTPParams' has no member named 'cd_locale_to_ucs2'
libmtp.c:1854:3: warning: implicit declaration of function 'iconv_open' [-Wimplicit-> function-declaration]

To fix that:

$ export LD_PRELOAD=/usr/local/lib/

Then it built just fine.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.