0

Pardon me if this is a "noob" question, I'm overextending myself a bit with this.

I'm trying to compile a library written in C for use in an iPhone app I'm developing. I can't seem to figure out how to do this, and I've been searching and trying things for hours.

I've tried using an External Build System project, and selecting the folder where the makefile.in.am.mingw are.

I've tried creating a Static Library project and adding the header\source files to the project. Which looked good until I tried to compile and got 260k+ errors.

When I 'cd' to the directory with the makefiles and type 'make' I get:

No targets specified and no makefile found. Stop.

I have no idea how makefiles work, I just want to use the library!

Is there a simple way to do this? If someone could at least point me in the right direction, I would be quite appreciative.

0

1 Answer 1

1

The makefiles you have are for GNU automake (under MINGW by the look of it). Even if you get them working (automake can be tricky, but it is included in Mac OS X's development thankfully), it probably won't help you much in building an iPhone library.

I did this with an existing C library by creating a new framework target in Xcode with the right include settings, etc gleaned from looking at the makefiles. That created a .framework bundle with headers and an iPhone .a library ready to be used by an iPhone project. You could also just import the C source into the iPhone project, and have it compiled in that way which would probably be quicker.

Sign up to request clarification or add additional context in comments.

8 Comments

Could you elaborate on this? I tried just importing the C source into the iPhone project. I got like 260k errors. A .a library would be all I need.
If you can try to summarise the sort of errors you're seeing, I can try to be more specific. That many errors sounds like it's probably due to you needing to add header file include paths for project you're importing (see "User Header Search Paths" in the project's Xcode Info dialog).
The bulk of the errors are : Expected '=',',',';','asm'or'attribute' before 'staticlibrary_value_get_x' OR Expected declaration specifiers or '...' before 'x' OR Declared as function returning function. Stuff of the sort. I tried setting the User Header Search Paths to the directory where the library source is, and making it recursive. No change.
@Mike A: It sounds like it could be trying to interpret the source in the wrong language or wrong dialect.
Yes, those errors sound like the compiler is failing to parse at a pretty fundamental level. Mike A, I think you're either going to need to let us know what the library is, or post some source from it if you want to get any further here.
|

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.