Mopub integration in objective C++ project



i currently working on implementing the mopub SDK in iOS our game ( )

the game is mostly written in C++ with a bit of objective C++. We use XCODE 7 and ios SDK 9.0

we dont have .m file in the project.

While following the get setting started guide , I experience an issue with the following step :

“Drag the MoPubSDK folder into your Xcode application group (be sure to check the “Copy items into destination group’s folder” option).”

If i tried to build after adding the folder, I can tons of errors like this in the project sources files

Unknown type name ‘namespace’

If I remove the mopub folder, the project compiles fine again.

Looks like there is a Objective C / C++ / Objective C++ mess but my previous attemps to fix was unsuccesfull.

I made a script to rename each .m file to .mm but looks like the mopub framework has some issue in objective C++ (I had to comment some parts , so I guess it s not the right solution)

Any tips for this ? maybe starting from a framework rather than source code will help. is there any particular reason why mopub guys ship the library as source code ?


After some investigation looks like the errors start when our precompiled header (c++) in compiled. I tried various fixes but without success for now. is there a guide to build mopub as a seperate library (or even better framework)

We use many third party libs / framework and it s the first time we are facing that kind of issues. framework distribution is way more flexible.


finally managed to make the SDK compile, now I have crash at launch in MoPub code (looks like some data are not properly validated) when calling loadRewardedVideoWithAdUnitID

something related to MPAdCondfiguration

Waiting for support reply now.