I'm having trouble compiling in Visual Studio

We have a released project under iOS and Android and we are considering releasing a version on Windows. This is from Cocos V3. I opened it up in Visual Studio 2019 for the first time and it said it needed to update the project. I allowed it to do so as it couldn’t compile otherwise. I try to compile it now and I get all sorts of errors in the Cocos engine when compiling. As I have not edited the engine, I am assuming its because I do not have the project configured right. Here is a small sample of the errors I am getting

expected a ‘{’ C:\Users\holtk\Documents\GitHub\igun-pro-2-client-cpp\cocos2d\cocos\base\CCConsole.h 62

void CC_DLL log(const char * format, ...) CC_FORMAT_PRINTF(1, 2);

|Error|C2039|‘function’: is not a member of ‘std’ (compiling source file …\audio\win32\AudioCache.cpp)

void addPlayCallback(const std::function<void()>& callback);

There are 126 errors, but I was hoping this might give a hint as to what is going wrong. I’ve installed the “Universal Windows Platform Development” as was suggested in an article on the internet for this type of error, but it didn’t help. Any additional help would be appreciated!


It might be best to run cocos new and and use that VS project and re-import your source and assets.

Also, using CMAKE moving forward could make some of these cross-platform nightmares go away. I’m speaking from my own experience, lol.