News:

Simutrans.com Portal
Our Simutrans site. You can find everything about Simutrans from here.

/usr/bin/ld: cannot find -libus-1.0

Started by gulli, November 20, 2021, 11:46:14 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

gulli

Not sure if I'm posting in the right forum, please move to the correct one if not.

I'm trying to build the latest Simutrans from Subversion on Fedora 35 but I get this error after building for a while:


===> HOSTCXX sound/sdl2_sound.cc
===> LD  /home/gulli/compile/simutrans/trunk/sim
/usr/bin/ld: cannot find -libus-1.0
collect2: error: ld returned 1 exit status


I can't find any library named libus to install but I did find libusb-1.0, installed it and tried building again with no luck. Anyone have an idea what I need to do to fix this?

Thanks!

prissi

libusb is certainly not needed, what is missing is libibus-1.0: https://packages.debian.org/sid/libibus-1.0-dev  I think this most likely comes from SDL2. Maybe reinstall libSDL2-dev

How did you set up the environment? Did you use ./configure?

gulli

I used autoconf && ./configure and then make.

libibus-1.0 is already installed, I reinstalled the ibus-libs package that provides it but that made no difference. I installed the ibus-devel package as well but still no luck.

I switched to building with cmake by following the instructions in the link below and that completed the build:
https://simutrans-germany.com/wiki/wiki/en_CompilingSimutrans#Compiling_with_CMake

Now when running it it complains that it can't find fonts. I know I'm missing some step in the process but I can't find any information about getting the fonts simutrans needs.
Is there any page that has all the steps to build and setup all needed dependencies? The pak downloader is pretty easy to use but I guess something similar exists somewhere for the fonts but I'm just not finding it.

prissi

Strange, cmake and make should use the same. The only difference is how they may configure the libaries.

The build is successful, but simutrans tries to load everything from the build directory. To start a debug build, you need to pass ./simutrans -set_workdir /games/simutrans or wherever the game data is installed. Alternatively you can the distribution, but that strips the debug symbols.

Roboron

Quote from: gulli on November 21, 2021, 11:09:55 AMNow when running it it complains that it can't find fonts.

The fonts, music, and other game data is on trunk/simutrans/simutrans directory. If compiling with cmake the "--target install" option will copy this directory to the binary directory so you don't have to.

prissi

I think that strips the symbols as well although I have never tested this. If not, it should do so for non-debug builds at least ...

gulli

Quote from: Roboron on November 21, 2021, 02:30:22 PM
The fonts, music, and other game data is on trunk/simutrans/simutrans directory. If compiling with cmake the "--target install" option will copy this directory to the binary directory so you don't have to.

Thanks! That worked perfectly.


gulli

Quote from: prissi on November 21, 2021, 11:52:32 AM
Strange, cmake and make should use the same. The only difference is how they may configure the libaries.

Yes, that's what I thought. Can't figure out why one works and the other doesn't.