Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Linking error fontconfig on Ubuntu, dedicated server #8823

Closed
miltschek opened this issue Mar 8, 2021 · 2 comments
Closed

Linking error fontconfig on Ubuntu, dedicated server #8823

miltschek opened this issue Mar 8, 2021 · 2 comments

Comments

@miltschek
Copy link

Version of OpenTTD

1.11.beta2

Expected result

Successful compilation.

Actual result

ld: multiple definition of `SetFallbackFont...`
ld: undefined reference to `FcInit'

Steps to reproduce

wget https://github.com/OpenTTD/OpenTTD/archive/1.11.0-beta2.tar.gz
tar -xvf 1.11.0-beta2.tar.gz
mkdir build
cd build
cmake -DOPTION_DEDICATED:STRING=1 ..
make

Temporary workaround

Step one

src/fontcache.cpp:738
from:

bool SetFallbackFont(FreeTypeSettings *settings, const char *language_isocode, int winlangid, MissingGlyphSearcher *callback); { return false; }

to:

extern bool SetFallbackFont(FreeTypeSettings *settings, const char *language_isocode, int winlangid, MissingGlyphSearcher *callback);

Step two

after a failed build go to
build/CMakeFiles/openttd.dir/link.txt
and add the param
-lfontconfig

Did not have time to find the actual reason of the issue - sorry.

Environment

Ubuntu 20.04 64bit
apt-get update
# GNU Make 4.2.1
apt install make
# cmake version 3.16.3
apt install cmake
# gcc (Ubuntu 9.3.0-17ubuntu120.04) 9.3.0
# g++ (Ubuntu 9.3.0-17ubuntu1
20.04) 9.3.0
apt install gcc g++
# doxygen 1.8.17 (complains about a missing dot - ignored)
apt install doxygen
# zlib 1.2.11
apt install zlib1g-dev
# lzma 5.2.4
apt install liblzma-dev
# lzo2 2.0.0
apt install liblzo2-dev
# png 16.37.0
apt install libpng-dev
# allegro 5.2.6
apt install liballegro4-dev
# freetype 6.17.1
apt install libfreetype-dev
# SDL2 2.0.10+dfsg1-3
apt install libsdl2-dev
# fluidsynth 2.3.1
apt install libfluidsynth-dev
# fontconfig 1.12.0
apt install libfontconfig1-dev
# ICU 66.1
apt install libicu-dev
# GRF 6.0.6-4build1
apt install grfcodec

@LordAro
Copy link
Member

LordAro commented Mar 8, 2021

Duplicate of #8800 (already fixed)

@LordAro LordAro closed this as completed Mar 8, 2021
@TrueBrain
Copy link
Member

Wow, what a detailed report :D Very nice!

You can use our latest nightly or master if you like, which as @LordAro mentioned has the problem fixed, but the clients connecting would also need to use it. Otherwise, you have to wait a bit for us to release the next version :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants