Building with the latest Marmalade Changes

Hi,

I’ve had a number of issues getting up and running with Marmalade, partly waiting for them to fix the expat functionality as it was stopping me from building. I noticed Francis Styck’s updates this week and my build gets further no expat is removed and libxml used instead but I get the following compiler error in ftconfig.h

Lexical or Preprocessor issue: ‘AvailabilityMacros.h’ file not found

Does anyone have any ideas? The xcode project opens fine from the mkb file I have but as soon as I build the project I get the above error. Could there be something I am missing?

After further testing, I have found that if I comment out the calls for the newly added freetype and libjpeg it then fails with the following error:
ld: warning: directory not found for option ’L/Developer-4.2/Marmalade/5.2/Projects/AppName/AppName/cocos2dx/platform/third_party/marmalade/libxml2/lib/x86/darwin’
ld: library not found for
llibxml2_d

Cheers

Dave

Hi Dave,

I’m not sure where you are pulling the code from, I have mine at http://www.github.com/styck and it is working for me, at least under Visual Studio on a PC.

I searched through my project for ’AvailabilityMacros.h" and the only place it is located is the ftconfig.h, and for my case the code is greyed out, i.e. not used. Are you building on a MAC or PC? Giovanni and I are building on a PC with Visual Studio. You must have APPLE defined in your build and that is something we did not test.

The library that is not found should be at: cocos2dx\platform\third_party\marmalade\libxml2\lib\x86 for a x86 build not sure what it would be looking for if on a MAC.

I built the libraries from the code here: https://github.com/marmalade/marmalade-libxml2

Hope that helps some.

Regards

Francis

Hi Francis,

I am using a MacOSX environment and I’m having the same problem Dave mentioned above.

When compiling in arm mode, the error is:

/src/autofit/autofit.c:21:
/Users/Diego/Documents/iPhone/speedybiker-X/cocos2dx/platform/third_party/marmalade/freetype/include/freetype/config/ftconfig.h: In function ‘FT_MulFix_arm’:
/Users/Diego/Documents/iPhone/speedybiker-X/cocos2dx/platform/third_party/marmalade/freetype/include/freetype/config/ftconfig.h:354: error: ‘asm’ undeclared (first use in this function)
/Users/Diego/Documents/iPhone/speedybiker-X/cocos2dx/platform/third_party/marmalade/freetype/include/freetype/config/ftconfig.h:354: error: (Each undeclared identifier is reported only once
/Users/Diego/Documents/iPhone/speedybiker-X/cocos2dx/platform/third_party/marmalade/freetype/include/freetype/config/ftconfig.h:354: error: for each function it appears in.)
/Users/Diego/Documents/iPhone/speedybiker-X/cocos2dx/platform/third_party/marmalade/freetype/include/freetype/config/ftconfig.h:354: error: expected ‘;’ before ‘volatile

Is the freetype library strictly necessary? Or we can build without it?

Thanks,
Diego

Hi Diego,

I have a MAC mini that I can try to see what is going on, I’ll have to install Marmalade on the MAC but probably will not have time until next week.

I’m not sure of an easy way to remove the freetype. It is only used for the CCLabelTTF. If you look at the recent logs you will have a hint on what other files are involved. Maybe Giovanni can shed some light or Alex Builder since he originally integrated it into cocos2d-x.

Regards,

Francis

Hi Diego,

It looks like the ARM CC compiler for MACOSX doesn’t support inline assembler.
As temporary workaround can you try to add FT_CONFIG_OPTION_NO_ASSEMBLER to the cocos2dx/proj.marmalade/cocos2dx.mkf ?

That is:

defines
{
MARMALADE = 1
CC_UNDER_MARMALADE = 1
FT_CONFIG_OPTION_NO_ASSEMBLER
}

I haven’t a Mac, so I cannot do the try.
Please let me know.

Regards,
G.

Hi Giovanni,

With the following changes it works on Mac:

defines {
MARMALADEUSECHIPMUNK = 1
AIRPLAYUSECHIPMUNK = 1
MARMALADE = 1
CC_UNDER_MARMALADE = 1
FT_CONFIG_OPTION_NO_ASSEMBLER
DARWIN_NO_CARBON
}

I noticed that the chipmunk mkf files refers to .cpp files, while in fact they are .c, I think we should revert that change in the repo.

Thanks,
Diego

Hi Diego,

I am working on getting chipmunk working with Marmalade. The chipmunk code will not compile under Marmalade as .C files but works fine as .CPP files. I think there are C++ extensions being used within the .C files for Chipmunk, the original author admits on his website that he doesn’t check the builds with Visual Studio. Maybe it works with the MAC?

Anyway, still looking for a solution that works for everyone. The chipmunk.mkf file probably should not be updated yet until a resolution is found. I am trying to find time to look at this but the holidays are taking up a lot of my time.

Regards,

Francis

Hi Francis,

My marmalade build works fine with chipmunk c files + cpp files combined. I’m not sure why it doesn’t work for you.

Hi Diego,

I think it works for you because you are using a MAC. I am using a PC with Visual Studio.

The problem is with the compiler. I’m not sure what compiler options I can set with the Marmalade build system. The .C file would not compile with the ARM compiler either, only the .CPP files would build with the PC version of Marmalade. I have seen compiler options that allow you to comple a .c file as C++ but I have not found that with Visual Studio yet.

There is a marmalade chipmunk here: https://github.com/marmalade/chipmunk and it looks like they renamed the files from .c to .cpp to get it to work.

Francis

Hi guys,

Cheers for all the updates although I still get the LibXml error when building for x86, any ideas? It gets past the freetype and libjpeg stuff now though.

When building for ARM I get an unsupported compiler marmalade GCC error as well if anyone has any ideas? I have the latest Marmalade installed and Xcode 4.2.1

Cheers
Dave

Hi Dave,

thanks for your post about mac issue with libXml2.
We are currently working on it.
I will let you know here about progress.

Regards,
G.

Hi Dave,

it should compile on the Mac now.
Please can you try to get the latest version from github?

Let me know, thanks
G.

Hi Giovanni,

I’ve set my project up with the latest cocos2d-x and as long as I make the same changes to cocos2dx.mkf as listed above it compiles fine so cheers for that :slight_smile: Had my project ported over to c++ months ago but just couldnt get it working with Marmalade.

Have you ever had an issue load when running a debug x86 project through s3e_simulator_debug that causes it to break out in CCDirector::setAlphaBlending(bool bOn)? It happens on start up of my app for some reason :S

Dave

No, I didn’t. Did you try to run your app on ARM simulator or on the device?
If you’re using Mac version of Marmalade, I strongly suggest you to swicth to the Windows version.
Marmalade Mac x86 simulator has many limitations, e.g. it doesn’t support FBO extension and accelerometer.

Regards,
G.

Hmm strange, that was just building and running straight from x-code as a debug-x86 build. It wont compile for arm as it says its using an unsupported marmalade compiler.

Cheers for the heads up about the switch to windows, although for the app I’m using it for at the minute it should be fine and I have an Android device available should I want to test it on a device. At least I’m a step closer now, I just need to workout why its crashing out in the AppDelegate.

Dave

Just to update you, it all now compiles and runs my end I just need to solve the Unsupported Marmalade compiler issue for ARM and workout how you get it from xcode to a device to test it and then its good to go.

Cheers for the help and updates guys.

Dave

Unfortunately I cannot check it, mainly because I’ve not a Mac!
But perhaps want you check the thread at http://www.madewithmarmalade.com/devnet/forum/6238 ?

Hope it helps.
G.

Cheers Giovanni, in the end it took a full uninstall and reinstall of both x-code and marmalade but it now is supported although it seems as ever its only a small step forward.

For some reason Main.cpp is now reporting that it cant include “AppDelegate.h” as there is no such file or directory but it is imported into the projects main directory as you would expect and builds fine as an x86 release :s

Regards
Dave

car part