- Code: Select all
Application/
myApp
tpsdks/ <= ("Third Party SDKS") CEF3 is in a subdirectory
libcef.so
icudtl.dat
libEGL.so, libGLESv2.so, ...
cef.pak, devtools_resources.pak, ...
natives_blob.bin, snapshot_blob.bin
locales/
en-US.pak, ...
I've had a good read of the 'General Usage'. I appreciate that what I'm trying to achieve is quite different from the default/outlined application structure within the wiki. The code for my application looks something like:
- Code: Select all
CefMainArgs main_args(argc, argv);
CefSettings settings;
// Specify the path for the sub-process executable.
CefString(&settings.browser_subprocess_path).FromWString(L"cb_html5_renderer");
CefString(&settings.resources_dir_path).FromWString(L"tpsdks");
CefString(&settings.locales_dir_path).FromWString(L"tpsdks");
settings.windowless_rendering_enabled = 1;
// Crash! Bang! Boom!
// Everything goes wrong here.
CefInitialize(main_args, settings, nullptr, nullptr);
CefRunMessageLoop();
CefShutdown();
Subprocess:
- Code: Select all
int main(int argc, char* argv[])
{
// Structure for passing command-line arguments.
// The definition of this structure is platform-specific.
CefMainArgs main_args(argc, argv);
// Execute the sub-process logic. This will block until the sub-process should exit.
return CefExecuteProcess(main_args, nullptr, nullptr);
}
The problem I'm having is that a call to 'CefInitialize(...)' will always crash. I've tried variations of the above code but to no avail. Now with some variations of my code, there is a log message to stdout/stderr complaining that 'icudtl.dat' cannot be located.
If I move the various CEF files to the application directory, I can get it working (with a few tweaks to the code).
A few questions I had:
- Is what I'm trying to achieve possible?
- Can the various 'settings' configuration paths be relative?
- Must I set LD_LIBRARY_PATH? (I have tried messing with this a bit)
One other question...can I run CefMainArgs, CefInitialize, CefRunMessageLoop, CefShutdown in a separate thread of the main application thread? Am I asking for trouble?
Running on Ubuntu 17.10 with gcc 7.2.