How to add CEF to my existing Mac XCode project?

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.

How to add CEF to my existing Mac XCode project?

Postby philip142au » Sun Apr 06, 2014 10:50 pm

Hi,

So I downloaded the binary mac 64 bit CEF, how can I add this to my existing Mac XCode project?

Thanks, Philip
philip142au
Techie
 
Posts: 19
Joined: Mon Feb 03, 2014 11:26 pm

Re: How to add CEF to my existing Mac XCode project?

Postby magreenblatt » Mon Apr 07, 2014 11:52 am

You will need to set up the necessary build steps in your Xcode project. See for example viewtopic.php?f=6&t=11571#p20741 which discusses the necessary steps.
magreenblatt
Site Admin
 
Posts: 12409
Joined: Fri May 29, 2009 6:57 pm

Re: How to add CEF to my existing Mac XCode project?

Postby philip142au » Mon Apr 07, 2014 9:56 pm

Hi there,

So I did the following.

1. Added /PATHTOMYCODE/xcodebuild/Debug/libcef_dll_wrapper.a to the "Other Linker Flags" under Debug.
2. Added for "Search Paths", "Header Search Paths" /SOMEWHERE_WHERE_MY_CEF_BINARY_IS..../chromium/cef_binary, this folder contains the include folder for cef
3. In "Build Phases" tab "Link binary with libraries", added Chromium Embedded Framework.framework

Now I can build and link without error but when I run I get:
dyld: Library not loaded: @executable_path/Chromium Embedded Framework
Referenced from: /Users/orsa/home/projects/zero/zero/browser/build/bin/Debug/SampleBrowser.app/Contents/MacOS/./SampleBrowser
Reason: image not found
Trace/BPT trap: 5

I'll try to work out this last step from the link you sent me, then I'll update my result here.

Thanks for the help! Philip
philip142au
Techie
 
Posts: 19
Joined: Mon Feb 03, 2014 11:26 pm

Re: How to add CEF to my existing Mac XCode project?

Postby philip142au » Tue Apr 08, 2014 11:09 pm

So step 4.

I looked at the "build phases" part of my project and compared it with the same "build phases" of cefsimple XCode project.

Basically as follows.
a. Added Copy File of libplugin_carbon_interpose.dylib
b. Link binary with libraries, added the libcef_dll_wrapper.a
c. The two run scripts which are named as PostBuild "Add Framework" and "Fix Frameworks Links".

Now it runs without error.

Overall, this was a LOT of trouble and a LOT of time.

Thanks, Philip
philip142au
Techie
 
Posts: 19
Joined: Mon Feb 03, 2014 11:26 pm

Re: How to add CEF to my existing Mac XCode project?

Postby philip142au » Sat Apr 12, 2014 11:02 am

Now I try to add my browser in C++ code, ... something to fix for tomorrow I guess.

All done
LaunchProcess: failed to execvp:
/Users/orsa/home/projects/zero/zero/browser/build/bin/Debug/SampleBrowser.app/Contents/Frameworks/SampleBrowser Helper.app/Contents/MacOS/SampleBrowser Helper
105553116483744[0412/235318:FATAL:browser_child_process_host_impl.cc(262)] Check failed: data_.handle != base::kNullProcessHandle.
0 Chromium Embedded Framework 0x00000001023aea8f base::debug::StackTrace::StackTrace() + 47
1 Chromium Embedded Framework 0x00000001023aeae3 base::debug::StackTrace::StackTrace() + 35
2 Chromium Embedded Framework 0x0000000102423056 logging::LogMessage::~LogMessage() + 70
3 Chromium Embedded Framework 0x0000000102421e53 logging::LogMessage::~LogMessage() + 35
4 Chromium Embedded Framework 0x00000001025f88da content::BrowserChildProcessHostImpl::OnChildDisconnected() + 410
5 Chromium Embedded Framework 0x00000001025f908c non-virtual thunk to content::BrowserChildProcessHostImpl::OnChildDisconnected() + 44
6 Chromium Embedded Framework 0x0000000102fe0484 content::ChildProcessHostImpl::OnChannelError() + 196
7 Chromium Embedded Framework 0x0000000102fe04cc non-virtual thunk to content::ChildProcessHostImpl::OnChannelError() + 44
8 Chromium Embedded Framework 0x000000010330fd7d IPC::Channel::ChannelImpl::ClosePipeOnError() + 189
9 Chromium Embedded Framework 0x000000010330fbcb IPC::Channel::ChannelImpl::OnFileCanReadWithoutBlocking(int) + 1579
10 Chromium Embedded Framework 0x000000010330fde2 non-virtual thunk to IPC::Channel::ChannelImpl::OnFileCanReadWithoutBlocking(int) + 50
11 Chromium Embedded Framework 0x000000010236fa8b base::MessagePumpLibevent::FileDescriptorWatcher::OnFileCanReadWithoutBlocking(int, base::MessagePumpLibevent*) + 91
12 Chromium Embedded Framework 0x0000000102370fdc base::MessagePumpLibevent::OnLibeventNotification(int, short, void*) + 412
13 Chromium Embedded Framework 0x0000000102557422 event_process_active + 386
14 Chromium Embedded Framework 0x000000010255678f event_base_loop + 495
15 Chromium Embedded Framework 0x0000000102371239 base::MessagePumpLibevent::Run(base::MessagePump::Delegate*) + 361
16 Chromium Embedded Framework 0x0000000102459b29 base::MessageLoop::RunHandler() + 249
17 Chromium Embedded Framework 0x00000001024bed03 base::RunLoop::Run() + 67
18 Chromium Embedded Framework 0x000000010245909f base::MessageLoop::Run() + 47
19 Chromium Embedded Framework 0x000000010251fce7 base::Thread::Run(base::MessageLoop*) + 39
20 Chromium Embedded Framework 0x000000010263fa17 content::BrowserThreadImpl::IOThreadRun(base::MessageLoop*) + 71
21 Chromium Embedded Framework 0x000000010263fbfe content::BrowserThreadImpl::Run(base::MessageLoop*) + 334
22 Chromium Embedded Framework 0x000000010251ff7f base::Thread::ThreadMain() + 527
23 Chromium Embedded Framework 0x000000010250b123 base::(anonymous namespace)::ThreadFunc(void*) + 291
24 libsystem_pthread.dylib 0x00007fff8809e899 _pthread_body + 138
25 libsystem_pthread.dylib 0x00007fff8809e72a _pthread_struct_init + 0
26 libsystem_pthread.dylib 0x00007fff880a2fc9 thread_start + 13
philip142au
Techie
 
Posts: 19
Joined: Mon Feb 03, 2014 11:26 pm

Re: How to add CEF to my existing Mac XCode project?

Postby raphymav » Tue Aug 04, 2015 3:34 am

After adding the scripts, there appears a codesign error. Does anybody have a solution for this?

Cheers
raphymav
Newbie
 
Posts: 1
Joined: Tue Aug 04, 2015 3:31 am


Return to Support Forum

Who is online

Users browsing this forum: No registered users and 93 guests