[physfs] Compiling for iOS (iPhone/iPad/etc)
Josh de Lioncourt
overlord at lioncourt.com
Wed Aug 31 15:04:18 EDT 2011
>
> Actually, for future reference to anyone trying to build for iPhone…
>
> You need only link against the Foundation framework. (I don't think iOS even has IOKit).
>
> Also, depending on your iPhone application, it may not be convenient, possible, or advantageous to pass argv[0] as it is provided to main(). (This may be especially problematic if your app moves to the background, for example, and you need or want to re-initialize PhysFS when it becomes active once again.)
>
> Using the following ObjC code…
>
> [[NSBundle mainBundle] executablePath]
>
> …returns an NSString which provides the same information that is passed by argv[0]. Converting the NSString to char* and passing that instead to initialize PhysFS works quite well. In fact, I will likely adopt this strategy for OS X projects as well.
>
> I hope this info is helpful to someone else out there.
>
> On Aug 30, 2011, at 8:46 PM, Ryan C. Gordon wrote:
>
>>
>>> I've been trying to find an example Xcode project that builds PhysFS
>>> for iOS, but haven't found one. Has anyone here done this successfully?
>>> Do you need to link against any iOS frameworks? (i.e., how the OS X
>>> compilation requires IOKit, Carbon, etc). Is there anything special
>>> that needs to be done to get a working build?
>>
>> I think it shouldn't be different than the Mac OS X builds...link against the IOKit framework.
>>
>> --ryan.
>>
>> _______________________________________________
>> physfs mailing list
>> physfs at icculus.org
>> http://icculus.org/mailman/listinfo/physfs
>
>
>
More information about the physfs
mailing list