Linker errors linking against CEF on Linux

Having problems with building or using CEF's C/C++ APIs? This forum is here to help. Please do not post bug reports or feature requests here.

Linker errors linking against CEF on Linux

Postby NickChapman » Wed May 25, 2022 9:59 pm

Hi all,
I'm trying to build and use CEF on Linux. (Ubuntu 22.04 LTS), CEF 4951.

I have built it in the following way, which seems to work:

Code: Select all
export GN_DEFINES="is_official_build=true use_sysroot=true use_allocator=none symbol_level=1 is_cfi=false use_thin_lto=false proprietary_codecs=true ffmpeg_branding=Chrome"
export CEF_ARCHIVE_FORMAT=tar.bz2
python3 automate-git.py --download-dir=/home/nick/cef --branch=4951 --minimal-distrib --client-distrib --force-clean --build-target=cefsimple --x64-build


Now I'm trying to link against CEF and use it in my program.

in my CMake target_link_libraries, I have

Code: Select all
/home/nick/cef/chromium/src/out/Release_GN_x64/obj/cef/libcef_dll_wrapper.a
/home/nick/cef/chromium/src/cef/binary_distrib/cef_binary_101.0.18+g367b4a0+chromium-101.0.4951.67_linux64/Release/libcef.so


However I am getting the following linker errors:

Code: Select all
/usr/bin/ld: /home/nick/cef/chromium/src/out/Release_GN_x64/obj/cef/libcef_dll_wrapper/drag_handler_cpptoc.o: in function `void std::__1::vector<CefDraggableRegion, std::__1::allocator<CefDraggableRegion> >::__push_back_slow_path<CefDraggableRegion const&>(CefDraggableRegion const&)':
./../../buildtools/third_party/libc++/trunk/include/vector:1027: undefined reference to `std::__1::__vector_base_common<true>::__throw_length_error() const'
/usr/bin/ld: /home/nick/cef/chromium/src/out/Release_GN_x64/obj/cef/libcef_dll_wrapper/print_settings_ctocpp.o: in function `void std::__1::vector<CefRange, std::__1::allocator<CefRange> >::__push_back_slow_path<CefRange>(CefRange&&)':
./../../buildtools/third_party/libc++/trunk/include/vector:1027: undefined reference to `std::__1::__vector_base_common<true>::__throw_length_error() const'
/usr/bin/ld: /home/nick/cef/chromium/src/out/Release_GN_x64/obj/cef/libcef_dll_wrapper/render_handler_cpptoc.o: in function `void std::__1::vector<CefRect, std::__1::allocator<CefRect> >::__push_back_slow_path<CefRect const&>(CefRect const&)':
./../../buildtools/third_party/libc++/trunk/include/vector:1027: undefined reference to `std::__1::__vector_base_common<true>::__throw_length_error() const'
/usr/bin/ld: /home/nick/cef/chromium/src/out/Release_GN_x64/obj/cef/libcef_dll_wrapper/request_handler_cpptoc.o: in function `void std::__1::vector<scoped_refptr<CefX509Certificate>, std::__1::allocator<scoped_refptr<CefX509Certificate> > >::__push_back_slow_path<scoped_refptr<CefX509Certificate> const&>(scoped_refptr<CefX509Certificate> const&)':
./../../buildtools/third_party/libc++/trunk/include/vector:1027: undefined reference to `std::__1::__vector_base_common<true>::__throw_length_error() const'
/usr/bin/ld: /home/nick/cef/chromium/src/out/Release_GN_x64/obj/cef/libcef_dll_wrapper/v8handler_cpptoc.o: in function `void std::__1::vector<scoped_refptr<CefV8Value>, std::__1::allocator<scoped_refptr<CefV8Value> > >::__push_back_slow_path<scoped_refptr<CefV8Value> const&>(scoped_refptr<CefV8Value> const&)':
./../../buildtools/third_party/libc++/trunk/include/vector:1027: undefined reference to `std::__1::__vector_base_common<true>::__throw_length_error() const'
/usr/bin/ld: /home/nick/cef/chromium/src/out/Release_GN_x64/obj/cef/libcef_dll_wrapper/x509certificate_ctocpp.o:./../../buildtools/third_party/libc++/trunk/include/vector:1027: more undefined references to `std::__1::__vector_base_common<true>::__throw_length_error() const' follow
collect2: error: ld returned 1 exit status


This seems to be the same error as in viewtopic.php?f=6&t=16988&p=42899&hilit=ARM64 , unfortunately I can't build libc++ from source as in that post, get an error message

Code: Select all
CMake Error at CMakeLists.txt:5 (message):
  libc++ now requires being built in a monorepo layout with libcxxabi
  available


Are these linker errors a known issue with CEF?
Which libraries am I supposed to link against?
NickChapman
Techie
 
Posts: 21
Joined: Sun Apr 24, 2022 2:42 am

Re: Linker errors linking against CEF on Linux

Postby magreenblatt » Thu May 26, 2022 1:29 am

You should build/link libcef_dll_wrapper from the binary distribution, not from the CEF out directory.
magreenblatt
Site Admin
 
Posts: 12382
Joined: Fri May 29, 2009 6:57 pm

Re: Linker errors linking against CEF on Linux

Postby NickChapman » Thu May 26, 2022 3:43 am

magreenblatt wrote:You should build/link libcef_dll_wrapper from the binary distribution, not from the CEF out directory.


ok thanks, will try.
NickChapman
Techie
 
Posts: 21
Joined: Sun Apr 24, 2022 2:42 am

Re: Linker errors linking against CEF on Linux

Postby NickChapman » Thu May 26, 2022 4:08 am

Thank you, that worked!
NickChapman
Techie
 
Posts: 21
Joined: Sun Apr 24, 2022 2:42 am


Return to Support Forum

Who is online

Users browsing this forum: Google [Bot] and 33 guests