N
N
Nikita Kuznetsov2011-10-31 15:37:36
Objective-C
Nikita Kuznetsov, 2011-10-31 15:37:36

How to connect a library for assembly in Xcode?

There is XCode.
And suppose two projects - the ABC application and the libABC library.
How to force XCode to link ABC with libABC?

Answer the question

In order to leave comments, you need to log in

8 answer(s)
A
arturphoenix, 2011-11-01
@deus

In order to work properly with an external library, XCode needs the library file itself (the one that is .a) and the header file (.h) with the signatures of the functions you are going to call.
Add both files to the project, add the library file to Build Phases - Link binary with libraries, import the .h file where you call the functions from this library (#import "xxxxxx.h")

N
Nikita Kuznetsov, 2011-10-31
@deus

and it would be nice to chat with someone in Jabber/GTalk about the basics of working with XCode

C
CLR, 2011-10-31
@CLR

Help -> Search: "Linking to a Library". Select the Tools Guides section.

N
Nikita Kuznetsov, 2011-10-31
@deus

there is not the library that I created in XCode (without installing)

N
Nikita Kuznetsov, 2011-11-01
@deus

recreated project abc - cl.ly/BRgs
main.cpp
#include void abc();
int main (int argc, const char * argv[])
{
abc();
// insert code here...
std::cout << "Hello, World!\n";
return 0;
}
libabc.c
#include <stdio.h>
#include <string.h>
void abc() {
printf("pizdec\n");
}

при сборке ошибка cl.ly/BRjr

N
Nikita Kuznetsov, 2011-11-01
@deus

if you just attach libabc.a, then there will be no error about an unknown type, but undefined symbols will remain

N
Nikita Kuznetsov, 2011-11-01
@deus

so? no answers?

N
Nikita Kuznetsov, 2011-11-01
@deus

Those. won't it automatically build the project-library when building a project that depends on it?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question