Got latest mercurial update, having some problems compiling

I decided to update to the latest now I’m having some trouble compiling. I have workarounds for this issues but would be better to solve them correctly.

In iOS I’m getting a linker error:
Undefined symbols for architecture armv7:
OBJC_CLASS$_CMMotionManager”, referenced from:
objc-class-ref in libPoke Engine.a(SDL_sysjoystick.o)

I’m using Xcode 5.0
Is some library reference missing?

In Android I’m getting:
jni/SDL_image/IMG_tga.c: In function ‘IMG_LoadTGA_RW’:
jni/SDL_image/IMG_tga.c:326:5: error: format not a string literal and no format arguments [-Werror=format-security]

This is the faulting line:
IMG_SetError(error);

Changing “error” to a fixed string solves the issue. “error” is a const char * don’t know why this doesn’t compile.

I’m using the NDK-9rd.

You need to link your app with the CoreMotion framework.On Aug 6, 2014, at 9:07 PM, Limanima <jorge.raposo.lima at gmail.com> wrote:

In iOS I’m getting a linker error:
Undefined symbols for architecture armv7:
OBJC_CLASS$_CMMotionManager”, referenced from:
objc-class-ref in libPoke Engine.a(SDL_sysjoystick.o)

I’m using Xcode 5.0
Is some library reference missing?


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org

Alex Szpakowski wrote:

You need to link your app with the CoreMotion framework.

In iOS I’m getting a linker error:
Undefined symbols for architecture armv7:
OBJC_CLASS$_CMMotionManager”, referenced from:
objc-class-ref in libPoke Engine.a(SDL_sysjoystick.o)

I’m using Xcode 5.0
Is some library reference missing?


SDL mailing list
SDL at lists.libsdl.org (SDL at lists.libsdl.org)
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org (http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org)

Why it’s not already included in the project? Needs a fix in the project maybe?> On Aug 6, 2014, at 9:07 PM, Limanima <@Limanima (@Limanima)> wrote:

Which project? The SDL Xcode project for iOS doesn?t explicitly link with any system frameworks, because it produces a static library. The template Xcode project does link with all the necessary frameworks (as of a recent commit, soon after the CoreMotion dependency was added to the library.)On Aug 7, 2014, at 3:39 AM, Limanima <jorge.raposo.lima at gmail.com> wrote:

Why it’s not already included in the project? Needs a fix in the project maybe?


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org

This is the faulting line:
IMG_SetError(error);

Changing “error” to a fixed string solves the issue. “error” is a const
char * don’t know why this doesn’t compile.

It’s because it’s a security hole:

If “error” contains the string “%s”, then you’re almost certainly going
to crash, because it’s going to treat whatever happens to be on the
stack as a string pointer.

What this code should say is:

IMG_SetError("%s", error);

…but this looks like it’s already fixed in Mercurial…

–ryan.

Alex Szpakowski wrote:

Which project? The SDL Xcode project for iOS doesn?t explicitly link with any system frameworks, because it produces a static library. The template Xcode project does link with all the necessary frameworks (as of a recent commit, soon after the CoreMotion dependency was added to the library.)

Understood, and this explains some things. Solved.

Ryan C. Gordon wrote:

It’s because it’s a security hole:

If “error” contains the string “%s”, then you’re almost certainly going
to crash, because it’s going to treat whatever happens to be on the
stack as a string pointer.

What this code should say is:

IMG_SetError("%s", error);

…but this looks like it’s already fixed in Mercurial…

–ryan.

I downloaded the latest source yesterday from mercurial.
I dind’t knew this and this is interesting.
Thanks!> On Aug 7, 2014, at 3:39 AM, Limanima <@Limanima (@Limanima)> wrote: