2

I am making a game that can be played on mac and windows with cocos2d-x.

I first wrote the code in mac's Xcode, and it worked on mac.

When I took the project to windows and tried to build it in Visual Studio 2017, an error occurred.

Error   C1083   Cannot open include file: 'cxxabi.h': No such file or directory Narazumono  c:\users\masanori\desktop\narazumono3.17\classes_win\nrzcoding.cpp  10  

I use cxxabi.h to get the class name of the object.

#include "NRZCoding.h"
#include <cxxabi.h>
#include <cstdio>
#include <algorithm>
#include "NRZUtils.h"

using namespace std;
USING_NS_CC;

namespace NRZCoding {

...

    const string& EncodableObject::getClassName()
    {
        if (_className.size() > 0) {
            return _className;
        }

        const type_info& id = typeid(*this);
        int stat;
        char *name = abi::__cxa_demangle(id.name(),0,0,&stat);

        CCASSERT(name != NULL && stat == 0, "failed to demangle");

        _className = string(name);
        free(name);
        return _className;
    }

...

What do I need to do?

I am using cocos2d-x 3.17.1 and Visual Studio 2017.

Thank you.

noprops
  • 311
  • 3
  • 12
  • 4
    `cxxabi.h` is GCC-specific header, it's not available in MSVC. See [Demangling in MSVC](https://stackoverflow.com/questions/13777681/demangling-in-msvc) to if you want to convert it to Microsoft compiler – Yksisarvinen Apr 12 '19 at 11:25

0 Answers0