Skip to content
This repository has been archived by the owner on Aug 20, 2020. It is now read-only.

Multiple definition link error #465

Open
jbrianceau opened this issue Aug 16, 2016 · 5 comments
Open

Multiple definition link error #465

jbrianceau opened this issue Aug 16, 2016 · 5 comments

Comments

@jbrianceau
Copy link
Contributor

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 : jbrianceau@4794238

@jbrianceau
Copy link
Contributor Author

Pull request created : #466

@joone
Copy link
Contributor

joone commented Aug 25, 2016

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

@joone
Copy link
Contributor

joone commented Aug 29, 2016

Do you use component=static_library?

@joone
Copy link
Contributor

joone commented Aug 30, 2016

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
Copy link
Contributor Author

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).

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants