Can't build CEFClient

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.

Can't build CEFClient

Postby mrborman » Tue Aug 14, 2018 5:21 am

Hello!
I'm trying to build a cefclient example using a 'cef_binary_3.3440.1805.gbe070f9_windows32' and "MSVC++ 2010 Express"
I got an 'ALL_BUILD.vcxproj' using the 'cmake -G "Visual Studio 10 2010"', and then I'm trying to build an cefclient.
I got the following output:

1>------ Build started: Project: ZERO_CHECK, Configuration: Debug Win32 ------
1> Checking Build System
1> CMake does not need to re-run because D:/soft/VCpp10/VC/projects/test8/CMakeFiles/generate.stamp is up-to-date.
...
1> CMake does not need to re-run because D:/soft/VCpp10/VC/projects/test8/tests/ceftests/CMakeFiles/generate.stamp is up-to-date.

2>------ Build started: Project: libcef_dll_wrapper, Configuration: Debug Win32 ------
2> Building Custom Rule D:/soft/VCpp10/VC/projects/test8/libcef_dll/CMakeLists.txt
2> CMake does not need to re-run because D:/soft/VCpp10/VC/projects/test8/libcef_dll_wrapper/CMakeFiles/generate.stamp is up-to-date.
2> transfer_util.cc
....
2> libcef_dll_wrapper.cc
2> libcef_dll_wrapper2.cc
2>cef_string16.obj : warning LNK4221: This object file does not define any previously undefined public symbols, so it will not be used by any link operation that consumes this library
2> libcef_dll_wrapper.vcxproj -> D:\soft\VCpp10\VC\projects\test8\libcef_dll_wrapper\Debug\libcef_dll_wrapper.lib

3>------ Build started: Project: cefclient, Configuration: Debug Win32 ------
3> Building Custom Rule D:/soft/VCpp10/VC/projects/test8/tests/cefclient/CMakeLists.txt
3> CMake does not need to re-run because D:/soft/VCpp10/VC/projects/test8/tests/cefclient/CMakeFiles/generate.stamp is up-to-date.
3> binding_test.cc
...
3> window_test.cc
3>browser\server_test.cc(213): error C2220: warning treated as error - no 'object' file generated
3> window_test_runner.cc
3>browser\server_test.cc(213): warning C4355: 'this' : used in base member initializer list
3> client_app_browser.cc
...
3> views_window.cc
3>browser\osr_ime_handler_win.cc(100): error C2059: syntax error : '{'
3>browser\osr_ime_handler_win.cc(100): error C2143: syntax error : missing ';' before '{'
3>browser\osr_ime_handler_win.cc(100): error C2143: syntax error : missing ';' before '}'
3> window_test_runner_views.cc
3> window_test_runner_win.cc
3>browser\root_window_win.cc(7): fatal error C1083: Cannot open include file: 'shellscalingapi.h': No such file or directory
3> main_message_loop_external_pump_win.cc
3> resource_util_win.cc
3> util_win.cc
========== Build: 2 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========

So, libcef_dll_wrapper.lib has been created, but cefclient - no.

What i'm doing wrong?

Why i have errors in the 'browser\osr_ime_handler_win.cc' ?
---
OsrImeHandlerWin::OsrImeHandlerWin(HWND hwnd)
: is_composing_(false),
input_language_id_(LANG_USER_DEFAULT),
system_caret_(false),
cursor_index_(-1),
hwnd_(hwnd) {
ime_rect_ = {-1, -1, 0, 0};
}
---
Why error in line ' ime_rect_ = {-1, -1, 0, 0};' ?

Where is a 'shellscalingapi.h' ?

Thanks.
mrborman
Newbie
 
Posts: 5
Joined: Wed Jul 18, 2018 10:26 pm

Re: Can't build CEFClient

Postby magreenblatt » Tue Aug 14, 2018 11:00 am

Why are you using MSVC++ 2010 Express? If you're going to use the free version you might as well be using 2017.
magreenblatt
Site Admin
 
Posts: 12409
Joined: Fri May 29, 2009 6:57 pm

Re: Can't build CEFClient

Postby mrborman » Wed Aug 15, 2018 9:49 am

So, you means that it is unable to build cefclient in 2010 studio?
mrborman
Newbie
 
Posts: 5
Joined: Wed Jul 18, 2018 10:26 pm

Re: Can't build CEFClient

Postby magreenblatt » Wed Aug 15, 2018 10:31 am

mrborman wrote:So, you means that it is unable to build cefclient in 2010 studio?

That seems likely.
magreenblatt
Site Admin
 
Posts: 12409
Joined: Fri May 29, 2009 6:57 pm

Re: Can't build CEFClient

Postby ndesktop » Thu Aug 16, 2018 2:11 am

2010 cannot be used without patching Visual Studio 2010 header files. I remember I need to patch for version 1916, which is Chromium 25 (so like forever).

In case it can be of any inspiration:
patchenv-2010.py
Code: Select all
import sys

nul = '\0'

def patch_env(envfile, patch_include):
  f = open(envfile, 'rb')
  buf = f.read()
  result = []
  current = ''
  marker = nul
  for block in buf:
    current += block
    while 1:
      markerpos = current.find(nul)
      if markerpos == -1:
        break
      result.append(current[:markerpos])
      current = current[markerpos + len(marker):]
  result.append(current)
  patched_result = []
  for r in result:
    if len(r) != 0:
      # print r
      k, v = r.split('=')
      if k == 'INCLUDE':
        v = patch_include + ';' + v
      patched_result.append([k, v])
  f.close()
  envblock = ''
  for k,v in patched_result:
    envblock += k + '=' + v + nul
  envblock += nul
  with open(envfile, 'wb') as env_file:
    env_file.write(envblock)

def patch_environment(root_dir, include_path):
  dir = root_dir
  if dir[-1] != '\\':
    dir += '\\'
  platform = ['x86', 'x64']
  cfg = ['Debug', 'Release']
  patch_include = include_path
  for p in platform:
    for c in cfg:
      envfile = '\\' if root_dir[-1] != '\\' else '' + 'chromium\\src\\out\\' + c + '\\environment.' + p
      patch_env(envfile, patch_include)

if __name__ == '__main__':
  patch_environment(sys.argv[1], sys.argv[2])
Attachments
patch.zip
(14.93 KiB) Downloaded 442 times
ndesktop
Master
 
Posts: 756
Joined: Thu Dec 03, 2015 10:10 am


Return to Support Forum

Who is online

Users browsing this forum: No registered users and 29 guests