Проблемы с компиляцией Open Surge в Linux Mint 17 x86_64: пропуск несовместимых библиотек

Я использую Linux Mint 17 x86_64 и получаю следующие предупреждения при компиляции модифицированной библиотеки Alfont для игры с открытым исходным кодом Open Surge (на основе библиотеки Allegro):

danil@linuxmint ~/opensnc-code-opensurge/alfont $ gcc -fPIC -DPIC -O2 -m32 -Iinclude `freetype-config --cflags` -o src/alfont.o -c src/alfont.csrc/alfont.c: In function ‘alfont_ugetx’:
src/alfont.c:3765:4: warning: passing argument 1 of ‘ugetxc’ from incompatible pointer type [enabled by default]
    ugetxc((char**)s);
    ^
src/alfont.c:3765:4: note: expected ‘const char **’ but argument is of type ‘char **’
src/alfont.c:3767:2: warning: passing argument 1 of ‘ugetxc’ from incompatible pointer type [enabled by default]
  ugetxc((char**)s);
  ^
src/alfont.c:3767:2: note: expected ‘const char **’ but argument is of type ‘char **’
src/alfont.c:3771:2: warning: passing argument 1 of ‘ugetxc’ from incompatible pointer type [enabled by default]
  ugetxc(&lpszWS);
  ^
src/alfont.c:3771:2: note: expected ‘const char **’ but argument is of type ‘char **’
src/alfont.c:3773:2: warning: passing argument 1 of ‘ugetxc’ from incompatible pointer type [enabled by default]
  ugetxc(&lpszWS);
  ^
src/alfont.c:3773:2: note: expected ‘const char **’ but argument is of type ‘char **’
src/alfont.c:3818:2: warning: passing argument 1 of ‘ugetxc’ from incompatible pointer type [enabled by default]
  ugetxc((char**)s);
  ^
src/alfont.c:3818:2: note: expected ‘const char **’ but argument is of type ‘char **’
src/alfont.c:3820:2: warning: passing argument 1 of ‘ugetxc’ from incompatible pointer type [enabled by default]
  ugetxc((char**)s);
  ^
src/alfont.c:3820:2: note: expected ‘const char **’ but argument is of type ‘char **’
src/alfont.c: In function ‘alfont_ugetxc’:
src/alfont.c:4087:2: warning: passing argument 1 of ‘ugetxc’ from incompatible pointer type [enabled by default]
  ugetxc(&lpszWS);
  ^
src/alfont.c:4087:2: note: expected ‘const char **’ but argument is of type ‘char **’
src/alfont.c:4089:2: warning: passing argument 1 of ‘ugetxc’ from incompatible pointer type [enabled by default]
  ugetxc(&lpszWS);
  ^
src/alfont.c:4089:2: note: expected ‘const char **’ but argument is of type ‘char **’

Я думаю, что эти проблемы не очень серьезные. Но на следующем шаге я получаю следующие ошибки:

danil@linuxmint ~/opensnc-code-opensurge/alfont $ gcc -O2 -m32 -shared -Wl,-soname,libalfont.so.2 -o libalfont.so.2.0.9 src/alfont.o `freetype-config --libs` `allegro-config --libs |sed 's/-lalleg_unsharable//'`
/usr/bin/ld: skipping incompatible /usr/lib/x86_64-linux-gnu/libfreetype.so when searching for -lfreetype
/usr/bin/ld: skipping incompatible /usr/lib/x86_64-linux-gnu/libfreetype.a when searching for -lfreetype
/usr/bin/ld: skipping incompatible /usr/lib/x86_64-linux-gnu/libfreetype.so when searching for -lfreetype
/usr/bin/ld: skipping incompatible /usr/lib/x86_64-linux-gnu/libfreetype.a when searching for -lfreetype
/usr/bin/ld: cannot find -lfreetype
/usr/bin/ld: skipping incompatible /usr/lib/x86_64-linux-gnu/libz.so when searching for -lz
/usr/bin/ld: skipping incompatible /usr/lib/x86_64-linux-gnu/libz.a when searching for -lz
/usr/bin/ld: skipping incompatible /usr/lib/x86_64-linux-gnu/libz.so when searching for -lz
/usr/bin/ld: skipping incompatible /usr/lib/x86_64-linux-gnu/libz.a when searching for -lz
/usr/bin/ld: cannot find -lz
/usr/bin/ld: skipping incompatible /usr/lib/x86_64-linux-gnu/libpng12.so when searching for -lpng12
/usr/bin/ld: skipping incompatible /usr/lib/x86_64-linux-gnu/libpng12.a when searching for -lpng12
/usr/bin/ld: skipping incompatible /usr/lib/x86_64-linux-gnu/libpng12.so when searching for -lpng12
/usr/bin/ld: skipping incompatible /usr/lib/x86_64-linux-gnu/libpng12.a when searching for -lpng12
/usr/bin/ld: cannot find -lpng12
/usr/bin/ld: skipping incompatible /usr/lib/x86_64-linux-gnu/liballeg.so when searching for -lalleg
/usr/bin/ld: skipping incompatible /usr/lib/x86_64-linux-gnu/liballeg.so when searching for -lalleg
/usr/bin/ld: cannot find -lalleg
/usr/bin/ld: skipping incompatible /usr/lib/x86_64-linux-gnu/libc.so when searching for -lc
/usr/bin/ld: skipping incompatible /usr/lib/x86_64-linux-gnu/libc.a when searching for -lc
/usr/bin/ld: skipping incompatible /usr/lib/x86_64-linux-gnu/libc.so when searching for -lc
/usr/bin/ld: skipping incompatible /usr/lib/x86_64-linux-gnu/libc.a when searching for -lc
collect2: error: ld returned 1 exit status

Подскажите пожалуйста, как исправить эти ошибки с несовместимыми библиотеками?


person Daniel Dushistov    schedule 22.10.2014    source источник


Ответы (1)


Ваша проблема в том, что вы пытаетесь скомпилировать 32-битный двоичный файл в 64-битной системе.

Одним из решений может быть вместо этого скомпилировать 64-битный двоичный файл, чтобы можно было использовать ваши родные 64-битные библиотеки.

Если вам по какой-то причине нужно скомпилировать это как 32-битный двоичный файл, вам нужно будет убедиться, что вы установили все необходимые 32-битные библиотеки. Вы также должны убедиться, что ваши программы freetype-config и allegro-config указывают на ваши 32-битные версии библиотек.

person Henrik Carlqvist    schedule 22.10.2014
comment
Благодарю вас! Я изменил флаг -m32 на -m64 в командах, которые я использовал для компиляции проекта, и это работает! - person Daniel Dushistov; 24.10.2014