tags:

views:

872

answers:

3

I have two projects, a Cocoa application and a static c library which it uses.

Then didn't in the same folder.For example:the name of c static library is libXXX.a,it in the XXXcore folder.the cocoa application in another folder that is the same level with the XXXcore folder. When I try to compile the cocoa application,I have the link error result.It is seem to change the search path in the cocoa app info(General panel).But it is not work,why?

+4  A: 

If you're using Xcode, you can add a link to static library by adding the library to Frameworks folder in the project.

Mehrdad Afshari
A: 

still many link erro result.but When I add the folder path of c head file to the Header search paths of the cocoa app'Info panel, I have few error results. about that are "not found the function declared in the c header file" ,why ?

jin
This should be a comment, not an answer.
Mehrdad Afshari
He only has 11 karma. Comments require 50.
Peter Hosey
I think you can comment on your own questions even without the required reputation. Not sure though
Mehrdad Afshari
+3  A: 

ok. I have the answer:

  1. add the .a library to your cocoa project
  2. edit the path of Header Search paths and Library Search paths in the project info panel(build panel)
  3. don't forget the copy option while adding the library to your project.

Thanks Mehrdad Afshari for your help!

jin