Building own helper executable

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.

Building own helper executable

Postby edominic » Thu Mar 26, 2015 9:41 am

Hey ;)
I want to add cefclient helper executable target to our project, but it doesn't work how it should be.

At first, I add new target, cocoa application, objective-c.

But if I replace
Code: Select all
return NSApplicationMain(argc, argv);


with
Code: Select all
  CefMainArgs main_args(argc, argv);
 
  CefRefPtr<CefApp> app(new ClientApp);

  // Execute the secondary process.
  return CefExecuteProcess(main_args, app, NULL);


then I get error from
cef_app.h
that it can't find cef includes:
Code: Select all
/include/cef_app.h:42:10: 'include/cef_base.h' file not found


So I added in "Header Search Paths" a dot (for current directory).
Then I get some strange errors:
Code: Select all
In file included from /workspace/client-jni/cefclient Helper/main.m:10:
In file included from /workspace/client-jni/include/cef_app.h:42:
In file included from ./include/cef_base.h:43:
./include/internal/cef_ptr.h:146:1: error: unknown type name 'template'
template <class T>
^
./include/internal/cef_ptr.h:146:10: error: expected identifier or '('
template <class T>
         ^
In file included from /workspace/client-jni/cefclient Helper/main.m:10:
In file included from /workspace/client-jni/include/cef_app.h:42:
In file included from ./include/cef_base.h:44:
In file included from ./include/internal/cef_types_wrappers.h:36:
./include/internal/cef_types.h:84:29: warning: redefinition of typedef 'char16' is a C11 feature [-Wtypedef-redefinition]
typedef unsigned short      char16;
                            ^
In file included from /workspace/client-jni/cefclient Helper/main.m:10:
In file included from /workspace/client-jni/include/cef_app.h:42:
In file included from ./include/cef_base.h:44:
In file included from ./include/internal/cef_types_wrappers.h:34:
In file included from ./include/internal/cef_string.h:48:
./include/internal/cef_string_types.h:53:24: note: previous definition is here
typedef unsigned short char16;  // NOLINT (runtime/int)
                       ^
In file included from /workspace/client-jni/cefclient Helper/main.m:10:
In file included from /workspace/client-jni/include/cef_app.h:42:
In file included from ./include/cef_base.h:44:
./include/internal/cef_types_wrappers.h:41:1: error: unknown type name 'template'
template <class traits>
^
./include/internal/cef_types_wrappers.h:41:10: error: expected identifier or '('
template <class traits>
         ^
./include/internal/cef_types_wrappers.h:138:3: error: type name does not allow storage class to be specified
  typedef cef_rect_t struct_type;
  ^
./include/internal/cef_types_wrappers.h:140:3: error: type name does not allow storage class to be specified
  static inline void init(struct_type* s) {}
  ^
./include/internal/cef_types_wrappers.h:140:10: error: type name does not allow function specifier to be specified
  static inline void init(struct_type* s) {}
         ^
./include/internal/cef_types_wrappers.h:140:27: error: unknown type name 'struct_type'
  static inline void init(struct_type* s) {}
                          ^
./include/internal/cef_types_wrappers.h:140:42: error: expected ';' at end of declaration list
  static inline void init(struct_type* s) {}
                                         ^
                                         ;
./include/internal/cef_types_wrappers.h:140:22: error: field 'init' declared as a function
  static inline void init(struct_type* s) {}
                     ^
./include/internal/cef_types_wrappers.h:152:1: error: unknown type name 'class'; did you mean 'Class'?
class CefRect : public CefStructBase<CefRectTraits> {
^~~~~
Class
In file included from /workspace/client-jni/cefclient Helper/main.m:9:
In file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk/System/Library/Frameworks/Cocoa.framework/Headers/Cocoa.h:12:
In file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.h:8:
In file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSObjCRuntime.h:7:
In file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk/usr/include/objc/NSObjCRuntime.h:9:
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk/usr/include/objc/objc.h:37:28: note: 'Class' declared here
typedef struct objc_class *Class;
                           ^
In file included from /workspace/client-jni/cefclient Helper/main.m:10:
In file included from /workspace/client-jni/include/cef_app.h:42:
In file included from ./include/cef_base.h:44:
./include/internal/cef_types_wrappers.h:152:15: error: expected ';' after top level declarator
class CefRect : public CefStructBase<CefRectTraits> {
              ^
              ;
./include/internal/cef_types_wrappers.h:152:17: error: unknown type name 'public'
class CefRect : public CefStructBase<CefRectTraits> {
                ^
./include/internal/cef_types_wrappers.h:152:37: error: expected ';' after top level declarator
class CefRect : public CefStructBase<CefRectTraits> {
                                    ^
                                    ;
./include/internal/cef_types_wrappers.h:152:38: error: cannot find protocol declaration for 'CefRectTraits'
class CefRect : public CefStructBase<CefRectTraits> {
                                     ^
./include/internal/cef_types_wrappers.h:152:37: warning: protocol has no object type specified; defaults to qualified 'id'
class CefRect : public CefStructBase<CefRectTraits> {
                                    ^~~~~~~~~~~~~~~
                                    id
./include/internal/cef_types_wrappers.h:152:53: error: expected identifier or '('
class CefRect : public CefStructBase<CefRectTraits> {
                                                    ^
./include/internal/cef_types_wrappers.h:169:1: error: 'inline' can only appear on functions
inline bool operator==(const CefRect& a, const CefRect& b) {
^
./include/internal/cef_types_wrappers.h:169:21: error: invalid '==' at end of declaration; did you mean '='?
inline bool operator==(const CefRect& a, const CefRect& b) {
                    ^~
                    =
./include/internal/cef_types_wrappers.h:169:30: error: unknown type name 'CefRect'; did you mean 'CGRect'?
inline bool operator==(const CefRect& a, const CefRect& b) {
                             ^~~~~~~
                             CGRect
In file included from /workspace/client-jni/cefclient Helper/main.m:9:
In file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk/System/Library/Frameworks/Cocoa.framework/Headers/Cocoa.h:12:
In file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.h:38:
In file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSKeyedArchiver.h:8:
In file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSGeometry.h:13:
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGGeometry.h:45:23: note: 'CGRect' declared here
typedef struct CGRect CGRect;
                      ^
fatal error: too many errors emitted, stopping now [-ferror-limit=]


Some ideas? Don't know what to do :/
edominic
Mentor
 
Posts: 82
Joined: Fri Mar 13, 2015 6:46 am

Re: Building own helper executable

Postby magreenblatt » Thu Mar 26, 2015 11:50 am

Try starting with the cefclient or cefsimple sample application, or at least referencing the CMake configuration in order to set up your project correctly.
magreenblatt
Site Admin
 
Posts: 12402
Joined: Fri May 29, 2009 6:57 pm


Return to Support Forum

Who is online

Users browsing this forum: No registered users and 40 guests