Compilation error: undefined reference to `libiconv'

Linux specific questions, problems.
dma8hm1956

Compilation error: undefined reference to `libiconv'

Post by dma8hm1956 »

Dear all,
Hi
I am trying to install `qbittorrent-2.2.10' on Slackware 13.0.
I have installed `libtorrent-rasterbar-0.15.1' successfully, but when I want to install `qbittorrent',
the `make' command exists with the following error: {{{
/usr/local/Libtorrent_rasterbar/lib/libtorrent-rasterbar.so: undefined reference to `libiconv_open'
/usr/local/Libtorrent_rasterbar/lib/libtorrent-rasterbar.so: undefined reference to `boost::filesystem::detail::copy_file_api(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, bool)'
/usr/local/Libtorrent_rasterbar/lib/libtorrent-rasterbar.so: undefined reference to `libiconv'
collect2: ld returned 1 exit status
make[1]: *** [qbittorrent] Error 1
make[1]: Leaving directory `/tmp/SB/qbittorrent/qbittorrent-2.2.10/src'
make: *** [sub-src-make_default] Error 2
}}}

Any help would be gratefully appreciated.

Thanks - Hossein
DasFox

Re: [LINUX] Compilation error: undefined reference to `libic

Post by DasFox »

Hey a fellow Slacker, WoOT! ;)

Well I run 13.1 but it's the same as far as compiling.

On Slackbuilds it shows that you need QT4 and libtorrent-rasterbar but it also looks like you need libiconv that's why you are getting that error message, or do you have it installed?

Are you building it by hand or using a slackbuild? Either way if you don't have libiconv installed I believe you run by hand or in your slackbuild, CFLAGS=-liconv
dma8hm1956

Re: [LINUX] Compilation error: undefined reference to `libic

Post by dma8hm1956 »

Hi DasFox
I am building qbittorrent by hand. But I have also tried the SlackBuild from http://www.slackbuild.org.
I have already installed QT4, libtorrent-rasterbar, libiconv.
I have also tried CFLAGS=-liconv and EXTRA_CFLAGS=-liconv.
But none of them work.

Thanks - Hossein
DasFox

Re: [LINUX] Compilation error: undefined reference to `libic

Post by DasFox »

Are you trying to build the latest version form source?

So you ran ./configure CFLAGS=-liconv ?
dma8hm1956

Re: [LINUX] Compilation error: undefined reference to `libic

Post by dma8hm1956 »

Hello,
I am using `qbittorrent-2.2.10' and `libtorrent-rasterbar-0.15.0' and I run:
./configure
make CFLAGS=-liconv

Thanks
Hossein
DasFox

Re: [LINUX] Compilation error: undefined reference to `libic

Post by DasFox »

[quote=""dma8hm1956""]Hello,
I am using `qbittorrent-2.2.10' and `libtorrent-rasterbar-0.15.0' and I run:
./configure
make CFLAGS=-liconv

Thanks
Hossein[/quote]


Ok are you using any ./configure flags at all? Check ./configure --help to see what there is.

SO you want to run the command in the ./configure like this:

./configure CFLAGS=-liconv

I've compiled for many years, I'm not a PRO that knows everything but my understanding is there are no flags you give to 'make' you simply run 'make' by itself...

By the way if make runs now ok, don't just install this into your system by hand, use or make a slackbuild if you know how. The simplest way is to take the one on slackbuild and modify it.

http://slackbuilds.org/slackbuilds/13.0 ... SlackBuild

So in the slackbuild you'll see the configure line like this:

./configure

THEN change it like this:

./configure CFLAGS=-liconv
dma8hm1956

Re: [LINUX] Compilation error: undefined reference to `libic

Post by dma8hm1956 »

Hello,

The command `./configure CFLAGS=-liconv' exits with an error message on my system.
Basically if CFLAGS is not defined in Makefile, `./configure; CFLAGS=-liconv make' does
the same thing as you said.

I also tried to compile qbittorrent using the slackbuild from
`http://slackbuilds.org/slackbuilds/13.0 ... SlackBuild'
changing `./configure to `./configure CFLAGS=-liconv ',
but it exits with the same error message.

The output of `./configure --help' is: {{{
Usage: ./configure [OPTION]...

This script creates necessary configuration files to build/install.

Main options:
--prefix=[path] Base path for build/install. Default: /usr/local
--bindir=[path] Directory for binaries. Default: PREFIX/bin
--datadir=[path] Directory for data. Default: PREFIX/share
--qtdir=[path] Directory where Qt is installed.
--verbose Show extra configure output.
--help This help text.

Dependency options:
--disable-gui Disable qBittorrent Graphical user
interface for headless running
--with-libboost-inc=[path] Path to libboost include files
--with-libboost-lib=[path] Path to libboost library files
--disable-libnotify Disable use of libnotify
--disable-geoip-database Disable use of geoip-database
--with-geoip-database-embedded Geoip Database will be embedded in
qBittorrent executable (please follow
instructions in src/geoip/README)
}}}

Thanks - Hossein
User avatar
Peter
Administrator
Administrator
Posts: 2693
Joined: Wed Jul 07, 2010 6:14 pm

Re: [LINUX] Compilation error: undefined reference to `libic

Post by Peter »

Well..
It was some time in the past.. but when I was using make/./configure (was using Gentoo as main OS), I had to write CFLAGS at the first part.

So:
CFLAGS=-liconv ./configure --prefix=/usr
CFLAGS=-liconv make -j6
sudo make install

And so on. But ..are you sure "-liconv" is a valid flag?
(Currently my PC is in pieces, I have my Lenovo T500 with Win7 and without VMWare so I can't really be too much help..)

Also WAIT. If I remember clearly, -liconv means it WON'T USE IT! Like -bluetooth -cups and so on. I had make flags like this.
So in my theory:
CFLAGS=liconv ./configure --prefix=/usr

Maybe. Or try editing the configure file by hand. Search for "CFLAGS" part and put it there. It works. :) But check if its "liconv" or "libiconv" or whatever.
dma8hm1956

Re: [LINUX] Compilation error: undefined reference to `libic

Post by dma8hm1956 »

Hello shiki,

I tried `CFLAGS=liconv ./configure --prefix=/usr; make' and `CFLAGS=libiconv ./configure --prefix=/usr; make'
and both of them exits with the same error message as mentioned in the first message. If the complete log file
(about 185 KB) is of any help, I may send it to you.

Thanks - Hossein
DasFox

Re: [LINUX] Compilation error: undefined reference to `libic

Post by DasFox »

Just out of curiosity try compiling v2.3.0rc2 and uninstall liconv and make sure you re using libtorrent-rasterbar: v0.14.10.

After you uninstall liconv, make sure to run as root, 'ldconfig' minus the quotes. :)

I compiled v2.3.0rc2 on 13.1 with only libtorrent-rasterbar: v0.14.10, I don't have liconv installed.
User avatar
Peter
Administrator
Administrator
Posts: 2693
Joined: Wed Jul 07, 2010 6:14 pm

Re: [LINUX] Compilation error: undefined reference to `libic

Post by Peter »

Just paste the logfile to pastebin.com or you can attach it here also. Feel free to use the in-built stuff, the forum if here to help the users. Just Upload Attachment and there you go.
christophe.dumez

Re: [LINUX] Compilation error: undefined reference to `libic

Post by christophe.dumez »

To force qbittorrent to link againt liconv, you should edit src/src.pro file.

Simply add the following line in it:
LIBS += -liconv

Then rerun configure:
./configure && make

Note that you might need to add another one for boost according to your output.
dma8hm1956

Re: [LINUX] Compilation error: undefined reference to `libic

Post by dma8hm1956 »

Hi DasFox

I did everything exactly as you said. This time the error message is: {{{

/usr/local/Python/lib/libtorrent-rasterbar.so: undefined reference to `boost::filesystem::detail::copy_file_api(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, bool)'
collect2: ld returned 1 exit status
make[1]: *** [qbittorrent] Error 1
make[1]: Leaving directory `/tmp/SB/qbittorrent/qbittorrent-2.3.0rc2/src'
make: *** [sub-src-make_default] Error 2

}}}

Please note that the `boost' package is installed on my system.

Thanks - Hossein
dma8hm1956

Re: [LINUX] Compilation error: undefined reference to `libic

Post by dma8hm1956 »

Hi Shiki,

[quote=""shiki""]Just paste the logfile to pastebin.com or you can attach it here also...[/quote]

I couldn't paste the log file to `pastebin.com' and I don't know how to attach it
to my message here. Do you mean to copy and paste it here?

Thanks - Hossein
dma8hm1956

Re: [LINUX] Compilation error: undefined reference to `libic

Post by dma8hm1956 »

Hello christophe.dumez,

[quote=""christophe.dumez""]To force qbittorrent to link againt liconv, you should edit src/src.pro file.

Simply add the following line in it:
LIBS += -liconv

Then rerun configure:
./configure && make

Note that you might need to add another one for boost according to your output.[/quote]

Adding the line `LIBS += -liconv' to `src/src.pro' fixes the problem related to `libiconv', but still
there was an error message about boost. So I added the following line to `src/src.pro' to fix it, but it didn't work.
LIBS += -liconv -lboost_system-mt -lboost_filesystem-mt -lboost_thread-mt

The error message is:{{{

/usr/local/Python/lib/libtorrent-rasterbar.so: undefined reference to `boost::filesystem::detail::copy_file_api(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, bool)'
collect2: ld returned 1 exit status
make[1]: *** [qbittorrent] Error 1
make[1]: Leaving directory `/tmp/SB/qbittorrent/qbittorrent-2.2.10/src'
make: *** [sub-src-make_default] Error 2

}}}

Please note that I am using `qbittorrent-2.2.10' and `libtorrent-rasterbar-0.15.0'.

Thanks - Hossein
Post Reply