Transfer from http://blog.csdn.net/wangshubo1989/article/details/50180413
Now talk about how to build a LIBCEF operating environment in your own Win32 program.
The first is to build an empty Win32 project, such as the name TESTLIBCEF.
1. Copy the Cefsimple directory (note the Copy folder) to the new project and include it in the project ( Note that it is under the Testlibcef\testlibcef folder )
2. and under the Testlibcef\testlibcef folder, create a new DLL folder
Source copy all files under the Debug directory to this folder ()
3. Copy all files under the resource directory to this folder (Testlibcef\testlibcef\dll)
4. Copy the Include folder to the folder (note that it is a copy folder) (Testlibcef\testlibcef\dll)
5. Copy the Out\debug\lib\libcef_dll_wrapper.lib file to this folder (Testlibcef\testlibcef\dll)
(If you want to publish your application, you should copy the files in the corresponding release directory)
This time, your DLL folder is having these files:
6. add some header files and source files to the project, such as:
7. The next step is to modify the properties of the project, under the solution Testlibcef right-click on the property.
General page, set as follows:
8. The general "Additional inclusion directory" under C/+ + is added as follows:
9. Modify the preprocessor under C + + and add the following files:
_debugv8_deprecation_warningsblink_scale_filters_at_record_time_win32_winnt=0x0602Winver=0x0602win32_windowsnominmaxPsapi_version=1_crt_rand_scert_chain_para_has_extra_fieldswin32_lean_and_mean_atl_no_opengl_has_exceptions=0_secure_atlchromium_buildToolkit_views=1Use_aura=1Use_ash=1Use_default_render_theme=1Use_libjpeg_turbo=1Use_mojo=1enable_one_click_signinEnable_remoting=1Enable_webrtc=1enable_pepper_cdmsenable_configuration_policyenable_input_speechenable_notificationsEnable_hidpi=1Enable_eglimage=1__std_c_crt_secure_no_deprecate_scl_secure_no_deprecateNtddi_version=0x06020000_using_v110_sdk71_Enable_task_manager=1Enable_extensions=1Enable_plugin_installation=1Enable_plugins=1Enable_session_service=1Enable_themes=1enable_autofill_dialog=1enable_background=1enable_automation=1enable_google_now=1 Cld_version=2enable_full_printing=1ENABLE_PRINTING=1< Span class= "hljs-constant" >enable_spellcheck=1enable_captive_portal_detection=1< Span class= "hljs-constant" >enable_app_list=1enable_settings_app=1 enable_managed_users=1enable_mdns=1 enable_service_discovery=1using_cef_shared__stdc_constant_macros__stdc_format_ Macrosdynamic_annotations_enabled=1WTF_USE_DYNAMIC_ Annotations=1
The runtime changes to "multithreaded debugging MTD" in the Code generation
Linker, general, additional library directories are:
Because it's VS2015, this will be different from the VS2013 configuration.
C:\Program Files (x86)\Windows Kits\10\Lib\10.0.10150.0\ucrt\x86%(AdditionalLibraryDirectories)
linker, input, content as follows:
WinInet. Libdnsapi. libversion. libmsimg32. libws2_32. libusp10. Libpsapi. libdbghelp. libwinmm. Libshlwapi. libkernel32. libgdi32. libwinspool. libcomdlg32. libadvapi32 .libshell32.libole32 .liboleaut32.libuser32 .libuuid.libodbc32 .libodbccp32.libdelayimp .libcredui.libnetapi32 .libcomctl32.librpcrt4 .libopengl32.libglu32 .libd:\test\testlibcef\testlibcef\dll\libcef_dll_ Wrapper.libd:\test\testlibcef\testlibcef\dll\libcef< Span class= "Hljs-preprocessor" >.lib
linker, advanced, such as:
Compile the build project and copy all the contents of the DLL folder to the debug or Release folder.
Finally completed.
==============================================================
No accident, your program will not generate success, will prompt C2220 error, you may Google or Baidu, many people tell you to turn down the warning level, this is still not solve the problem. And good programming habits are all about warning as a mistake.
Can actually solve the problem like this:
Close VS2015;
Open the VS2015 software (without clicking on any solution);
Select file , open project , to locate the previously established TESTLIBCEF. sln file.
Success!!
As for the reason:
The code page of the original file is in English, and we are using the Chinese system. That's all.
================================================================
Few people will use pure Win32 applications, all using some libraries. The next section describes how to configure the LIBCEF environment in Duilib.
Learn libcef--to build your own LIBCEF operating environment (WIN32 program, error C2220 solution)