CCDatavisitor.h #include <string> string file not found xcode 4.6.3

CCDatavisitor.h #include <string> string file not found xcode 4.6.3
0.0 0



I´ve just updated to cocos2dx (I have also updated to xcode 4.6.3) and updated the libraries on my ios project as well.

The first thing that appeared when i tried to build was #include string file not found (CCDatavisitor.h).

The project worked fine before I performed these two updates.

I wrote to the cocod2d-iphone forum but so far no replies. So I turn to you.

Can anyone help me solve this?


i’ve a same issue.
how can i fix this? - _-)a


Did anyone fix this? I suddenly started getting this error from one day to the other :-/


Same problem for me. Really strange!
My config:
cocos2d-x 2.1.4
XCode 4.6.2
Visibly, it appears when you make a first clean of your project before compiling it.


I managed to solve it :slight_smile:
It occurred I was including an Obj-C Class (.h and .m file), which somehow produced that error in Cocos2D. I guess it has to do with the automatic recognition of language by Xcode during compiling. After I renamed the .m file extension to .mm the error went away. So you might want to check if you have such case in your project.


Thanks for the info but all the classes I created are .cpp. Which obj-C class did you include?

By the way, I found a great workaround to solve it:

It offers the double advantage to solve that issue and to prepare all the files structure to deploy your project on any device. That works well for me :slight_smile:


Ok So I am on XCode 5 and I still have this issue for- cocos2d-x-3.0alpha1

Any help ?? … I

to create the project I ran something like this
/ p gameNAmek com.companname.gameNAme-l cpp

But I keep getting this error - CCDatavisitor.h #include string file not found…

thanks in advance


I’m using Cocos2dx 2.2, and this issue occurred to me when I add some required framework and admob plugin and helper class written by senior programmer. I can run the build perfectly before :frowning:

* Update*
I revert my build to last working state before this error occurred. And write the Objective C code by myself. And it’s working :slight_smile:
I guess there are some framework or library or includes that cause this error. And as long you did not call them, this error not show up.


I want to share how I solved it.
Recently I writing the code for in app purchase in iOS which is using Objective C. Then I have to set a C*+ static variable to communicate from Objective C to get my C*+ code update the UI. This is where I got this error. Whenever this error occurred, I can’t get it working again by remove the code that cause this error. This is very frustating part. I have to revert my build from backup to get it working again.

Fortunately, I got the answer from someone in stackoverflow. This is caused by the compiler does not recognize the C++ variable, because the compiler is compiling an ObjectiveC code, so you have to change the Identity and Type of your class on the right side panel of your XCode to “Objective-C++ Source”. And, you have to find your cross language code source by yourself, because you will not get an address of the problem from the log.


In my case I had copied data files in sharedresource folder.
Please make sure SharedResource and Resource folders contain only media files.


this error comes specially when your import any .cpp file in your .m file actually difference of compiling unit.this issue occurred in my app and it was very difficult for me to sort out bec it was not pointing at the class where i import .cpp class so what i did i had a backup of my app and i moved my new file bit by bit there checking if that file was creating a prob and finally i figured out in IAP.m file i add the reference of .cpp file class as when as i removed that the error wents :slight_smile:
error image

you can see inAppPurchaseLayer.h is my cpluscplus file and when i remove that the error went away



Sorry for asking here, I know I am breaking some forum’s rules but I didn’t find a solution.
I am new to the forum and I did find how to post a new message.

Thanks for help.