Qtox: Unable to compile qTox by following new instructions on Fedora

Created on 28 May 2018  路  8Comments  路  Source: qTox/qTox

OS

OS: Fedora 28
qTox version: Nightly

Brief Description

On a brand new Fedora 28 install after installing all dependencies, attempting to compile qTox by following the instructions fails with the error this person had - It references being unable to find any of the toxcore libraries that were just compiled in the previous step (since they are compiled before qTox is).

If the following post in the thread is used to compile instead of the current instructions (additional commands such as 'autoreconf -if' and './configure --prefix="/usr/"'), it compiles correctly and is able to locate all of the necessary libraries/files.

Reproducible: Always

Steps to reproduce

Attempt to compile following the install instructions for Fedora

Additional Info

I think there was a recent change to the instructions - here - which might be the cause. The fix I linked that @hchr found seems to be very close to the previous way to install.

M-docs

Most helpful comment

@ezavod If I do

$ LD_LIBRARY_PATH=/usr/local/lib64/
$ export LD_LIBRARY_PATH

It lets me start qTox with no issues now.

Before I set that variable it was blank (echoing it showed nothing) which I'm assuming means it would have only been checking the standard library locations (/lib and /usr/lib for 32 bit and /lib64 and /usr/lib64 for 64 bit) plus /usr/local/lib/ I think since that's where it was told to look

But probably it is best to use lib64 instead of lib in all occurrences.

I changed the line from the current instructions

echo '/usr/local/lib/' | sudo tee -a /etc/ld.so.conf.d/locallib.conf

to

echo '/usr/local/lib64/' | sudo tee -a /etc/ld.so.conf.d/locallib.conf

And that also fixes it.

Since it puts the libraries in /usr/local/lib64/ instead of /usr/local/lib/ (or /usr/lib64/), should that be changed in the instructions (assuming that's where they're supposed to be put)?

All 8 comments

As explained in another comment from that issue, you should use cmake to compile toxcore: https://github.com/qTox/qTox/issues/5067#issuecomment-382807659. You are getting this error, because you are using autoreconf, which is not valid anymore. That's why build instructions were updated (the change that you linked to). Try this (from https://github.com/qTox/qTox/blob/master/INSTALL.md):

git clone https://github.com/toktok/c-toxcore.git toxcore
cd toxcore
git checkout v0.2.2
cmake .
make -j$(nproc)
sudo make install
echo '/usr/local/lib/' | sudo tee -a /etc/ld.so.conf.d/locallib.conf

I am getting the error when I don't use autoreconf, which works, at least on my new Fedora 28 stable install. When I use the code you referenced (cmake) it doesn't work and I get the error regarding missing dependencies.

Commenting out the cmake (current instructions) and changing it to what he did (autoreconf) fixes it. Maybe the

./configure --prefix="/usr/"

has something to do with the fix and is required for being able to find the libraries from the previous steps?

Using the current instructions and changing line 4 of your quote to the following also solves the missing dependency errors for me:

cmake .
to
cmake -DCMAKE_INSTALL_PREFIX=/usr .

Nevermind, that only makes it compile successfully. When running the binary I get the error "qtox: symbol lookup error: qtox: undefined symbol: toxav_get_tox"

So changing it back to his method of compiling is the only way I've been able to compile successfully.

May be unrelated, but I had similar problems due to upgrading toxcore.
I'm using openSUSE Tumbleweed 64bit.

@Marty665 The following worked for me:

  1. Remove all the toxcore files you could find with sudo find /usr -name "*tox*"
  2. Probably best to start from scratch. Get latest toxcore (I used d8efdf17) and build:
    ```
    mkdir _build && cd _build
    cmake ..
    make
    sudo make install
    ````
  3. Optional: Check if the files printed last by the command above are present.
  4. Get latest qTox (I used 22f7f958edbb213cf5e9e86da5083c1813ea916f) and build.

@ezavod I deleted the files created by toxcore like you suggested then did some more testing. Using your code to compile toxcore completes successfully, and places toxcore libraries in /usr/local/lib64 and some tox .h files in /usr/local/include/tox.

Both toxcore and qtox appear to compile successfully, and get to 100%.

However, when starting qTox the error "qtox: error while loading shared libraries: libtoxcore.so.2: cannot open shared object file: No such file or directory" occurs.

I then tried the current instructions again, which now seems to compile the binaries correctly, and get the same libtoxcore.so no such file error when running it. libtoxcore.so appears to exist in my /usr/local/lib64 directory, is that where it should be?

Here is how I am compiling exactly

(export PKG_CONFIG_PATH="$PKG_CONFIG_PATH:/usr/local/lib/pkgconfig" makes no difference in the result)

Is something supposed to be in /usr/local/lib because of echo '/usr/local/lib/' | sudo tee -a /etc/ld.so.conf.d/locallib.conf? Because the only thing in that folder is an empty pkgconfig folder.

Here are the final output lines when compiling toxcore
Install the project... -- Install configuration: "" -- Installing: /usr/local/lib64/libtoxcore.so.2.2.0 -- Installing: /usr/local/lib64/libtoxcore.so.2 -- Installing: /usr/local/lib64/libtoxcore.so -- Installing: /usr/local/lib64/libtoxcore.a -- Installing: /usr/local/lib64/pkgconfig/toxcore.pc -- Installing: /usr/local/include/tox/tox.h -- Installing: /usr/local/include/tox/toxav.h -- Installing: /usr/local/include/tox/toxencryptsave.h /usr/local/lib/

@Marty665

is that where it should be?

Yes, that's the correct location (assuming that you have a 64bit OS).

Is something supposed to be in /usr/local/lib because of echo '/usr/local/lib/' | sudo tee -a /etc/ld.so.conf.d/locallib.conf?

No, I have nothing there and I do not execute those commands.
But probably it is best to use lib64 instead of lib in all occurrences.

Here are the final output lines when compiling toxcore

Make sure that all of them exist and that you have sufficient permissions.

If this doesn't work, it is probably something weird happening with your OS that I'm unable to reproduce.
Maybe try adding the path to LD_LIBRARY_PATH, but thats just guessing (see here for instructions).

@ezavod If I do

$ LD_LIBRARY_PATH=/usr/local/lib64/
$ export LD_LIBRARY_PATH

It lets me start qTox with no issues now.

Before I set that variable it was blank (echoing it showed nothing) which I'm assuming means it would have only been checking the standard library locations (/lib and /usr/lib for 32 bit and /lib64 and /usr/lib64 for 64 bit) plus /usr/local/lib/ I think since that's where it was told to look

But probably it is best to use lib64 instead of lib in all occurrences.

I changed the line from the current instructions

echo '/usr/local/lib/' | sudo tee -a /etc/ld.so.conf.d/locallib.conf

to

echo '/usr/local/lib64/' | sudo tee -a /etc/ld.so.conf.d/locallib.conf

And that also fixes it.

Since it puts the libraries in /usr/local/lib64/ instead of /usr/local/lib/ (or /usr/lib64/), should that be changed in the instructions (assuming that's where they're supposed to be put)?

@Marty665 It seems that the new toxcore version discriminates between 32bit and 64bit by changing the path. Probably good to add this to the instructions. Would you mind to create a PR?

Was this page helpful?
0 / 5 - 0 ratings