Welcome, Guest. Please login or register.

Login with username, password and session length

 
Advanced search

1411490 Posts in 69371 Topics- by 58428 Members - Latest Member: shelton786

April 24, 2024, 11:07:10 PM

Need hosting? Check out Digital Ocean
(more details in this thread)
TIGSource ForumsDeveloperTechnical (Moderator: ThemsAllTook)compiling SDL2_mixer-2.0.1 for iOS using Xcode 7.2
Pages: [1]
Print
Author Topic: compiling SDL2_mixer-2.0.1 for iOS using Xcode 7.2  (Read 892 times)
JohnsyJohnsy
Level 0
**


View Profile
« on: February 05, 2016, 07:23:53 AM »

Hi hello, well as the title says,
I've managed to compile SDL2.04 for iOS using this great video


And hoped the sdl_mixer process would be sort of similar, Imeadiatly  I run into a simple question:

when unzipping the source, there's a Xcode-iOS project, building that I get stuck at :

music_cmd.c:21:10: 'SDL_config.h' file not found`

SDL_config is not a source file found in SDL_mixer, I assume I need to link somehow to SDL2, since my SDL Uninveral lib (.a file) is built successfully I justgo to
Project settings -> Target Static Library -> Build Phases -> Link Binary With Libraries and add the lib there.

Nothing is changed by that though and I am too much of a (Xcode) noob to really think this further through,

I also tried including the SDL2 header files into the project, but I sort of think thats unneeded, otherwise they would surely be in that zip file to begin with, right?

So my question is, can someone point me to a useful tutorial for this issue, or can someone help me with this?

Logged
oahda
Level 10
*****



View Profile
« Reply #1 on: February 05, 2016, 07:36:59 AM »

Click the name of the project at the top of the hierarchy in the left pane (the one that appears by pressing cmd+0), and see your project settings pop up in the primary editor. Go to the build settings tap and scroll down until you find the section labelled search paths. Add the path to the folder where SDL_config.h is either to header search paths or user header search paths (in the latter case you might also have to enable always searching user paths).

It also depends on what the include in music_cmd.c looks like; if it includes <SDL_config.h> directly, do as I said, but if it includes <SDL2/SDL_config.h> or something like that, then you add the path to the folder above the SDL2 folder instead.

If you're going to do this a lot, it might help just to put the SDL files in some standard search path, like /usr/include/ or /usr/local/include/ or whichever one it is that Xcode / the compiler prefers looking in.
Logged

JohnsyJohnsy
Level 0
**


View Profile
« Reply #2 on: February 07, 2016, 10:06:51 AM »

Hi thanks for the help, I managed to fix the issue with those tips, I couldn't really change that header search path because after double clicking to edit it, it turned into some weird macro like $(HEADER_SEARCH_PATHS_QUOTED_FOR_PROJECT_1)
probably thats defined somewhere else where I can change it I guess, what I ended up doing though, in those paths I saw it looked two folder up as defined in the project file included in the zip, so I just placed a foldler there SDL/include and that worked.

What I also did which was wrong was adding my earlier built universal Library of SDL2, thta wasnt necessary, it just needs the header files.
anyway, case closed, thanks Prinsessa!
Logged
oahda
Level 10
*****



View Profile
« Reply #3 on: February 07, 2016, 11:38:53 AM »

You can add your own additional paths in that box by clicking the little plus button and typing into the text field that appears.

But if it works, it works. Hooray! Smiley
Logged

Cheezmeister
Level 3
***



View Profile
« Reply #4 on: February 09, 2016, 07:19:36 PM »

IIRC, SDL_config.h is a config file that you supply with whatever defs you need. If you don't care, you can supply an empty file and move on with your life. I would be careful bringing it in from a random place, it could do something unexpected to your build...or not! I really don't know.

If you run into other problems, you might have an easier time using the premake or cmake build chains from a nice comfy terminal. It'll get you closer to "official" builds, I suspect (again, not positive, but I was surprised to find they even provided an Xcode proj).

Good luck!
Logged

෴Me෴ @chzmstr | www.luchenlabs.com ቒMadeቓ RA | Nextris | Chromathud   ᙍMakingᙌCheezus II (Devlog)
oahda
Level 10
*****



View Profile
« Reply #5 on: February 10, 2016, 04:55:44 AM »

Oh, the Xcode project is fine. I've used it for my OS X as well as iOS versions of SDL2 libraries. It's officially provided.

And it doesn't matter where the files are included from so long as they're the right ones, but of course in a more serious project one might want to make sure they're put in conventional places so that the include statements work on all systems — but for a one-time thing like compiling the library file to use after that, meh, it can be unconventional and dirty.
Logged

Pages: [1]
Print
Jump to:  

Theme orange-lt created by panic