2013-10-15 2 views
1

자, Chromium Embedded Framework 3을 사용하는 프로젝트를 컴파일 중입니다. 저는 Visual Studio 2013 RC에서 Windows 7 64 비트를 사용하고 있습니다. 공식적으로 VS2013 RC는 CEF3에서 지원되지 않습니다. 그러나 VS2013에서만 사용할 수있는 C++ 11 기능으로 인해 VS2013이 필요합니다.EnterCriticalSection 식별자를 찾을 수 없습니다.

CEF3 64 비트 바이너리를 다운로드하고 VS2013을 사용하여 샘플 응용 프로그램을 컴파일했습니다. 아름답게 작동했습니다 (비록 cef3 헤더 파일에 <algorithm> 헤더 파일을 추가해야만했습니다).

이제 CEF3 파일 중 일부를 프로젝트에 포함 시키면 많은 컴파일 오류가 발생합니다. 나는 SCons를 사용하여 프로젝트를 컴파일하고있다. 뛰어

scons: Reading SConscript files ... 
scons: done reading SConscript files. 
scons: Building targets ... 
cl /Fobuild\gui\GUI.obj /c src\gui\GUI.cpp /TP /w /wd4350 /EHsc /MD /DDEBUG /DPACKAGE_VERSION=\"0.0.1\" /DPACKAGE_BUGREPORT=\"https://github.com/jarrettchisholm/glr/issues\" /DBOOST_SPIRIT_USE_PHOENIX_V3 
cl /Fobuild\gui\HtmlGuiComponent.obj /c src\gui\HtmlGuiComponent.cpp /TP /w /wd4350 /EHsc /MD /DDEBUG /DPACKAGE_VERSION=\"0.0.1\" /DPACKAGE_BUGREPORT=\"https://github.com/jarrettchisholm/glr/issues\" /DBOOST_SPIRIT_USE_PHOENIX_V3 
GUI.cpp 
HtmlGuiComponent.cpp 
cl /Fobuild\models\ModelManager.obj /c src\models\ModelManager.cpp /TP /w /wd4350 /EHsc /MD /DDEBUG /DPACKAGE_VERSION=\"0.0.1\" /DPACKAGE_BUGREPORT=\"https://github.com/jarrettchisholm/glr/issues\" /DBOOST_SPIRIT_USE_PHOENIX_V3 
ModelManager.cpp 
cl /Fobuild\glw\Animation.obj /c src\glw\Animation.cpp /TP /w /wd4350 /EHsc /MD /DDEBUG /DPACKAGE_VERSION=\"0.0.1\" /DPACKAGE_BUGREPORT=\"https://github.com/jarrettchisholm/glr/issues\" /DBOOST_SPIRIT_USE_PHOENIX_V3 
Animation.cpp 
C:\Users\Jarrett\projects\cef_binary_3.1547.1412_windows64\include/internal/cef_types_win.h(55) : error C2146: syntax error : missing ';' before identifier 'instance' 
C:\Users\Jarrett\projects\cef_binary_3.1547.1412_windows64\include/internal/cef_types_win.h(55) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int 
C:\Users\Jarrett\projects\cef_binary_3.1547.1412_windows64\include/internal/cef_types_win.h(70) : error C2146: syntax error : missing ';' before identifier 'parent_window' 
C:\Users\Jarrett\projects\cef_binary_3.1547.1412_windows64\include/internal/cef_types_win.h(70) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int 
C:\Users\Jarrett\projects\cef_binary_3.1547.1412_windows64\include/internal/cef_types_win.h(71) : error C2146: syntax error : missing ';' before identifier 'menu' 
C:\Users\Jarrett\projects\cef_binary_3.1547.1412_windows64\include/internal/cef_types_win.h(71) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int 
C:\Users\Jarrett\projects\cef_binary_3.1547.1412_windows64\include/internal/cef_types_win.h(86) : error C2146: syntax error : missing ';' before identifier 'window' 
C:\Users\Jarrett\projects\cef_binary_3.1547.1412_windows64\include/internal/cef_types_win.h(86) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int 
C:\Users\Jarrett\projects\cef_binary_3.1547.1412_windows64\include/internal/cef_types.h(83) : error C2371: 'char16' : redefinition; different basic types 
     C:\Users\Jarrett\projects\cef_binary_3.1547.1412_windows64\include/internal/cef_string_types.h(51) : see declaration of 'char16' 
C:\Users\Jarrett\projects\cef_binary_3.1547.1412_windows64\include/internal/cef_win.h(65) : error C2146: syntax error : missing ';' before identifier 'm_sec' 
C:\Users\Jarrett\projects\cef_binary_3.1547.1412_windows64\include/internal/cef_win.h(65) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int 
C:\Users\Jarrett\projects\cef_binary_3.1547.1412_windows64\include/internal/cef_win.h(52) : error C2065: 'm_sec' : undeclared identifier 
C:\Users\Jarrett\projects\cef_binary_3.1547.1412_windows64\include/internal/cef_win.h(52) : error C2065: 'CRITICAL_SECTION' : undeclared identifier 
C:\Users\Jarrett\projects\cef_binary_3.1547.1412_windows64\include/internal/cef_win.h(52) : error C2070: 'unknown-type': illegal sizeof operand 
C:\Users\Jarrett\projects\cef_binary_3.1547.1412_windows64\include/internal/cef_win.h(53) : error C2065: 'm_sec' : undeclared identifier 
C:\Users\Jarrett\projects\cef_binary_3.1547.1412_windows64\include/internal/cef_win.h(53) : error C3861: 'InitializeCriticalSection': identifier not found 
C:\Users\Jarrett\projects\cef_binary_3.1547.1412_windows64\include/internal/cef_win.h(56) : error C2065: 'm_sec' : undeclared identifier 
C:\Users\Jarrett\projects\cef_binary_3.1547.1412_windows64\include/internal/cef_win.h(56) : error C3861: 'DeleteCriticalSection': identifier not found 
C:\Users\Jarrett\projects\cef_binary_3.1547.1412_windows64\include/internal/cef_win.h(59) : error C2065: 'm_sec' : undeclared identifier 
C:\Users\Jarrett\projects\cef_binary_3.1547.1412_windows64\include/internal/cef_win.h(59) : error C3861: 'EnterCriticalSection': identifier not found 
C:\Users\Jarrett\projects\cef_binary_3.1547.1412_windows64\include/internal/cef_win.h(62) : error C2065: 'm_sec' : undeclared identifier 
C:\Users\Jarrett\projects\cef_binary_3.1547.1412_windows64\include/internal/cef_win.h(62) : error C3861: 'LeaveCriticalSection': identifier not found 
C:\Users\Jarrett\projects\cef_binary_3.1547.1412_windows64\include/internal/cef_win.h(84) : error C2039: 'instance' : is not a member of '_cef_main_args_t' 
     C:\Users\Jarrett\projects\cef_binary_3.1547.1412_windows64\include/internal/cef_types_win.h(54) : see declaration of '_cef_main_args_t' 
     C:\Users\Jarrett\projects\cef_binary_3.1547.1412_windows64\include/internal/cef_types_win.h(54) : see declaration of '_cef_main_args_t' 
C:\Users\Jarrett\projects\cef_binary_3.1547.1412_windows64\include/internal/cef_win.h(96) : error C2061: syntax error : identifier 'HINSTANCE' 
C:\Users\Jarrett\projects\cef_binary_3.1547.1412_windows64\include/internal/cef_win.h(96) : error C2535: 'CefMainArgs::CefMainArgs(void)' : member function already defined or declared 
     C:\Users\Jarrett\projects\cef_binary_3.1547.1412_windows64\include/internal/cef_win.h(93) : see declaration of 'CefMainArgs::CefMainArgs' 
C:\Users\Jarrett\projects\cef_binary_3.1547.1412_windows64\include/internal/cef_win.h(97) : error C2065: 'instance' : undeclared identifier 
C:\Users\Jarrett\projects\cef_binary_3.1547.1412_windows64\include/internal/cef_win.h(97) : error C2065: 'hInstance' : undeclared identifier 
C:\Users\Jarrett\projects\cef_binary_3.1547.1412_windows64\include/internal/cef_win.h(120) : error C2039: 'parent_window' : is not a member of '_cef_window_info_t' 
     C:\Users\Jarrett\projects\cef_binary_3.1547.1412_windows64\include/internal/cef_types_win.h(61) : see declaration of '_cef_window_info_t' 
     C:\Users\Jarrett\projects\cef_binary_3.1547.1412_windows64\include/internal/cef_types_win.h(61) : see declaration of '_cef_window_info_t' 
C:\Users\Jarrett\projects\cef_binary_3.1547.1412_windows64\include/internal/cef_win.h(121) : error C2039: 'menu' : is not a member of '_cef_window_info_t' 
     C:\Users\Jarrett\projects\cef_binary_3.1547.1412_windows64\include/internal/cef_types_win.h(61) : see declaration of '_cef_window_info_t' 
     C:\Users\Jarrett\projects\cef_binary_3.1547.1412_windows64\include/internal/cef_types_win.h(61) : see declaration of '_cef_window_info_t' 
C:\Users\Jarrett\projects\cef_binary_3.1547.1412_windows64\include/internal/cef_win.h(122) : error C2039: 'window' : is not a member of '_cef_window_info_t' 
     C:\Users\Jarrett\projects\cef_binary_3.1547.1412_windows64\include/internal/cef_types_win.h(61) : see declaration of '_cef_window_info_t' 
     C:\Users\Jarrett\projects\cef_binary_3.1547.1412_windows64\include/internal/cef_types_win.h(61) : see declaration of '_cef_window_info_t' 
C:\Users\Jarrett\projects\cef_binary_3.1547.1412_windows64\include/internal/cef_win.h(139) : error C2061: syntax error : identifier 'HWND' 
C:\Users\Jarrett\projects\cef_binary_3.1547.1412_windows64\include/internal/cef_win.h(149) : error C2061: syntax error : identifier 'HWND' 
C:\Users\Jarrett\projects\cef_binary_3.1547.1412_windows64\include/internal/cef_win.h(165) : error C2061: syntax error : identifier 'HWND' 
C:\Users\Jarrett\projects\cef_binary_3.1547.1412_windows64\include/internal/cef_win.h(140) : error C2065: 'WS_CHILD' : undeclared identifier 
C:\Users\Jarrett\projects\cef_binary_3.1547.1412_windows64\include/internal/cef_win.h(140) : error C2065: 'WS_CLIPCHILDREN' : undeclared identifier 
C:\Users\Jarrett\projects\cef_binary_3.1547.1412_windows64\include/internal/cef_win.h(140) : error C2065: 'WS_CLIPSIBLINGS' : undeclared identifier 
C:\Users\Jarrett\projects\cef_binary_3.1547.1412_windows64\include/internal/cef_win.h(140) : error C2065: 'WS_TABSTOP' : undeclared identifier 
C:\Users\Jarrett\projects\cef_binary_3.1547.1412_windows64\include/internal/cef_win.h(141) : error C2065: 'WS_VISIBLE' : undeclared identifier 
C:\Users\Jarrett\projects\cef_binary_3.1547.1412_windows64\include/internal/cef_win.h(142) : error C2065: 'parent_window' : undeclared identifier 
C:\Users\Jarrett\projects\cef_binary_3.1547.1412_windows64\include/internal/cef_win.h(142) : error C2065: 'hWndParent' : undeclared identifier 
C:\Users\Jarrett\projects\cef_binary_3.1547.1412_windows64\include/internal/cef_win.h(143) : error C2065: 'windowRect' : undeclared identifier 
C:\Users\Jarrett\projects\cef_binary_3.1547.1412_windows64\include/internal/cef_win.h(143) : error C2228: left of '.left' must have class/struct/union 
     type is 'unknown-type' 
C:\Users\Jarrett\projects\cef_binary_3.1547.1412_windows64\include/internal/cef_win.h(144) : error C2065: 'windowRect' : undeclared identifier 
C:\Users\Jarrett\projects\cef_binary_3.1547.1412_windows64\include/internal/cef_win.h(144) : error C2228: left of '.top' must have class/struct/union 
     type is 'unknown-type' 
C:\Users\Jarrett\projects\cef_binary_3.1547.1412_windows64\include/internal/cef_win.h(145) : error C2065: 'windowRect' : undeclared identifier 
C:\Users\Jarrett\projects\cef_binary_3.1547.1412_windows64\include/internal/cef_win.h(145) : error C2228: left of '.right' must have class/struct/union 
     type is 'unknown-type' 
C:\Users\Jarrett\projects\cef_binary_3.1547.1412_windows64\include/internal/cef_win.h(145) : error C2228: left of '.left' must have class/struct/union 
     type is 'unknown-type' 
C:\Users\Jarrett\projects\cef_binary_3.1547.1412_windows64\include/internal/cef_win.h(146) : error C2065: 'windowRect' : undeclared identifier 
C:\Users\Jarrett\projects\cef_binary_3.1547.1412_windows64\include/internal/cef_win.h(146) : error C2228: left of '.bottom' must have class/struct/union 
     type is 'unknown-type' 
C:\Users\Jarrett\projects\cef_binary_3.1547.1412_windows64\include/internal/cef_win.h(146) : error C2228: left of '.top' must have class/struct/union 
     type is 'unknown-type' 
C:\Users\Jarrett\projects\cef_binary_3.1547.1412_windows64\include/internal/cef_win.h(150) : error C2065: 'WS_OVERLAPPEDWINDOW' : undeclared identifier 
C:\Users\Jarrett\projects\cef_binary_3.1547.1412_windows64\include/internal/cef_win.h(150) : error C2065: 'WS_CLIPCHILDREN' : undeclared identifier 
C:\Users\Jarrett\projects\cef_binary_3.1547.1412_windows64\include/internal/cef_win.h(150) : error C2065: 'WS_CLIPSIBLINGS' : undeclared identifier 
C:\Users\Jarrett\projects\cef_binary_3.1547.1412_windows64\include/internal/cef_win.h(151) : error C2065: 'WS_VISIBLE' : undeclared identifier 
C:\Users\Jarrett\projects\cef_binary_3.1547.1412_windows64\include/internal/cef_win.h(152) : error C2065: 'parent_window' : undeclared identifier 
C:\Users\Jarrett\projects\cef_binary_3.1547.1412_windows64\include/internal/cef_win.h(152) : error C2065: 'hWndParent' : undeclared identifier 
C:\Users\Jarrett\projects\cef_binary_3.1547.1412_windows64\include/internal/cef_win.h(153) : error C2065: 'CW_USEDEFAULT' : undeclared identifier 
C:\Users\Jarrett\projects\cef_binary_3.1547.1412_windows64\include/internal/cef_win.h(154) : error C2065: 'CW_USEDEFAULT' : undeclared identifier 
C:\Users\Jarrett\projects\cef_binary_3.1547.1412_windows64\include/internal/cef_win.h(155) : error C2065: 'CW_USEDEFAULT' : undeclared identifier 
C:\Users\Jarrett\projects\cef_binary_3.1547.1412_windows64\include/internal/cef_win.h(156) : error C2065: 'CW_USEDEFAULT' : undeclared identifier 
C:\Users\Jarrett\projects\cef_binary_3.1547.1412_windows64\include/internal/cef_win.h(158) : error C2065: 'windowName' : undeclared identifier 
C:\Users\Jarrett\projects\cef_binary_3.1547.1412_windows64\include/internal/cef_win.h(158) : error C2228: left of '.c_str' must have class/struct/union 
     type is 'unknown-type' 
C:\Users\Jarrett\projects\cef_binary_3.1547.1412_windows64\include/internal/cef_win.h(158) : error C2228: left of '.length' must have class/struct/union 
     type is 'unknown-type' 
C:\Users\Jarrett\projects\cef_binary_3.1547.1412_windows64\include/internal/cef_win.h(158) : error C2660: 'cef_string_utf16_set' : function does not take 3 arguments 
C:\Users\Jarrett\projects\cef_binary_3.1547.1412_windows64\include/internal/cef_win.h(167) : error C2065: 'parent_window' : undeclared identifier 
C:\Users\Jarrett\projects\cef_binary_3.1547.1412_windows64\include/internal/cef_win.h(167) : error C2065: 'hWndParent' : undeclared identifier 
C:\Users\Jarrett\projects\cef_binary_3.1547.1412_windows64\include/cef_base.h(98) : error C3861: 'InterlockedIncrement': identifier not found 
C:\Users\Jarrett\projects\cef_binary_3.1547.1412_windows64\include/cef_base.h(105) : error C3861: 'InterlockedDecrement': identifier not found 
C:\Users\Jarrett\projects\cef_binary_3.1547.1412_windows64\include/cef_browser.h(287) : error C2146: syntax error : missing ';' before identifier 'GetWindowHandle' 
C:\Users\Jarrett\projects\cef_binary_3.1547.1412_windows64\include/cef_browser.h(287) : error C2433: 'CefBrowserHost::HWND' : 'virtual' not permitted on data declarations 
C:\Users\Jarrett\projects\cef_binary_3.1547.1412_windows64\include/cef_browser.h(287) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int 
C:\Users\Jarrett\projects\cef_binary_3.1547.1412_windows64\include/cef_browser.h(295) : error C2146: syntax error : missing ';' before identifier 'GetOpenerWindowHandle' 
C:\Users\Jarrett\projects\cef_binary_3.1547.1412_windows64\include/cef_browser.h(295) : error C2433: 'CefBrowserHost::HWND' : 'virtual' not permitted on data declarations 
C:\Users\Jarrett\projects\cef_binary_3.1547.1412_windows64\include/cef_browser.h(295) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int 
C:\Users\Jarrett\projects\cef_binary_3.1547.1412_windows64\include/cef_browser.h(468) : error C2061: syntax error : identifier 'MSG' 
C:\Users\Jarrett\projects\cef_binary_3.1547.1412_windows64\include/cef_browser.h(474) : error C2061: syntax error : identifier 'MSG' 
C:\Users\Jarrett\projects\cef_binary_3.1547.1412_windows64\include/cef_browser.h(287) : error C2253: 'CefBrowserHost::GetWindowHandle' : pure specifier or abstract override specifier only allowed on virtual function 
C:\Users\Jarrett\projects\cef_binary_3.1547.1412_windows64\include/cef_browser.h(295) : error C2253: 'CefBrowserHost::GetOpenerWindowHandle' : pure specifier or abstract override specifier only allowed on virtual function 
C:\Users\Jarrett\projects\cef_binary_3.1547.1412_windows64\include/cef_keyboard_handler.h(59) : error C2061: syntax error : identifier 'MSG' 
C:\Users\Jarrett\projects\cef_binary_3.1547.1412_windows64\include/cef_keyboard_handler.h(71) : error C2061: syntax error : identifier 'MSG' 
C:\Users\Jarrett\projects\cef_binary_3.1547.1412_windows64\include/cef_render_handler.h(129) : error C2061: syntax error : identifier 'HCURSOR' 
src\gui\HtmlGuiComponent.cpp(179) : error C2082: redefinition of formal parameter 'clickCount' 
scons: building terminated because of errors. 

일부 오류 : 그것은

오류

은 ... 거의 몇 가지 변수를 정의 같은 CEF3 헤더 파일 (들) <windows.h>의 헤더 파일을 포함 할 때 호출/설정되지 않습니다 보인다 나에 있습니다 : 그것은 EnterCriticalSection 전화를 시도하기 전에 cef_win.h 명확하게 <windows.h>을 포함로

\cef_binary_3.1547.1412_windows64\include/internal/cef_win.h(59) : error C3861: 'EnterCriticalSection': identifier not found 

그러나이 발견해야한다.

발생하지 않아야하는 것처럼 보이는 여러 가지 다른 오류가 있습니다.

내 프로젝트에서 사용하는 동일한 CEF3 헤더 파일을 포함하고 SCons를 사용하여 컴파일 된 간단한 샘플 파일을 만들었으므로 제대로 컴파일되었습니다. 샘플 앱은 다음과 같습니다.

/* Sample C/C++, Windows, link to kernel32.dll */ 
#include <cef_app.h> 
#include <cef_client.h> 
#include <cef_render_handler.h> 


static CRITICAL_SECTION cs; /* This is the critical section object -- once initialized, 
           it cannot be moved in memory */ 
          /* If you program in OOP, declare this as a non-static member in your class */ 
void f() 
{ 
    /* Enter the critical section -- other threads are locked out */ 
    EnterCriticalSection(&cs); 

    /* Do some thread-safe processing! */ 

    /* Leave the critical section -- other threads can now EnterCriticalSection() */ 
    LeaveCriticalSection(&cs); 
} 

int main() 
{ 
    /* Initialize the critical section before entering multi-threaded context. */ 
    InitializeCriticalSection(&cs); 

    f(); 

    /* Release system object when all finished -- usually at the end of the cleanup code */ 
    DeleteCriticalSection(&cs); 

    return 0; 
} 

누구나 이러한 오류가 발생하는 이유는 무엇입니까? 의견에 따라

+0

시도를 정의하기 때문에 windows.h 파일은 포함되지 않았습니다 - 당신이 얻을 수있는 다른 두 번째, 세 번째 등의 오류, 예를 들어 cef_types_win.h (55)에서 무엇입니까? –

+0

하지만 그게 문제 야 (내 생각) : 55 행이나 그 근처의 구문 오류가 없습니다 ... – Jarrett

+0

구문 오류 : ';'가 없습니다. 식별자 '인스턴스'앞에 일반적으로 컴파일러가 변수 인스턴스의 유형을 해석 할 수 없다는 것을 의미하고 함수의 이름이라고 가정합니다. –

답변

2

는 : 다른 스크립트는 1 오류를 수정할 수 있도록 그들 중 일부는 나중에 오류를 생성 할 수 있습니다 원인, 처음부터 오류를 제거하는 _WINDOWS_

관련 문제