iOS 7 UIKit NSTextContainer initWithSize:(CGSize)size conflict - cocos2d-iphone

I have recently upgraded my xcode4.6 to 5.0 and I am facing conflict issues which I am not sure how to resolve.
I am using cocos2d library and CCGrid file in it is using UIKit framework.
Now UIKit function of NSTextContainer initWithSize:(CGSize)size is prompted as a conflict which causes error in CCGrid file of cocos2d.
Note : Cocos2d CCGrid used parameter of type ccGridSize till now,But Now prompted as a conflict.
Please suggest.

Related

std type_traits conflict with Qt type_traits

I have Qt 5.8 installed and i get this error.
I also have CONFIG += c++14 in my pro file and i also tried with c++11.
/usr/include/x86_64-linux-gnu/qt5/QtCore/qtimer.h:106: error: ‘is_same’ is not a member of ‘QtPrivate’!QtPrivate::is_same<const
also
/usr/include/c++/5/type_traits:958: note: ‘std::is_same’
struct is_same;
I've been doing some digging in the Qt git repository, based on the comment to the question by #DanielJour.
Looking to the history of file qtimer.h and correlating it to your error message (qtimer.h:106: error: ‘is_same’ is not a member...), I've found that this commit moved the call to is_same from line 106 to 112 (and never came back), so you are including a qtimer.h from before that commit.
That commit is from 2016-01-15 and it is included from Qt 5.7 onwards.
So my guess is that you have installed several different versions of Qt and somehow your program is including old headers, not the ones from Qt 5.8.
An additional note that leads me to that conclusion is that your header file is in /usr/include/x86_64-linux-gnu/qt5/, but the usual place where that is installed is in /usr/include/qt or /usr/include/qt5. Yours looks like a multilib or cross compiler path...

Unknown Type name 'class'; did you mean Class'? ERROR on CCApplicationProtocol.h, CCApplication.h and Expected ';' after top level declarator ERROR

I am using cocos2d-x on an iOS game. But I am getting some errors that are preventing the app to compile properly. Here's a screenshot to emphasize the issues:
Any ideas on how to fix those errors? I tried the Xcode suggested methods, like replacing class with Class, but this produces even more errors. Whatever Xcode suggested did not work.
Issues have been solved. I did not touch anything in code. I remember that I recently added few files into the cocos2dx project that was NATIVE iOS code:
ProjectFile.h
ProjectFile.m
ProjectFile.xib
I renamed that ProjectFile.m to ProjectFile.mm and it compiled without errors! So if you have any Objective C classes added into the project and see that error, try changing .m to .mm as Bo Perssoon suggested. THANKS!

Cocos2D 3.1 Xcode 4.5.2 Default project not compile

I have Xcode 4.5.2 and I installed Cocos2D 3.1.0. When I create a project, the default code doesn't compile. I have the error ARC Semantic Issue : No visible #interface for 'CCNode' declares the selector 'wasRunning'. There is the function -(void)wasRunning:(BOOL)wasRunning in CCNode.m but it's not declared in CCNode.h. So I put it in CCNode.h or move the function in CCNode.m at the beginning of CCNode.m, and the error disappears.
Then I have another error in CCScheduler.m : 'CCScheduledTarget' does not have a member named '_paused'. As I don't want to modify a DEFAULT project like that, I gave up to ask why I have those errors in a default project and how to correct them correctly?

BPM detection in iOS using soundtouch library

I am trying to implement beatdetection within an iOS application. I found a fairly simple framework called SoundTouch and tried to implement this according to
iOS SoundTouch framework BPM Detection example
Unfortunately none of my following efforts seem to work and am currently in a deadlock state hence my post to Stackoverflow.
I took the following steps:
Create single-view-based project
Imported the
Renamed mainViewController.m to ViewController.mm to make it compatible with c++
Instructed the UIViewController class of the ViewController to conform to the AVFoundationPlayerDelegate protocols.
Copy/Pasted the solution #MrHappyAsthma posted to his question
Refactored
player =[[AVAudioPlayer alloc] initWithData:data error:NULL];
to
AVAudioPlayer *player =[[AVAudioPlayer alloc] initWithData:data error:NULL];
Now the compiler is complaining on:
soundtouch::SAMPLETYPE sampleBuffer[len]; (use of undeclared variable soundtouch)
soundtouch::BPMDetect BPM(player.numberOfChannels, [[player.settings valueForKey:#"AVSampleRateKey"] longValue]); (use of undeclared variable soundtouch)
BPM.inputSamples(sampleBuffer, len/player.numberOfChannels); (use of undeclared variable BPM)
NSLog(#"Beats Per Minute = %f", BPM.getBpm()); (use of undeclared variable BPM)
I think my knowledge on C++ isn't what it should be and the objects soundtouch and BPM should be declared/initialized.
Thanks folks!
You need do the following in order to compile th project:
add #import <SoundTouch/BPMDetect.h> to your ViewController.mm;
add AVFoundation framework to your target (see picture);
set the language settings as shown in picture (specifically, use GNU C++ libstdc++).
I haven't tried to run the program, but it builds at least.

Cocos2D with new RevMobAds framework

Integrated new RevMob.frmework in Cocos2D games.
Now getting many compilation error in my Cocos2D 1.0 game and only linker error in other cocos2D 2.0 game.
In Cocos2D 2.0, Linker errors are:
"_SKStoreProductParameterITunesItemIdentifier", referenced from:
"_OBJC_CLASS_$_SKStoreProductViewController", referenced from:
Which system framework missed? Already added StoreKit.framework
In cocos2D 1.0, along with these linker error, getting some compilation errors too.
It is showing "Expected a property attribute before *, in below line(in RevMobAds.framewors)
#property (nonatomic, strong) NSArray *supportedInterfaceOrientations;
How can I over come all these problem and get new revMob sdk in cocos2d game?
This errors happen due to the use of LLVM GCC 4.2 as a compiler, to solve this issues just make the following changes:
RevMobBanner.h
line 35: change "strong" to "retain"
#property (nonatomic, retain) NSArray *supportedInterfaceOrientations;
RevMobButton.h
line 51: erase "atomic"
#property (readonly) RevMobButtonStatus status;
RevMobFullscreen.h
line 25: change "strong" to "retain"
#property(nonatomic, retain) NSArray *supportedInterfaceOrientations;
Linker error:
Make sure RevMob.framework is added to the target's "Link Binary with Libraries" build phase.
Compiler error:
Looks fine to me. Make sure #import is imported in that file. Better yet, add it to the prefix.pch if it's not there.
If you continue having issues I suggest getting support directly from RevMob.
Be sure to have the RevMob and StoreKit Frameworks added in the Build Phases: http://sdk.revmob.com/ios
Also, trying to upgrade your XCode, because this is related to a incompatibility issue with old versions of iOS.
Or wait for a new version of the SDK that may have this incompatibility issue fixed.