How to build my own static lib and link it to iphone game
Hi, everyone,
I am not sure if it is right to post this question here... I am totally new to iMac and iPhone but have years of exp. on PC. I am just wondering if there is a way to create my own static lib and link it to other iphone game, which is my preferred way to develop games on other platforms.
I download iPhone SDK and use Xcode. I created a new iPhone app and added a new target to iphone static lib. After building the project, there is no such a .a file generated. Do I need to set up some preferences or sth?
What if I succeeded, how could I link this to my other iPhone project? I try to google the manual of Xcode, but it doesn't help me much.
Thanks!
-Hao
I am not sure if it is right to post this question here... I am totally new to iMac and iPhone but have years of exp. on PC. I am just wondering if there is a way to create my own static lib and link it to other iphone game, which is my preferred way to develop games on other platforms.
I download iPhone SDK and use Xcode. I created a new iPhone app and added a new target to iphone static lib. After building the project, there is no such a .a file generated. Do I need to set up some preferences or sth?
What if I succeeded, how could I link this to my other iPhone project? I try to google the manual of Xcode, but it doesn't help me much.
Thanks!
-Hao
Hi,
. create a project... lets say "my_project"
. create a new target... lets say "my_lib"
. create a new target... lets say "my_game"
. project -> edit active target -> general -> direct dependencies -> [+] (add my_lib)
. project -> edit active target -> general -> linked libraries -> [+] add (my_lib.a)
riq.
. create a project... lets say "my_project"
. create a new target... lets say "my_lib"
. create a new target... lets say "my_game"
. project -> edit active target -> general -> direct dependencies -> [+] (add my_lib)
. project -> edit active target -> general -> linked libraries -> [+] add (my_lib.a)
riq.
Thanks!
I followed your instructions and I can add "my_lib.a" to linked libraries, but I still don't have this my_lib.a. how can I compile this lib? it seems they share the same soure code?
I followed your instructions and I can add "my_lib.a" to linked libraries, but I still don't have this my_lib.a. how can I compile this lib? it seems they share the same soure code?
I don't know what's happening in your machine. Those steps works Ok for me.
I was thinking of if there is an automatic way to generate compiling resources, but now, I can only add files to my lib target.
So, is there a way, like filter or group, to add source files and headers to my corresponding targets?
thanks
hao
So, is there a way, like filter or group, to add source files and headers to my corresponding targets?
thanks
hao
I figured it out. Different tools have different preferences and I think xcode is more compatible.
here comes another issue. if i compile a lib file, say mylib.a, and add it to another project, say mygame, then what i need to do is to copy .a file to mygame project, is it? and does code signiture of mylib.a matter to run on iphone?
-Hao
here comes another issue. if i compile a lib file, say mylib.a, and add it to another project, say mygame, then what i need to do is to copy .a file to mygame project, is it? and does code signiture of mylib.a matter to run on iphone?
-Hao
zwstudio Wrote:does code signiture of mylib.a matter to run on iphone?
Since it will be linked statically, a code signature would only be applicable to the final built executable.
Thank all you guys! All I questioned is resolved.
Hao
Hao
Possibly Related Threads...
| Thread: | Author | Replies: | Views: | Last Post | |
| Xcode 4 Build Failure on iPhone target | SparkyNZ | 2 | 6,003 |
Apr 7, 2011 02:48 AM Last Post: SparkyNZ |
|
| Static libraries... | the_wandering_monster | 6 | 3,615 |
Dec 31, 2009 03:46 PM Last Post: the_wandering_monster |
|
| How can I build BOX2D as a static lib for the iPhone? | riruilo | 3 | 3,911 |
Oct 8, 2009 06:27 AM Last Post: Skorche |
|
| Static Library | kendric | 9 | 2,934 |
Sep 17, 2009 11:24 AM Last Post: kendric |
|

