Using libcef_static directly

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.

Using libcef_static directly

Postby gusverdun » Thu Jan 13, 2011 3:48 pm

Is there a way to compile the cefclient sample in a way that it does not use libcef.dll and instead links to cef and chrome libs statically?

The instructions on the wiki page (http://code.google.com/p/chromiumembedded/wiki/LinkingDifferentRunTimeLibraries) mention a simple change to depend on libcef_static rather than libcef_dll_wrapper.

However, that does not link:

cefclient_win.obj : error LNK2019: unresolved external symbol "public: __thiscall CefByteReadHandler::CefByteReadHandler(unsigned char const *,unsigned int,class CefRefPtr<class CefBase>)" (??0CefByteReadHandler@@QAE@PBEIV?$CefefPtr@VCefBase@@@@@Z) referenced in function "public: virtual enum cef_retval_t __thiscall ClientHandler::HandleBeforeResourceLoad(class CefRefPtr<class CefBrowser>,class CefRefPtr<class CefRequest>,class CefStringBase<struct CefStringTraitsUTF16> &,class CefRefPtr<class CefStreamReader> &,class CefStringBase<struct CefStringTraitsUTF16> &,int)" (?HandleBeforeResourceLoad@ClientHandler@@UAE?AW4cef_retval_t@@V?$CefRefPtr@VCefBrowser@@@@V?$CefRefPtr@VCefRequest@@@@AAV?$CefStringBase@UCefStringTraitsUTF16@@@@AAV?$CefRefPtr@VCefStreamReader@@@@2H@Z)

Any pointers on how to do this would be greatly appreciated.

Thanks,

Gus
gusverdun
Techie
 
Posts: 25
Joined: Tue Jan 11, 2011 9:08 am

Re: Using libcef_static directly

Postby magreenblatt » Thu Jan 13, 2011 3:55 pm

CefByteReadHandler is part of the libcef_dll_wrapper project. To use this and other classes defined in cef_wrapper.h you will need to include the source files from the libcef_dll/wrapper directory in your static project.
magreenblatt
Site Admin
 
Posts: 12409
Joined: Fri May 29, 2009 6:57 pm

Re: Using libcef_static directly

Postby gusverdun » Thu Jan 13, 2011 5:09 pm

Thanks for the quick response.

Any advice on how we could even eliminate the cpp -> c wrapper layer?

Thanks,

Gus
gusverdun
Techie
 
Posts: 25
Joined: Tue Jan 11, 2011 9:08 am

Re: Using libcef_static directly

Postby magreenblatt » Thu Jan 13, 2011 5:32 pm

What are you trying to accomplish by not using CEF as a DLL? Linking the Chromium and WebKit libraries statically will very likely cause you more problems then it's worth.
magreenblatt
Site Admin
 
Posts: 12409
Joined: Fri May 29, 2009 6:57 pm

Re: Using libcef_static directly

Postby gusverdun » Tue Jan 18, 2011 11:09 am

My client will also be using chrome's base and net lib and potentially some of the other third party libs perhaps even skia.
By statically linking with libcef_static, I could also reduce the duplication in the statically linked C/CPP run-time between the two modules.
I am also, trying to reduce as much the extra memory allocations and the cpp -> c layer seemed like a good start.

-Gus
gusverdun
Techie
 
Posts: 25
Joined: Tue Jan 11, 2011 9:08 am

Re: Using libcef_static directly

Postby magreenblatt » Tue Jan 18, 2011 11:30 am

My client will also be using chrome's base and net lib and potentially some of the other third party libs perhaps even skia.

OK, linking statically makes sense in that case. The C API layer, which is provided by the libcef and libcef_dll_wrapper targets, will not be included when you link against libcef_static directly.

Be aware that statically linking some Chromium sub-components in a closed-source product may violate licensing terms. See http://code.google.com/chromium/terms.html for more information.
magreenblatt
Site Admin
 
Posts: 12409
Joined: Fri May 29, 2009 6:57 pm


Return to Support Forum

Who is online

Users browsing this forum: salvadordf and 53 guests