The SDL forums have moved to discourse.libsdl.org.
This is just a read-only archive of the previous forums, to keep old links working.


SDL Forum Index
SDL
Simple Directmedia Layer Forums
Compiling programs for iOS
ruler501


Joined: 14 Aug 2014
Posts: 26
Location: Dallas, Texas
I got SDL compiled for iOS and the template, I copied the template and all my project files to the same directory, added my source files to the template(fixed all the errors from using fpermissive) and now when I get it to compiling it breaks when it tries to link. Every SDL function I use is listed(I also use SDL_image and SDL_ttf) as being unresolved. I checked and they are all listed as trying to link. I've tried compiling with only certain target architectures and that doesn't seem to help anything. Any ideas on what I've done wrong to get it to fail?

Here is the warning I'm getting from it

ld: warning: ld: warning: ignoring file /Users/devon/Downloads/SDL iOS Application/SDL/lib/libSDL.a, missing required architecture i386 in file /Users/devon/Downloads/SDL iOS Application/SDL/lib/libSDL.a (2 slices)ignoring file /Users/devon/Downloads/SDL iOS Application/SDL/lib/libSDL_image.a, missing required architecture i386 in file /Users/devon/Downloads/SDL iOS Application/SDL/lib/libSDL_image.a (2 slices)

I checked and added the i386 target to each of them and recompiled and it still isn't changed
Compiling programs for iOS
Jeffrey Carpenter
Guest

Hi,

What's the output of running 'file' on the static libraries? This'll confirm what architecture the libraries are compiled for...

Are you trying to build the app for iPhone Simulator or the actual hardware? For iPhone Simulator, you need i386 architecture libs, or for the actual hardware, either armv7 or armv7s. (Also, make sure that the SDK is set correctly -- either iphoneos or iphonesimulator depending).

Cheers,
Jeffrey Carpenter


On 2014/09/ 21, at 11:34, ruler501 wrote:

Quote:
I got SDL compiled for iOS and the template, I copied the template and all my project files to the same directory, added my source files to the template(fixed all the errors from using fpermissive) and now when I get it to compiling it breaks when it tries to link. Every SDL function I use is listed(I also use SDL_image and SDL_ttf) as being unresolved. I checked and they are all listed as trying to link. I've tried compiling with only certain target architectures and that doesn't seem to help anything. Any ideas on what I've done wrong to get it to fail?

Here is the warning I'm getting from it

ld: warning: ld: warning: ignoring file /Users/devon/Downloads/SDL iOS Application/SDL/lib/libSDL.a, missing required architecture i386 in file /Users/devon/Downloads/SDL iOS Application/SDL/lib/libSDL.a (2 slices)ignoring file /Users/devon/Downloads/SDL iOS Application/SDL/lib/libSDL_image.a, missing required architecture i386 in file /Users/devon/Downloads/SDL iOS Application/SDL/lib/libSDL_image.a (2 slices)

I checked and added the i386 target to each of them and recompiled and it still isn't changed
_______________________________________________
SDL mailing list

http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org

_______________________________________________
SDL mailing list

http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org
ruler501


Joined: 14 Aug 2014
Posts: 26
Location: Dallas, Texas
I want to build for the actual hardware, lipo -info on the files gives me arvm7, arm64 and armv7s.

My Architectures in my Xcode project are armv7 arm64 armv7s
The Valid Architectures are the same. I'm not sure why it is trying to build for i386
ruler501


Joined: 14 Aug 2014
Posts: 26
Location: Dallas, Texas
Actually looking closer it is only all 3 for SDL_Image
for SDL_ttf it is x86_64 though I checked and it is supposed to be compiling for armv7 armv7s and arm64
for SDL itself it is all excect armv7s though that is enabled in the project file
Compiling programs for iOS
Jeffrey Carpenter
Guest

Hmm, that is strange, your info appears to me to be correct! Xcode can seem to have a mind of its own ... you are sure you have 'iOS Device' selected as the target? Although it's been an awful while since I've played around with it, forgetting about the build target seems to be what gets me most of the time ...

Cheers,
Jeffrey Carpenter


On 2014/09/ 21, at 12:01, ruler501 wrote:

Quote:
I want to build for the actual hardware, lipo -info on the files gives me arvm7, arm64 and armv7s.

My Architectures in my Xcode project are armv7 arm64 armv7s
The Valid Architectures are the same. I'm not sure why it is trying to build for i386
_______________________________________________
SDL mailing list

http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org

_______________________________________________
SDL mailing list

http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org
Compiling programs for iOS
Jeffrey Carpenter
Guest

How did you build the libraries? I had no luck with the official build script for SDL2 (build-scripts/iosbuild.sh), so I improvised and eventually got things working using my own build script [1]. Perhaps it'll help you figure out your problem!

I never bothered with trying it through Xcode directly, as I was more comfortable with the command line ... nor have I tried the template (I use a CMake build script, but hopefully that's beside the point).

1. https://gist.github.com/i8degrees/74f977f41082c89b33fe

I had

Cheers,
Jeffrey Carpenter


On 2014/09/ 21, at 12:15, ruler501 wrote:

Quote:
Actually looking closer it is only all 3 for SDL_Image
for SDL_ttf it is x86_64 though I checked and it is supposed to be compiling for armv7 armv7s and arm64
for SDL itself it is all excect armv7s though that is enabled in the project file
_______________________________________________
SDL mailing list

http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org

_______________________________________________
SDL mailing list

http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org
ruler501


Joined: 14 Aug 2014
Posts: 26
Location: Dallas, Texas
That seems to have been the problem, and I can't compile my actual app with that setting because I don't have an iOS device to hook up yet. I'll have to see if I can borrow someones iphone to test on.
Compiling programs for iOS
Jeffrey Carpenter
Guest

Ah-ha, yeah that issue confused the living hell out of me my first time through! *grins* You need the actual device plugged in and visible to the OS before it will succeed.

Cheers,
Jeffrey Carpenter


On 2014/09/ 21, at 12:26, ruler501 wrote:

Quote:
That seems to have been the problem, and I can't compile my actual app with that setting because I don't have an iOS device to hook up yet. I'll have to see if I can borrow someones iphone to test on.
_______________________________________________
SDL mailing list

http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org

_______________________________________________
SDL mailing list

http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org