Linux version can't build,multiple definition of

[ 77%] Linking CXX executable …/…/…/bin/Urho3DPlayer
/usr/bin/ld: …/…/…/lib/libUrho3D.a(SDL_surface.c.o):(.bss+0x0): multiple definition of WAYLAND_wl_proxy_get_user_data'; ../../../lib/libUrho3D.a(SDL_video.c.o):(.bss+0x0): first defined here /usr/bin/ld: ../../../lib/libUrho3D.a(SDL_surface.c.o):(.bss+0x8): multiple definition of WAYLAND_wl_proxy_set_user_data’; …/…/…/lib/libUrho3D.a(SDL_video.c.o):(.bss+0x8): first defined here
/usr/bin/ld: …/…/…/lib/libUrho3D.a(SDL_surface.c.o):(.bss+0x10): multiple definition of `WAYLAND_wl_proxy_add_listener’; …/…/…/lib/libUrho3D.a(SDL_video.c.o):(.bss+0x10): first defined here
how should i fix it?

Like like it could be the same as this issue (for a different project) using gcc 10 with SDL. They said they got it working by adding -fcommon to the flags passed to gcc. If you’re also using gcc version 10 you might try that.

how can do adding -fcommon to gcc whith cmake :joy:

built succeed.add CmakeLists.txt
SET(GCC_FCOMMON_COMPILE_FLAGS “-fcommon”)

add_definitions(${GCC_FCOMMON_COMPILE_FLAGS})

I just upgraded my Fedora to version 33 which comes with GCC 10.2.1. If I can reproduce the issue locally and able to fix it, I may push my fix to the main branch. And, if I can get my NVIDIA proprietary driver to play ball with Wayland this time then I will make Urho3D engine to support Wayland correctly too with the help from SDL. Don’t hold your breath as always.

EDIT: well, just one “rake” command on the master branch. Everything went through uneventfully without any change nor sweat. Test run a few samples and they were OK. Still on X11 though.

1 Like