NoraCodes / rust-mingw64-gtk-docker

Cross-build environment for Rust GTK+ apps from Linux to Windows.
Other
10 stars 2 forks source link

build fails at linking stage #2

Open synth-ruiner opened 3 years ago

synth-ruiner commented 3 years ago

I tried to build my gtk-rs program with this docker image, and it failed at the linking stage. not sure if I'm doing something wrong or if the image is out of date or something.

   Compiling lull v1.0.0 (/home/rustacean/src)
error: linking with `x86_64-w64-mingw32-gcc` failed: exit code: 1
  |
  = note: "x86_64-w64-mingw32-gcc" "-fno-use-linker-plugin" "-Wl,--nxcompat" "-m64" "-nostartfiles" "/usr/x86_64-w64-mingw32/sys-root/mingw/lib/crt2.o" "/home/rustacean/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-pc-windows-gnu/lib/rsbegin.o" "-L" "/home/rustacean/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-pc-windows-gnu/lib" "-L" "/home/rustacean/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-pc-windows-gnu/lib/self-contained" "/home/rustacean/src/target/x86_64-pc-windows-gnu/release/deps/lull-3cf108f848dab000.lull.cez2ifxd-cgu.0.rcgu.o" "/home/rustacean/src/target/x86_64-pc-windows-gnu/release/deps/lull-3cf108f848dab000.lull.cez2ifxd-cgu.1.rcgu.o" "/home/rustacean/src/target/x86_64-pc-windows-gnu/release/deps/lull-3cf108f848dab000.lull.cez2ifxd-cgu.10.rcgu.o" "/home/rustacean/src/target/x86_64-pc-windows-gnu/release/deps/lull-3cf108f848dab000.lull.cez2ifxd-cgu.11.rcgu.o" "/home/rustacean/src/target/x86_64-pc-windows-gnu/release/deps/lull-3cf108f848dab000.lull.cez2ifxd-cgu.12.rcgu.o" "/home/rustacean/src/target/x86_64-pc-windows-gnu/release/deps/lull-3cf108f848dab000.lull.cez2ifxd-cgu.13.rcgu.o" "/home/rustacean/src/target/x86_64-pc-windows-gnu/release/deps/lull-3cf108f848dab000.lull.cez2ifxd-cgu.14.rcgu.o" "/home/rustacean/src/target/x86_64-pc-windows-gnu/release/deps/lull-3cf108f848dab000.lull.cez2ifxd-cgu.15.rcgu.o" "/home/rustacean/src/target/x86_64-pc-windows-gnu/release/deps/lull-3cf108f848dab000.lull.cez2ifxd-cgu.2.rcgu.o" "/home/rustacean/src/target/x86_64-pc-windows-gnu/release/deps/lull-3cf108f848dab000.lull.cez2ifxd-cgu.3.rcgu.o" "/home/rustacean/src/target/x86_64-pc-windows-gnu/release/deps/lull-3cf108f848dab000.lull.cez2ifxd-cgu.4.rcgu.o" "/home/rustacean/src/target/x86_64-pc-windows-gnu/release/deps/lull-3cf108f848dab000.lull.cez2ifxd-cgu.5.rcgu.o" "/home/rustacean/src/target/x86_64-pc-windows-gnu/release/deps/lull-3cf108f848dab000.lull.cez2ifxd-cgu.6.rcgu.o" "/home/rustacean/src/target/x86_64-pc-windows-gnu/release/deps/lull-3cf108f848dab000.lull.cez2ifxd-cgu.7.rcgu.o" "/home/rustacean/src/target/x86_64-pc-windows-gnu/release/deps/lull-3cf108f848dab000.lull.cez2ifxd-cgu.8.rcgu.o" "/home/rustacean/src/target/x86_64-pc-windows-gnu/release/deps/lull-3cf108f848dab000.lull.cez2ifxd-cgu.9.rcgu.o" "-o" "/home/rustacean/src/target/x86_64-pc-windows-gnu/release/deps/lull-3cf108f848dab000.exe" "-Wl,--subsystem" "-Wl,windows" "/home/rustacean/src/target/x86_64-pc-windows-gnu/release/deps/lull-3cf108f848dab000.4sail2w08xvh5sf7.rcgu.o" "-Wl,--gc-sections" "-nodefaultlibs" "-L" "/home/rustacean/src/target/x86_64-pc-windows-gnu/release/deps" "-L" "/home/rustacean/src/target/release/deps" "-L" "/home/rustacean/.cargo/registry/src/github.com-1ecc6299db9ec823/winapi-x86_64-pc-windows-gnu-0.4.0/lib" "-L" "/home/rustacean/src/target/x86_64-pc-windows-gnu/release/build/minimp3-sys-009c99d0adc1de1d/out" "-L" "/home/rustacean/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-pc-windows-gnu/lib" "-Wl,-Bstatic" "/home/rustacean/src/target/x86_64-pc-windows-gnu/release/deps/libdirs-195564f9bb34352c.rlib" "/home/rustacean/src/target/x86_64-pc-windows-gnu/release/deps/libdirs_sys-c55ac299aaccac39.rlib" "/home/rustacean/src/target/x86_64-pc-windows-gnu/release/deps/librodio-8fc1021ce9a49e2d.rlib" "/home/rustacean/src/target/x86_64-pc-windows-gnu/release/deps/libminimp3-e4836e615238beae.rlib" "/home/rustacean/src/target/x86_64-pc-windows-gnu/release/deps/libslice_deque-399ff8787cb5a6b5.rlib" "/home/rustacean/src/target/x86_64-pc-windows-gnu/release/deps/libminimp3_sys-7c3fa70edb2bacb3.rlib" "/home/rustacean/src/target/x86_64-pc-windows-gnu/release/deps/liblewton-b2b5e8240fdf12f4.rlib" "/home/rustacean/src/target/x86_64-pc-windows-gnu/release/deps/libogg-1d7eb21c1516c465.rlib" "/home/rustacean/src/target/x86_64-pc-windows-gnu/release/deps/libtinyvec-636f5059dd64dbb9.rlib" "/home/rustacean/src/target/x86_64-pc-windows-gnu/release/deps/libbyteorder-2ffc3be3f84176fa.rlib" "/home/rustacean/src/target/x86_64-pc-windows-gnu/release/deps/libhound-189d897125a85118.rlib" "/home/rustacean/src/target/x86_64-pc-windows-gnu/release/deps/libcpal-a3784ff9567b3d53.rlib" "/home/rustacean/src/target/x86_64-pc-windows-gnu/release/deps/liblazy_static-34c2460089956ef6.rlib" "/home/rustacean/src/target/x86_64-pc-windows-gnu/release/deps/libclaxon-959877848bc92458.rlib" "/home/rustacean/src/target/x86_64-pc-windows-gnu/release/deps/libgtk-83c61a1f6da2159c.rlib" "/home/rustacean/src/target/x86_64-pc-windows-gnu/release/deps/libgdk-92492d90eab388e4.rlib" "/home/rustacean/src/target/x86_64-pc-windows-gnu/release/deps/libpango-8cde36eea48cd33e.rlib" "/home/rustacean/src/target/x86_64-pc-windows-gnu/release/deps/libgdk_pixbuf-9d90ab4fafc55f41.rlib" "/home/rustacean/src/target/x86_64-pc-windows-gnu/release/deps/libcairo-1141db7076a434b1.rlib" "/home/rustacean/src/target/x86_64-pc-windows-gnu/release/deps/libatk-a63a8bef56a1a360.rlib" "/home/rustacean/src/target/x86_64-pc-windows-gnu/release/deps/libgtk_sys-f222e946fef1870f.rlib" "/home/rustacean/src/target/x86_64-pc-windows-gnu/release/deps/libatk_sys-e9288772f6e3f8bf.rlib" "/home/rustacean/src/target/x86_64-pc-windows-gnu/release/deps/libgdk_sys-4c8cfa8eb3397f8e.rlib" "/home/rustacean/src/target/x86_64-pc-windows-gnu/release/deps/libpango_sys-b1ce80c3416b704b.rlib" "/home/rustacean/src/target/x86_64-pc-windows-gnu/release/deps/libgdk_pixbuf_sys-2b56bff8919054aa.rlib" "/home/rustacean/src/target/x86_64-pc-windows-gnu/release/deps/libcairo_sys-79ef38295866ca9f.rlib" "/home/rustacean/src/target/x86_64-pc-windows-gnu/release/deps/libgio-6d8a2265add00c32.rlib" "/home/rustacean/src/target/x86_64-pc-windows-gnu/release/deps/libfutures-b167ddb78bceac1a.rlib" "/home/rustacean/src/target/x86_64-pc-windows-gnu/release/deps/libthiserror-d93fc0159e989a9e.rlib" "/home/rustacean/src/target/x86_64-pc-windows-gnu/release/deps/libgio_sys-a76203363138e41a.rlib" "/home/rustacean/src/target/x86_64-pc-windows-gnu/release/deps/libwinapi-54fec42eddd1308b.rlib" "/home/rustacean/src/target/x86_64-pc-windows-gnu/release/deps/libglib-fefcf96c9552ea06.rlib" "/home/rustacean/src/target/x86_64-pc-windows-gnu/release/deps/libfutures_executor-b30917bec72d2c88.rlib" "/home/rustacean/src/target/x86_64-pc-windows-gnu/release/deps/libfutures_util-0a5eb176a4bfa94a.rlib" "/home/rustacean/src/target/x86_64-pc-windows-gnu/release/deps/libmemchr-ccd547503c5a5270.rlib" "/home/rustacean/src/target/x86_64-pc-windows-gnu/release/deps/libproc_macro_nested-a22497579ea830bd.rlib" "/home/rustacean/src/target/x86_64-pc-windows-gnu/release/deps/libfutures_io-03f008e56e980f6a.rlib" "/home/rustacean/src/target/x86_64-pc-windows-gnu/release/deps/libslab-1e7a548ba1ac5336.rlib" "/home/rustacean/src/target/x86_64-pc-windows-gnu/release/deps/libpin_project-8348dac6fe2d98e0.rlib" "/home/rustacean/src/target/x86_64-pc-windows-gnu/release/deps/libpin_utils-f59a88ff39af2fb7.rlib" "/home/rustacean/src/target/x86_64-pc-windows-gnu/release/deps/libfutures_task-089ad293a45649ad.rlib" "/home/rustacean/src/target/x86_64-pc-windows-gnu/release/deps/libfutures_channel-80b13296244e220e.rlib" "/home/rustacean/src/target/x86_64-pc-windows-gnu/release/deps/libfutures_sink-2accbc740a359ec1.rlib" "/home/rustacean/src/target/x86_64-pc-windows-gnu/release/deps/libfutures_core-696970a8107f4e6c.rlib" "/home/rustacean/src/target/x86_64-pc-windows-gnu/release/deps/libgobject_sys-266df7c165ffcbf1.rlib" "/home/rustacean/src/target/x86_64-pc-windows-gnu/release/deps/libglib_sys-3103cca5cd52817e.rlib" "/home/rustacean/src/target/x86_64-pc-windows-gnu/release/deps/liblibc-f181292daab53950.rlib" "/home/rustacean/src/target/x86_64-pc-windows-gnu/release/deps/libonce_cell-2cf34745470f174b.rlib" "/home/rustacean/src/target/x86_64-pc-windows-gnu/release/deps/libbitflags-1ee05281ab1fa2c8.rlib" "-Wl,--start-group" "/home/rustacean/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-pc-windows-gnu/lib/libstd-50ea3fb3c956c12d.rlib" "/home/rustacean/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-pc-windows-gnu/lib/libpanic_unwind-e4bffee6c31deeea.rlib" "/home/rustacean/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-pc-windows-gnu/lib/libhashbrown-9377f1576793955b.rlib" "/home/rustacean/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-pc-windows-gnu/lib/librustc_std_workspace_alloc-f494bbd31df0cee1.rlib" "/home/rustacean/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-pc-windows-gnu/lib/libbacktrace-665bf83caf0b100b.rlib" "/home/rustacean/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-pc-windows-gnu/lib/libbacktrace_sys-c19c337d9fcc898c.rlib" "/home/rustacean/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-pc-windows-gnu/lib/librustc_demangle-800071eb1d13bc18.rlib" "/home/rustacean/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-pc-windows-gnu/lib/libunwind-e5f51e86a2ac2ec1.rlib" "/home/rustacean/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-pc-windows-gnu/lib/libcfg_if-0b4831ed77440ebc.rlib" "/home/rustacean/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-pc-windows-gnu/lib/liblibc-7cb1f632151fd564.rlib" "/home/rustacean/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-pc-windows-gnu/lib/liballoc-f1051316dd30849f.rlib" "/home/rustacean/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-pc-windows-gnu/lib/librustc_std_workspace_core-52036aaee6b32cd0.rlib" "/home/rustacean/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-pc-windows-gnu/lib/libcore-5a917c308fc4edaf.rlib" "-Wl,--end-group" "/home/rustacean/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-pc-windows-gnu/lib/libcompiler_builtins-ead72db75398108a.rlib" "-Wl,-Bdynamic" "-lgtk-3" "-lgdk-3" "-lpangocairo-1.0" "-lpango-1.0" "-latk-1.0" "-lcairo-gobject" "-lcairo" "-lgdk_pixbuf-2.0" "-lgio-2.0" "-lgobject-2.0" "-lglib-2.0" "-latk-1.0" "-lgobject-2.0" "-lglib-2.0" "-lgdk-3" "-lpangocairo-1.0" "-lpango-1.0" "-lgdk_pixbuf-2.0" "-lcairo-gobject" "-lcairo" "-lgobject-2.0" "-lglib-2.0" "-lpango-1.0" "-lgobject-2.0" "-lglib-2.0" "-lgdk_pixbuf-2.0" "-lgobject-2.0" "-lglib-2.0" "-lcairo-gobject" "-lgobject-2.0" "-lglib-2.0" "-lcairo" "-lgio-2.0" "-lgobject-2.0" "-lglib-2.0" "-lwinapi_advapi32" "-lwinapi_cfgmgr32" "-lwinapi_gdi32" "-lwinapi_kernel32" "-lwinapi_mmdevapi" "-lwinapi_msimg32" "-lwinapi_ole32" "-lwinapi_opengl32" "-lwinapi_shell32" "-lwinapi_synchronization" "-lwinapi_user32" "-lwinapi_winspool" "-lwinapi_ws2_32" "-lgobject-2.0" "-lglib-2.0" "-lglib-2.0" "-ladvapi32" "-lws2_32" "-luserenv" "-lmsvcrt" "-lmingwex" "-lmingw32" "-lmsvcrt" "-luser32" "-lkernel32" "-lgcc_eh" "-l:libpthread.a" "-lgcc" "-lmsvcrt" "-lkernel32" "/home/rustacean/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-pc-windows-gnu/lib/rsend.o"
  = note: /home/rustacean/src/target/x86_64-pc-windows-gnu/release/deps/libgtk-83c61a1f6da2159c.rlib(gtk-83c61a1f6da2159c.gtk.bw69in29-cgu.11.rcgu.o):gtk.bw69in29-cgu.1:(.text+0x11d09): undefined reference to `gtk_plug_new'
          /home/rustacean/src/target/x86_64-pc-windows-gnu/release/deps/libgtk-83c61a1f6da2159c.rlib(gtk-83c61a1f6da2159c.gtk.bw69in29-cgu.11.rcgu.o):gtk.bw69in29-cgu.1:(.text+0x11dd0): undefined reference to `gtk_plug_new_for_display'
          /home/rustacean/src/target/x86_64-pc-windows-gnu/release/deps/libgtk-83c61a1f6da2159c.rlib(gtk-83c61a1f6da2159c.gtk.bw69in29-cgu.11.rcgu.o):gtk.bw69in29-cgu.1:(.text+0x13b93): undefined reference to `gtk_plug_get_type'
          /home/rustacean/src/target/x86_64-pc-windows-gnu/release/deps/libgtk-83c61a1f6da2159c.rlib(gtk-83c61a1f6da2159c.gtk.bw69in29-cgu.11.rcgu.o):gtk.bw69in29-cgu.1:(.text+0x1dcc5): undefined reference to `gtk_plug_get_type'
          /home/rustacean/src/target/x86_64-pc-windows-gnu/release/deps/libgtk-83c61a1f6da2159c.rlib(gtk-83c61a1f6da2159c.gtk.bw69in29-cgu.15.rcgu.o):gtk.bw69in29-cgu.1:(.text+0x2a70): undefined reference to `gtk_socket_get_type'
          /home/rustacean/src/target/x86_64-pc-windows-gnu/release/deps/libgtk-83c61a1f6da2159c.rlib(gtk-83c61a1f6da2159c.gtk.bw69in29-cgu.15.rcgu.o):gtk.bw69in29-cgu.1:(.text+0x3570): undefined reference to `gtk_plug_get_type'
          /home/rustacean/src/target/x86_64-pc-windows-gnu/release/deps/libgtk-83c61a1f6da2159c.rlib(gtk-83c61a1f6da2159c.gtk.bw69in29-cgu.6.rcgu.o):gtk.bw69in29-cgu.6:(.text+0x17174): undefined reference to `gtk_socket_new'
          /home/rustacean/src/target/x86_64-pc-windows-gnu/release/deps/libgtk-83c61a1f6da2159c.rlib(gtk-83c61a1f6da2159c.gtk.bw69in29-cgu.6.rcgu.o):gtk.bw69in29-cgu.6:(.text+0x181df): undefined reference to `gtk_socket_get_type'
          /home/rustacean/src/target/x86_64-pc-windows-gnu/release/deps/libgtk-83c61a1f6da2159c.rlib(gtk-83c61a1f6da2159c.gtk.bw69in29-cgu.6.rcgu.o):gtk.bw69in29-cgu.6:(.text+0x261c5): undefined reference to `gtk_socket_get_type'
          collect2: error: ld returned 1 exit status

error: aborting due to previous error

error: could not compile `lull`.

sounds like GtkPlug and GtkSocket are missing but I don't know what the solution to that is. a problem with mingw64-gtk3 maybe?

apologies for my ranting, just writing this down in case someone has a solution for my problem :)

martinber commented 3 years ago

I've been using a Docker image based on this one for at least a year and looks like recently something changed and it's broken.

Commenting so you know that this is something recent. Please let me know if you solve it, I will do the same if I figure it out

synth-ruiner commented 3 years ago

in case it helps anyone, I was able to do some cross-compilation using this docker image.

martinber commented 3 years ago

Thank you!, I was able to solve it by modifying my image to make it closer to the one you linked. I don't know what solved my problem, because the changes I did were:

My commit