tomassedovic / tcod-rs

Rust bindings for libtcod 1.6.3 (the Doryen library/roguelike toolkit)
Do What The F*ck You Want To Public License
228 stars 45 forks source link

Cannot build on Antegros Linux #288

Closed EralpCelebi closed 5 years ago

EralpCelebi commented 5 years ago
  = note: "cc" "-Wl,--as-needed" "-Wl,-z,noexecstack" "-m64" "-L" "/home/eralp/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib" "/home/eralp/Codes/Rust/test2/target/debug/deps/test2-edffb4c11d52145d.17avbr6m4tgnebgh.rcgu.o" "/home/eralp/Codes/Rust/test2/target/debug/deps/test2-edffb4c11d52145d.1i0dpxzd6urazmyy.rcgu.o" "/home/eralp/Codes/Rust/test2/target/debug/deps/test2-edffb4c11d52145d.1ns3gnuctqdjv9ko.rcgu.o" "/home/eralp/Codes/Rust/test2/target/debug/deps/test2-edffb4c11d52145d.1s6icq4dbkl3n09e.rcgu.o" "/home/eralp/Codes/Rust/test2/target/debug/deps/test2-edffb4c11d52145d.30yv88pup3n8a4ko.rcgu.o" "/home/eralp/Codes/Rust/test2/target/debug/deps/test2-edffb4c11d52145d.37jmeyn16oirazjd.rcgu.o" "/home/eralp/Codes/Rust/test2/target/debug/deps/test2-edffb4c11d52145d.3mrn8atmgzehavte.rcgu.o" "/home/eralp/Codes/Rust/test2/target/debug/deps/test2-edffb4c11d52145d.4g81oxqoermpirv2.rcgu.o" "/home/eralp/Codes/Rust/test2/target/debug/deps/test2-edffb4c11d52145d.4zffp4tb2v7wddd3.rcgu.o" "/home/eralp/Codes/Rust/test2/target/debug/deps/test2-edffb4c11d52145d.afxdj38tqyq35rt.rcgu.o" "/home/eralp/Codes/Rust/test2/target/debug/deps/test2-edffb4c11d52145d.hehwu40x2vn61cs.rcgu.o" "/home/eralp/Codes/Rust/test2/target/debug/deps/test2-edffb4c11d52145d.t9bzsbcthapoxoe.rcgu.o" "-o" "/home/eralp/Codes/Rust/test2/target/debug/deps/test2-edffb4c11d52145d" "/home/eralp/Codes/Rust/test2/target/debug/deps/test2-edffb4c11d52145d.asa1woamuvxwnm0.rcgu.o" "-Wl,--gc-sections" "-pie" "-Wl,-zrelro" "-Wl,-znow" "-nodefaultlibs" "-L" "/home/eralp/Codes/Rust/test2/target/debug/deps" "-L" "/home/eralp/Codes/Rust/test2/target/debug/build/tcod-sys-86f38c8095f34fd1/out" "-L" "/usr/lib" "-L" "/home/eralp/Codes/Rust/test2/target/debug/build/tcod-sys-86f38c8095f34fd1/out" "-L" "/home/eralp/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib" "-Wl,-Bstatic" "/home/eralp/Codes/Rust/test2/target/debug/deps/libtcod-64be57a909571c22.rlib" "/home/eralp/Codes/Rust/test2/target/debug/deps/libtcod_sys-2047bdb8c559a91e.rlib" "/home/eralp/Codes/Rust/test2/target/debug/deps/liblazy_static-413acabfe4abac7f.rlib" "/home/eralp/Codes/Rust/test2/target/debug/deps/libbitflags-9d93ebba08c806ab.rlib" "-Wl,--start-group" "/home/eralp/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libstd-e0b6e478e9762da9.rlib" "/home/eralp/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libpanic_unwind-765c392663bd34b7.rlib" "/home/eralp/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libbacktrace_sys-1059e0ba7f05fd67.rlib" "/home/eralp/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/librustc_demangle-85b43da92537c77f.rlib" "/home/eralp/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libunwind-f8a77019eff82b98.rlib" "/home/eralp/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/liblibc-1d32a47a0bdcb0a2.rlib" "/home/eralp/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/liballoc-c47e11e0b4c869e2.rlib" "/home/eralp/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/librustc_std_workspace_core-5a60e280b382f06e.rlib" "/home/eralp/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libcore-8010f7064010be9c.rlib" "-Wl,--end-group" "/home/eralp/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libcompiler_builtins-566972fa63f867ee.rlib" "-Wl,-Bdynamic" "-lSDL2" "-ltcod" "-ldl" "-lrt" "-lpthread" "-lgcc_s" "-lc" "-lm" "-lrt" "-lpthread" "-lutil" "-lutil"
  = note: /usr/bin/ld: /home/eralp/Codes/Rust/test2/target/debug/build/tcod-sys-86f38c8095f34fd1/out/libtcod.a(sys_sdl_c.o): in function `TCOD_sys_load_font':
          /home/eralp/.cargo/registry/src/github.com-1ecc6299db9ec823/tcod-sys-5.0.0/libtcod/src/sys_sdl_c.c:204: undefined reference to `SDL_FreeSurface'
          /usr/bin/ld: /home/eralp/.cargo/registry/src/github.com-1ecc6299db9ec823/tcod-sys-5.0.0/libtcod/src/sys_sdl_c.c:235: undefined reference to `SDL_UpperBlit'
          /usr/bin/ld: /home/eralp/.cargo/registry/src/github.com-1ecc6299db9ec823/tcod-sys-5.0.0/libtcod/src/sys_sdl_c.c:236: undefined reference to `SDL_FreeSurface'
          /usr/bin/ld: /home/eralp/.cargo/registry/src/github.com-1ecc6299db9ec823/tcod-sys-5.0.0/libtcod/src/sys_sdl_c.c:266: undefined reference to `SDL_UpperBlit'
          /usr/bin/ld: /home/eralp/.cargo/registry/src/github.com-1ecc6299db9ec823/tcod-sys-5.0.0/libtcod/src/sys_sdl_c.c:267: undefined reference to `SDL_FreeSurface'
          /usr/bin/ld: /home/eralp/.cargo/registry/src/github.com-1ecc6299db9ec823/tcod-sys-5.0.0/libtcod/src/sys_sdl_c.c:305: undefined reference to `SDL_UpperBlit'
          /usr/bin/ld: /home/eralp/.cargo/registry/src/github.com-1ecc6299db9ec823/tcod-sys-5.0.0/libtcod/src/sys_sdl_c.c:306: undefined reference to `SDL_FreeSurface'
          /usr/bin/ld: /home/eralp/.cargo/registry/src/github.com-1ecc6299db9ec823/tcod-sys-5.0.0/libtcod/src/sys_sdl_c.c:338: undefined reference to `SDL_MapRGB'
          /usr/bin/ld: /home/eralp/.cargo/registry/src/github.com-1ecc6299db9ec823/tcod-sys-5.0.0/libtcod/src/sys_sdl_c.c:342: undefined reference to `SDL_SetColorKey'
          /usr/bin/ld: /home/eralp/Codes/Rust/test2/target/debug/build/tcod-sys-86f38c8095f34fd1/out/libtcod.a(sys_sdl_c.o): in function `TCOD_sys_console_to_bitmap':
          /home/eralp/.cargo/registry/src/github.com-1ecc6299db9ec823/tcod-sys-5.0.0/libtcod/src/sys_sdl_c.c:437: undefined reference to `SDL_UpperBlit'
          /usr/bin/ld: /home/eralp/.cargo/registry/src/github.com-1ecc6299db9ec823/tcod-sys-5.0.0/libtcod/src/sys_sdl_c.c:467: undefined reference to `SDL_MapRGB'
          /usr/bin/ld: /home/eralp/.cargo/registry/src/github.com-1ecc6299db9ec823/tcod-sys-5.0.0/libtcod/src/sys_sdl_c.c:468: undefined reference to `SDL_FillRect'
          /usr/bin/ld: /home/eralp/.cargo/registry/src/github.com-1ecc6299db9ec823/tcod-sys-5.0.0/libtcod/src/sys_sdl_c.c:496: undefined reference to `SDL_MapRGB'
          /usr/bin/ld: /home/eralp/.cargo/registry/src/github.com-1ecc6299db9ec823/tcod-sys-5.0.0/libtcod/src/sys_sdl_c.c:593: undefined reference to `SDL_UpperBlit'
          /usr/bin/ld: /home/eralp/Codes/Rust/test2/target/debug/build/tcod-sys-86f38c8095f34fd1/out/libtcod.a(sys_sdl_c.o): in function `TCOD_sys_startup':
          /home/eralp/.cargo/registry/src/github.com-1ecc6299db9ec823/tcod-sys-5.0.0/libtcod/src/sys_sdl_c.c:660: undefined reference to `SDL_Init'
          /usr/bin/ld: /home/eralp/Codes/Rust/test2/target/debug/build/tcod-sys-86f38c8095f34fd1/out/libtcod.a(sys_sdl_c.o): in function `TCOD_sys_shutdown':
          /home/eralp/.cargo/registry/src/github.com-1ecc6299db9ec823/tcod-sys-5.0.0/libtcod/src/sys_sdl_c.c:675: undefined reference to `SDL_Quit'
          /usr/bin/ld: /home/eralp/Codes/Rust/test2/target/debug/build/tcod-sys-86f38c8095f34fd1/out/libtcod.a(sys_sdl_c.o): in function `TCOD_sys_load_player_config':
          /home/eralp/.cargo/registry/src/github.com-1ecc6299db9ec823/tcod-sys-5.0.0/libtcod/src/sys_sdl_c.c:726: undefined reference to `SDL_FreeSurface'
          /usr/bin/ld: /home/eralp/Codes/Rust/test2/target/debug/build/tcod-sys-86f38c8095f34fd1/out/libtcod.a(sys_sdl_c.o): in function `TCOD_sys_delete_bitmap':
          /home/eralp/.cargo/registry/src/github.com-1ecc6299db9ec823/tcod-sys-5.0.0/libtcod/src/sys_sdl_c.c:1559: undefined reference to `SDL_FreeSurface'
          /usr/bin/ld: /home/eralp/Codes/Rust/test2/target/debug/build/tcod-sys-86f38c8095f34fd1/out/libtcod.a(sys_sdl_c.o): in function `TCOD_sys_check_magic_number':
          /home/eralp/.cargo/registry/src/github.com-1ecc6299db9ec823/tcod-sys-5.0.0/libtcod/src/sys_sdl_c.c:1598: undefined reference to `SDL_RWFromFile'
          /usr/bin/ld: /home/eralp/Codes/Rust/test2/target/debug/build/tcod-sys-86f38c8095f34fd1/out/libtcod.a(sys_sdl_img_bmp.o): in function `TCOD_sys_read_bmp':
          /home/eralp/.cargo/registry/src/github.com-1ecc6299db9ec823/tcod-sys-5.0.0/libtcod/src/sys_sdl_img_bmp.c:41: undefined reference to `SDL_RWFromFile'
          /usr/bin/ld: /home/eralp/.cargo/registry/src/github.com-1ecc6299db9ec823/tcod-sys-5.0.0/libtcod/src/sys_sdl_img_bmp.c:41: undefined reference to `SDL_LoadBMP_RW'
          /usr/bin/ld: /home/eralp/.cargo/registry/src/github.com-1ecc6299db9ec823/tcod-sys-5.0.0/libtcod/src/sys_sdl_img_bmp.c:42: undefined reference to `SDL_GetError'
          /usr/bin/ld: /home/eralp/.cargo/registry/src/github.com-1ecc6299db9ec823/tcod-sys-5.0.0/libtcod/src/sys_sdl_img_bmp.c:56: undefined reference to `SDL_CreateRGBSurface'

This goes on. It cannot link some object files even tho I have them installed ( even SDL Libraries) Considering the output there might be an issue with the installation of the library but I am not sure.

raum-dellamorte commented 5 years ago

Also also cannot link in Manjaro, so I suspect it's happening in Arch distros. My error is virtually identical.

'0.12.1' works with tcod-sys '4.1.0'

When trying to compile '0.13.0' or '0.14.0' with tcod-sys '5.0.0' it uses crate cc '1.0.37', but '0.12.1' with tcod-sys '4.1.0' uses crates libc '0.2.58' and gcc '0.3.55'. Seems like a start.

donlema commented 5 years ago

I am having the same issue on Linx Mint 19.1. I get the exact same error messages when working through the tutorial at:

http://tomassedovic.github.io/roguelike-tutorial/part-1-graphics.html

If needed, I can post my results as well but the error messages look to be identical.

EralpCelebi commented 5 years ago

I think there is a problem with the library paths being different on different distros. I'll take a look when I have the time as well.

dkaste commented 5 years ago

Builds are failing on Travis as well due to what appears to be the same issue.

lucanLepus commented 5 years ago

build fails for me on Arch linux as well. however it seems only the static build is broken, so you should be able to workaround by adding

[dependencies.tcod-sys]
version = "*"
features = ["dynlib"]

to your Cargo.toml

tomassedovic commented 5 years ago

Adding this to your Cargo.toml should fix this now:

tcod = { git = "https://github.com/tomassedovic/tcod-rs" }

I'll publish it to crates.io shortly

EralpCelebi commented 5 years ago

Will try whenever I can