The International Simutrans Forum

 

Author Topic: /usr/bin/ld: cannot find -libus-1.0  (Read 360 times)

0 Members and 1 Guest are viewing this topic.

Offline gulli

  • *
  • Posts: 2
/usr/bin/ld: cannot find -libus-1.0
« on: November 20, 2021, 11:46:14 PM »
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:

Code: [Select]
===> 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!

Offline prissi

  • Developer
  • Administrator
  • *
  • Posts: 10976
  • Languages: De,EN,JP
Re: /usr/bin/ld: cannot find -libus-1.0
« Reply #1 on: November 21, 2021, 08:10:51 AM »
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?

Offline gulli

  • *
  • Posts: 2
Re: /usr/bin/ld: cannot find -libus-1.0
« Reply #2 on: November 21, 2021, 11:09:55 AM »
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.

Offline prissi

  • Developer
  • Administrator
  • *
  • Posts: 10976
  • Languages: De,EN,JP
Re: /usr/bin/ld: cannot find -libus-1.0
« Reply #3 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.

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.

Offline Roboron

  • Devotee
  • *
  • Posts: 364
    • Las Gal├ícticas Aventuras de Komoyo Diga
  • Languages: ES, EN
Re: /usr/bin/ld: cannot find -libus-1.0
« Reply #4 on: November 21, 2021, 02:30:22 PM »
Now 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.

Offline prissi

  • Developer
  • Administrator
  • *
  • Posts: 10976
  • Languages: De,EN,JP
Re: /usr/bin/ld: cannot find -libus-1.0
« Reply #5 on: November 22, 2021, 12:14:07 AM »
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 ...