I've been struggling to link CEF with my application.

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.

I've been struggling to link CEF with my application.

Postby blueavocado » Fri Jan 19, 2024 6:14 am

Here is the directory where the executable should be placed:
Code: Select all
.
├── bin
│   ├── chrome-sandbox
│   ├── chrome_100_percent.pak
│   ├── chrome_200_percent.pak
│   ├── icudtl.dat
│   ├── libEGL.so
│   ├── libGLESv2.so
│   ├── libcef.so
│   ├── libcef_dll_wrapper.a
│   ├── libvk_swiftshader.so
│   ├── libvulkan.so.1
│   ├── locales
│   │   ├──xxxx.pak
│   ├── resources.pak
│   ├── snapshot_blob.bin
│   ├── v8_context_snapshot.bin
│   └── vk_swiftshader_icd.json
├── makefile
└── src
    └── main.cc

Makefile:
Code: Select all
SOURCES := src/main.cc
compile: clean setlibpaths
   g++ -Wall -Werror -o bin/nox -I/opt/cef -Wl,-rpath,./bin -lcef_dll_wrapper -lcef -v $(SOURCES)
clean:
   rm -fv bin/nox
setlibpaths:
   export LIBRARY_PATH=$$HOME/code/theta/nox/bin:$$LIBRARY_PATH

make compile:
Code: Select all
warning: MPFR header version 4.2.0-p12 differs from library version 4.2.1.
GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
ignoring nonexistent directory "/usr/lib/gcc/x86_64-pc-linux-gnu/13.2.1/../../../../x86_64-pc-linux-gnu/include"
#include "..." search starts here:
#include <...> search starts here:
    ...
End of search list.
    ...
LIBRARY_PATH=/usr/lib/gcc/x86_64-pc-linux-gnu/13.2.1/:/usr/lib/gcc/x86_64-pc-linux-gnu/13.2.1/../../../../lib/:/lib/../lib/:/usr/lib/../lib/:/opt/cef/Release/:./:/usr/lib/gcc/x86_64-pc-linux-gnu/13.2.1/../../../:/lib/:/usr/lib/
COLLECT_GCC_OPTIONS='-Wall' '-Werror' '-o' 'bin/nox' '-I' '/opt/cef' '-v' '-shared-libgcc' '-mtune=generic' '-march=x86-64' '-dumpdir' 'bin/nox.'
/usr/lib/gcc/x86_64-pc-linux-gnu/13.2.1/collect2 -plugin /usr/lib/gcc/x86_64-pc-linux-gnu/13.2.1/liblto_plugin.so -plugin-opt=/usr/lib/gcc/x86_64-pc-linux-gnu/13.2.1/lto-wrapper -plugin-opt=-fresolution=/tmp/ccmXrXVY.res -plugin-opt=-pass-through=-lgcc_s -plugin-opt=-pass-through=-lgcc -plugin-opt=-pass-through=-lc -plugin-opt=-pass-through=-lgcc_s -plugin-opt=-pass-through=-lgcc --build-id --eh-frame-hdr --hash-style=gnu -m elf_x86_64 -dynamic-linker /lib64/ld-linux-x86-64.so.2 -pie -o bin/nox /usr/lib/gcc/x86_64-pc-linux-gnu/13.2.1/../../../../lib/Scrt1.o /usr/lib/gcc/x86_64-pc-linux-gnu/13.2.1/../../../../lib/crti.o /usr/lib/gcc/x86_64-pc-linux-gnu/13.2.1/crtbeginS.o -L/usr/lib/gcc/x86_64-pc-linux-gnu/13.2.1 -L/usr/lib/gcc/x86_64-pc-linux-gnu/13.2.1/../../../../lib -L/lib/../lib -L/usr/lib/../lib -L/opt/cef/Release -L. -L/usr/lib/gcc/x86_64-pc-linux-gnu/13.2.1/../../.. -rpath ./bin -lcef_dll_wrapper -lcef /tmp/ccqVVHkv.o -lstdc++ -lm -lgcc_s -lgcc -lc -lgcc_s -lgcc /usr/lib/gcc/x86_64-pc-linux-gnu/13.2.1/crtendS.o /usr/lib/gcc/x86_64-pc-linux-gnu/13.2.1/../../../../lib/crtn.o
/usr/bin/ld: cannot find -lcef_dll_wrapper: No such file or directory
collect2: error: ld returned 1 exit status
make: *** [makefile:3: compile] Error 1

The tutorial tells me to use pkg-config, but that outputs:
Code: Select all
$ pkg-config --cflags --with-path=./bin --libs cef --verbose

Package cef was not found in the pkg-config search path.
Perhaps you should add the directory containing `cef.pc'
to the PKG_CONFIG_PATH environment variable
Package 'cef', required by 'virtual:world', not found

I'm kind of new to linking libraries so any help here would be appreciated.
blueavocado
Newbie
 
Posts: 1
Joined: Thu Jan 18, 2024 4:36 am

Re: I've been struggling to link CEF with my application.

Postby magreenblatt » Fri Jan 19, 2024 11:27 am

I suggest starting with the provided CMake configuration and https://bitbucket.org/chromiumembedded/cef-project
magreenblatt
Site Admin
 
Posts: 12409
Joined: Fri May 29, 2009 6:57 pm


Return to Support Forum

Who is online

Users browsing this forum: No registered users and 203 guests