chromiumembedded / cef

Chromium Embedded Framework (CEF). A simple framework for embedding Chromium-based browsers in other applications.
https://bitbucket.org/chromiumembedded/cef/
Other
3.38k stars 467 forks source link

cef_ptr.h Line 167: 'dword': illegal type for non-type template parameter 'ptr' #3731

Closed Akrelion45 closed 4 months ago

Akrelion45 commented 4 months ago

Alright, this is a kinda weird problem, probably somehow on my end? (I suppose), but I couldn't find a solution at all.

I am trying to integrate CEF Browser in to an older C++ MMORPG, compiling as 32 bit application, Visual Studio 2017 and ISO C++17 Standard (/std:c++17).

I just included these 3 CEF files:

include "include/cef_app.h"

include "include/cef_browser.h"

include "include/cef_client.h"

And i instantly get these errors: Severity Code Description Project File Line Suppression State Details Error (active) E0952 a nontype template parameter may not have class type \include\CEF\include\internal\cef_ptr.h 167
Error (active) E0254 type name is not allowed \include\CEF\include\internal\cef_ptr.h 167
Error C2993 'dword': illegal type for non-type template parameter 'ptr' \include\cef\include\internal\cef_ptr.h 167
Error C2146 syntax error: missing '>' before identifier 'ptr' \include\cef\include\internal\cef_ptr.h 168
Error C2187 syntax error: 'identifier' was unexpected here \include\cef\include\internal\cef_ptr.h 168

I have also tried building CEF myself, but get the same errors in the end.

When i am trying to integrate a CEF Standard Application, it technically works fine, I don't get errors at all besides the errors i mentioned in my problem. So If i somehow manage to fix these, it should run. I tried all kinds of ChatGPT solutions, because I couldn't find this specific CEF problem anywhere, but everything failed yet.

Anyone has an idea what could cause the conflict with the cef_ptr.h?

The game has a StdH.h include which needs to be at the top with the following content:

#pragma warning(disable : 4996)

#ifdef _DEBUG
#define _CRTDBG_MAP_ALLOC
#endif 

#include <boost/function.hpp>
#include <Engine/Engine.h>
#include <Engine/Templates/Stock_CTextureData.h>
#include <Engine/Templates/Stock_CModelData.h>
#include <GameMP/Game.h>

/* rcg10042001 protect against Visual C-isms. */
#ifdef _MSC_VER
#define DECL_DLL _declspec(dllimport)
#endif

#ifdef PLATFORM_UNIX
#define DECL_DLL 
#endif

#include <EntitiesMP/Global.h>
#include <EntitiesMP/Common/Common.h>
#include <EntitiesMP/Common/GameInterface.h>
#include <EntitiesMP/Player.h>
#undef DECL_DLL

#define TECHTESTONLY 0

#include "Nksp.h"
//#include "Menu.h"
//#include "MenuGadgets.h"

#pragma warning(disable : 4996)

And the following preprocessor definitions: _USE_32BIT_TIME_T;WIN32;NDEBUG;_WINDOWS;_WINDLL;_AFXDLL;_USRDLL;%(PreprocessorDefinitions)

Versions (please complete the following information):