On 9/9/10, Thomas Hogarth <[email protected]> wrote:
> Hi Eric
>
> Sounds interesting, I've never actually tried to create and load a dynamic
> lib for iOS as I thought it wasn't possible. Does doing it require an OS
> upgrade or has it always worked and just wouldn't pass the approval process?
>
There is no actual technical reason you shouldn't be able to
dynamically link. iOS is still Darwin (BSD/Mach-o) under the hood and
I can't imagine it being worth Apple's time to fork and modify Darwin
to cripple it. But in fact, you must dynamically link to Apple's
frameworks so dynamic linking does indeed work. So for iOS itself, I
can't imagine needing a new version of the OS.

The real trick is that the Xcode tool chain doesn't expose anything
for dynamic libraries on iOS. Ironically, a long time ago, I recall
Xcode had bugs and limitations that made building a static library
really hard that affected things I worked on (like the OSG Xcode
project). I had to coerce other templates to do what I wanted.

It might be worth a shot trying this with Xcode now for this. But
since the tool chain is so complicated for IOS, it might be a lot
harder or impossible since Apple also has "validation" stuff. Probably
the better course is to file a bug report with Apple and have them fix
the tool chain so it is easy and obvious to use/build dynamic
libraries for iOS.

> All in all in terms of OSG it's not a bad thing that we have to link
> statically, I'd see the most desirable thing about having dynamic plugins
> would be that we could upgrade/add extra plugins rather then the entire exe,
> But by the sounds the agreement we still couldn't do that as we can't run
> anything downloaded from the net.

Actually, there are two problems with static linking. First there are
technical problems. Objective-C in particular has these weird areas
where if you build and link to static libraries, things might break. I
never understood it, but I think it has to do with the very dynamic
nature of Objective-C and the compiler not fully understanding that
when building static. There are magic flags you need to pass in these
cases, but I read there are still edge cases that don't get handled.

Second, I haven't audited the OSG plugins, but I have heard
suggestions that some of the plugins may contain or require GPL or
LGPL code (no static linking clauses) so if you build those plugins
statically into your app, you may be in violation of the licensing
terms unless you are distributing your source code.

> I might have a quick try at building osg dynamically for iOS this weekend. I
> can imagine the only issue may be finding the plugins, but osgDB has been
> finding all my other files so I reckon it'll just work.

Cool. Let me know how it turns out.

> Tom
> PS
> Like the look of the book Eric, nice one

Thanks!

> PPS
> I'm working on a small IPhone app using OSG that I should be sending for
> approval in a week or two. It's pretty simple app wise, but i'm more
> interested about OSG passing the approval process. I'll keep people
> informed.

Yeah, the approval process is the bigger challenge.


-Eric
-- 
Beginning iPhone Games Development
http://playcontrol.net/iphonegamebook/
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to