intel / ozone-wayland

Wayland implementation for Chromium Ozone classes
BSD 3-Clause "New" or "Revised" License
218 stars 82 forks source link

Multiple definition link error #465

Open jbrianceau opened 7 years ago

jbrianceau commented 7 years ago

I have the following link error with gcc :

obj/ozone/ui/desktop_aura/views.desktop_window_tree_host_ozone.o: In function `views::DesktopWindowTreeHostOzone::AsWindowTreeHost()':
src/ozone/ui/desktop_aura/desktop_window_tree_host_ozone.cc:239: multiple definition of `views::DesktopWindowTreeHostOzone::AsWindowTreeHost()'
src/ozone/ui/desktop_aura/desktop_window_tree_host_ozone.cc:239: first defined here
obj/ozone/ui/desktop_aura/views.desktop_window_tree_host_ozone.o: In function `views::DesktopWindowTreeHostOzone::ShowMaximizedWithBounds(gfx::Rect const&)':
src/ozone/ui/desktop_aura/desktop_window_tree_host_ozone.cc:268: multiple definition of `views::DesktopWindowTreeHostOzone::ShowMaximizedWithBounds(gfx::Rect const&)'
src/ozone/ui/desktop_aura/desktop_window_tree_host_ozone.cc:268: first defined here
[...]

The following commit solved this issue : https://github.com/jbrianceau/ozone-wayland/commit/479423867c386defefc45d497873d5458538a682

jbrianceau commented 7 years ago

Pull request created : https://github.com/01org/ozone-wayland/pull/466

joone commented 7 years ago

I have not seen any link problems, but I will take a look at it.

joone commented 7 years ago

Do you use component=static_library?

joone commented 7 years ago

I see another link problem with component=shared_library:

[38/5839] SOLINK lib/libviews.so FAILED: lib/libviews.so lib/libviews.so.TOC if [ ! -e lib/libviews.so -o ! -e lib/libviews.so.TOC ]; then c++ -shared -L/home/joone/otc/chromium-ozone/src/ozone/tools/jhbuild/../../../out/wayland/root/lib64 -Wl,-z,now -Wl,-z,relro -Wl,--fatal-warnings -Wl,-z,defs -pthread -Wl,-z,noexecstack -fPIC -fuse-ld=gold -Wl,--disable-new-dtags -m64 -Wl,--detect-odr-violations -Wl,--icf=all -Wl,-O1 -Wl,--as-needed -Wl,--gc-sections -o lib/libviews.so -Wl,-soname=libviews.so @lib/libviews.so.rsp && { readelf -d lib/libviews.so | grep SONAME ; nm -gD -f p lib/libviews.so | cut -f1-2 -d' '; } > lib/libviews.so.TOC; else c++ -shared -L/home/joone/otc/chromium-ozone/src/ozone/tools/jhbuild/../../../out/wayland/root/lib64 -Wl,-z,now -Wl,-z,relro -Wl,--fatal-warnings -Wl,-z,defs -pthread -Wl,-z,noexecstack -fPIC -fuse-ld=gold -Wl,--disable-new-dtags -m64 -Wl,--detect-odr-violations -Wl,--icf=all -Wl,-O1 -Wl,--as-needed -Wl,--gc-sections -o lib/libviews.so -Wl,-soname=libviews.so @lib/libviews.so.rsp && { readelf -d lib/libviews.so | grep SONAME ; nm -gD -f p lib/libviews.so | cut -f1-2 -d' '; } > lib/libviews.so.tmp && if ! cmp -s lib/libviews.so.tmp lib/libviews.so.TOC; then mv lib/libviews.so.tmp lib/libviews.so.TOC ; fi; fi obj/ozone/ui/desktop_aura/views.desktop_drag_drop_client_wayland.o:desktop_drag_drop_client_wayland.cc:function views::DesktopDragDropClientWayland::OnDragDataReceived(int): error: undefined reference to 'content::BrowserThread::PostTask(content::BrowserThread::ID, tracked_objects::Location const&, base::Callback<void ()> const&)' obj/ozone/ui/desktop_aura/views.desktop_drag_drop_client_wayland.o:desktop_drag_drop_client_wayland.cc:function views::DesktopDragDropClientWayland::DragDataCollector::ReadDragData(scoped_refptrviews::DesktopDragDropClientWayland::DragDataCollector): error: undefined reference to 'content::BrowserThread::PostTask(content::BrowserThread::ID, tracked_objects::Location const&, base::Callback<void ()> const&)' collect2: error: ld returned 1 exit status

jbrianceau commented 7 years ago

Do you use component=static_library?

We currently use component=shared_library

I see another link problem with component=shared_library:

We also face this link issue. We currently workaround it by posting from another thread, but I didn't submit a fix as I doubt this is a proper way, and also because I cannot test it (no mouse, so no drag & drop on our platform).