Attempting to update a CEF2272 based OSX app to CEF2704

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.

Attempting to update a CEF2272 based OSX app to CEF2704

Postby mzmiric5 » Sun May 08, 2016 12:57 pm

Hi there,

I am attempting to take an app that was based on CEF2272 and update it to CEF2704. The update was successfully performed for the windows build but fails for the osx build.

There were a lot of errors that I ran into, but I've sort off worked around them. The app has some C++11 requirements and uses libc++ as it's std lib, so I had to compile libcef_dll with -stdlib=libc++ .

The next error that I ran into is that the cmake is still configured for the old way of creating helpers using the tools/make_more_helpers.sh which doesn't exist anymore in the new versions of CEF. I've worked around this by just taking the tools folder from the old versions of CEF and using that, but if anyone has any tips of how to migrate to the new way of it being done, that would be very appreciated.
Here is the current cmake for cef helper generation
Code: Select all
add_custom_command(TARGET cef-isolation POST_BUILD
      # Remember if you change this but don't cause a recompile in the shared object it will not rename it successfully
      COMMAND install_name_tool -change "@executable_path/Chromium Embedded Framework" "@rpath/Chromium Embedded Framework.framework/Chromium Embedded Framework" "$<TARGET_FILE:cef-isolation>"

      # Make a Frameworks directory
      COMMAND mkdir -p "$<TARGET_FILE_DIR:cef-isolation>/../Frameworks"

      # Copy the CEF and support frameworks
      COMMAND cp -Rf "${CEF_ROOT_DIR}/Release/Chromium Embedded Framework.framework" "$<TARGET_FILE_DIR:cef-isolation>/../Frameworks/"

      # Setup the helper apps
      COMMAND rm -rf "$<TARGET_FILE_DIR:cef-isolation>/../Frameworks/CEF Helper.app"
      COMMAND cp -Rf "$<TARGET_FILE_DIR:cef-bootstrap>/../../../CEF Helper.app" "$<TARGET_FILE_DIR:cef-isolation>/../Frameworks"
      COMMAND "BUILT_PRODUCTS_DIR=$<TARGET_FILE_DIR:cef-isolation>/../../.." "CONTENTS_FOLDER_PATH=CEF.app/Contents" "${CEF_ROOT_DIR}/tools/make_more_helpers.sh" "Frameworks" "CEF")


But like I said, just copying the old tools folder sort of works around it, and this is where I get to my biggest problem. My project seems to be building fine, until it gets to the very end and starts linking a shared module, resulting in the following error
Code: Select all
Undefined symbols for architecture x86_64:
  "CefParseURL(CefStringBase<CefStringTraitsUTF16> const&, CefStructBase<CefURLPartsTraits>&)", referenced from:
      BrowserSchemeHandler::ProcessRequest(CefRefPtr<CefRequest>, CefRefPtr<CefCallback>) in browser-scheme.cpp.o
  "CefURIDecode(CefStringBase<CefStringTraitsUTF16> const&, bool, cef_uri_unescape_rule_t)", referenced from:
      BrowserSchemeHandler::ProcessRequest(CefRefPtr<CefRequest>, CefRefPtr<CefCallback>) in browser-scheme.cpp.o
  "CefGetMimeType(CefStringBase<CefStringTraitsUTF16> const&)", referenced from:
      BrowserSchemeHandler::GetResponseHeaders(CefRefPtr<CefResponse>, long long&, CefStringBase<CefStringTraitsUTF16>&) in browser-scheme.cpp.o
  "_cef_string_utf16_clear", referenced from:
      BrowserLoadHandler::OnLoadEnd(CefRefPtr<CefBrowser>, CefRefPtr<CefFrame>, int) in browser-load-handler.cpp.o
      CefStringBase<CefStringTraitsUTF16>::~CefStringBase() in browser-load-handler.cpp.o
      CefStringBase<CefStringTraitsUTF16>::~CefStringBase() in browser-load-handler.cpp.o
      BrowserSchemeHandler::ProcessRequest(CefRefPtr<CefRequest>, CefRefPtr<CefCallback>) in browser-scheme.cpp.o
      BrowserSchemeHandler::GetResponseHeaders(CefRefPtr<CefResponse>, long long&, CefStringBase<CefStringTraitsUTF16>&) in browser-scheme.cpp.o
      CefStringBase<CefStringTraitsUTF16>::~CefStringBase() in browser-scheme.cpp.o
      CefStructBase<CefURLPartsTraits>::~CefStructBase() in browser-scheme.cpp.o
      ...
  "_cef_string_utf16_to_utf8", referenced from:
      BrowserSchemeHandler::ProcessRequest(CefRefPtr<CefRequest>, CefRefPtr<CefCallback>) in browser-scheme.cpp.o
  "_cef_string_utf8_clear", referenced from:
      BrowserSchemeHandler::ProcessRequest(CefRefPtr<CefRequest>, CefRefPtr<CefCallback>) in browser-scheme.cpp.o
  "_cef_string_utf8_to_utf16", referenced from:
      BrowserLoadHandler::OnLoadEnd(CefRefPtr<CefBrowser>, CefRefPtr<CefFrame>, int) in browser-load-handler.cpp.o
      BrowserSchemeHandler::ProcessRequest(CefRefPtr<CefRequest>, CefRefPtr<CefCallback>) in browser-scheme.cpp.o
      BrowserSchemeHandler::GetResponseHeaders(CefRefPtr<CefResponse>, long long&, CefStringBase<CefStringTraitsUTF16>&) in browser-scheme.cpp.o
      CefStringBase<CefStringTraitsUTF16>::FromString(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&) in browser-scheme.cpp.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

If anyone has any ideas on what could be causing this, and what's the best way of finding the solution to it, it would be very appreciated.

Thanks in advance
mzmiric5
Newbie
 
Posts: 3
Joined: Sun May 08, 2016 12:45 pm

Re: Attempting to update a CEF2272 based OSX app to CEF2704

Postby magreenblatt » Mon May 09, 2016 9:35 am

The make_more_helpers script is no longer required. Compare to the CMake configuration included with the 2704 binary distribution.
magreenblatt
Site Admin
 
Posts: 12407
Joined: Fri May 29, 2009 6:57 pm

Re: Attempting to update a CEF2272 based OSX app to CEF2704

Postby mzmiric5 » Mon May 09, 2016 11:43 am

magreenblatt wrote:The make_more_helpers script is no longer required. Compare to the CMake configuration included with the 2704 binary distribution.


Ok, would this be causing the other error that I'm having?
mzmiric5
Newbie
 
Posts: 3
Joined: Sun May 08, 2016 12:45 pm

Re: Attempting to update a CEF2272 based OSX app to CEF2704

Postby magreenblatt » Mon May 09, 2016 11:47 am

mzmiric5 wrote:
magreenblatt wrote:The make_more_helpers script is no longer required. Compare to the CMake configuration included with the 2704 binary distribution.


Ok, would this be causing the other error that I'm having?

Do you mean the linker error? Are you linking both libcef_dll_wrapper and "Chromium Embedded Framework"?
magreenblatt
Site Admin
 
Posts: 12407
Joined: Fri May 29, 2009 6:57 pm

Re: Attempting to update a CEF2272 based OSX app to CEF2704

Postby mzmiric5 » Mon May 09, 2016 2:31 pm

magreenblatt wrote:
mzmiric5 wrote:
magreenblatt wrote:The make_more_helpers script is no longer required. Compare to the CMake configuration included with the 2704 binary distribution.


Ok, would this be causing the other error that I'm having?

Do you mean the linker error? Are you linking both libcef_dll_wrapper and "Chromium Embedded Framework"?


I believe so, just double checked the cmake, and it's linking to both.

Edit: looks like it was losing a link to either somewhere in the build process, I've added it one more time in the Cmake to ensure it links properly, and now it does. However, after finally getting it to link, I am now running into a new problem
Code: Select all
error: os_dlopen(../obs-plugins/obs-browser.so->../obs-plugins/obs-browser.so): dlopen(../obs-plugins/obs-browser.so, 1): Library not loaded: @executable_path/Chromium Embedded Framework
  Referenced from: /Users/userName/workspace/obs-studio/build/rundir/RelWithDebInfo/obs-plugins/obs-browser.so
  Reason: image not found

is it trying to look for the framework at a incorrect location?
mzmiric5
Newbie
 
Posts: 3
Joined: Sun May 08, 2016 12:45 pm


Return to Support Forum

Who is online

Users browsing this forum: Majestic-12 [Bot] and 25 guests