Hi, everyone, new to rust here.
Spent my Christmas holidays playing with Rust
Havenât done anything that geeky since highschool, haha.
I gotta say, this borrowing business is hard.
Anyway, I have decided to try interfacing with lua and I was trying out
J.C. Moyerâs lua crate, unfortunately I just couldnât get lua 5.3 to build on my windows machine so I decided to create a 5.2.4 version and try it on my computer instead.
Now that I managed to get the crate built, I still canât seem to be able to use it in a project.
Hereâs the linker error I get when I executed cargo build
[quote] error: linking with
gcc` failed: exit code: 1
note: âgccâ â-Wl,âenable-long-section-namesâ â-fno-use-linker-pluginâ â-Wl,ânxcompatâ â-static-libgccâ â-m64â â-Lâ
âC:\Program Files\Rust stable 1.5\bin\rustlib\x86_64-pc-windows-gnu\libâ
âC:\users\swu\Documents\rust\lua-test\target\debug\lua_test.0.oâ â-oâ
âC:\users\swu\Documents\rust\lua-test\target\debug\lua_test.exeâ
"-Wl,âgc-sections" â-Lâ âC:\users\swu\Documents\rust\lua-test\target\debugâ â-Lâ
âC:\users\swu\Documents\rust\lua-test\target\debug\depsâ â-Lâ
âC:\users\swu\documents\rust\lua-test\target\debug\build\lua-7a33874f268c5b07\out/lua-5.2.4/srcâ â-Lâ
âC:\Program Files\Rust stable 1.5\bin\rustlib\x86_64-pc-windows-gnu\libâ â-Lâ
âC:\users\swu\Documents\rust\lua-test\.rust\bin\x86_64-pc-windows-gnuâ â-Lâ
âC:\users\swu\Documents\rust\lua-test\bin\x86_64-pc-windows-gnuâ â-Wl,-Bstaticâ â-Wl,-Bdynamicâ
âC:\Users\swu\Documents\rust\lua-test\target\debug\deps\liblua-7a33874f268c5b07.rlibâ
âC:\Users\swu\Documents\rust\lua-test\target\debug\deps\liblibc-29adb837ec836726.rlibâ
âC:\Users\swu\Documents\rust\lua-test\target\debug\deps\libbitflags-dd68b8369bcd8ff0.rlibâ
âC:\Program Files\Rust stable 1.5\bin\rustlib\x86_64-pc-windows-gnu\lib\libstd-35c36e89.rlibâ
âC:\Program Files\Rust stable 1.5\bin\rustlib\x86_64-pc-windows-gnu\lib\libcollections-35c36e89.rlibâ
âC:\Program Files\Rust stable 1.5\bin\rustlib\x86_64-pc-windows-gnu\lib\librustc_unicode-35c36e89.rlibâ
âC:\Program Files\Rust stable 1.5\bin\rustlib\x86_64-pc-windows-gnu\lib\librand-35c36e89.rlibâ
âC:\Program Files\Rust stable 1.5\bin\rustlib\x86_64-pc-windows-gnu\lib\liballoc-35c36e89.rlibâ
âC:\Program Files\Rust stable 1.5\bin\rustlib\x86_64-pc-windows-gnu\lib\liballoc_jemalloc-35c36e89.rlibâ
âC:\Program Files\Rust stable 1.5\bin\rustlib\x86_64-pc-windows-gnu\lib\liblibc-35c36e89.rlibâ
âC:\Program Files\Rust stable 1.5\bin\rustlib\x86_64-pc-windows-gnu\lib\libcore-35c36e89.rlibâ
"-l" âws2_32â â-lâ âuserenvâ â-lâ âadvapi32â â-lâ âcompiler-rtâ[/quote]
Should I not see -l lua somewhere?
Anyway, hereâs the error I got from rust
Iâve never really done too much with gcc, so Iâm not sure if linking was done correctly here, it looked like when I built the interface package, it did have -l static=lua at the end.
So Iâm wondering, how do I know if I built the crate properly? Is this something I need to fix in the test-project?
EDIT (UPDATE)
So I finally managed to build the jcmoyer version using the git url in dependency, it still gives me the same linker error.
Does this mean I didnât set up lua correctly instead of a lua thing?
Thank you