0

After reading this awesome post by Tristan, where he compiled FreeTDS for use in iOS, I attempted to compile UnixODBC for use in iOS. I was able to get it to compile, which is great.

However, when I compiled FreeTDS, I had a .a file that I was able to easily bring into XCode (along with a few .h files). This time, the compiler didn't produce a .a file. Instead, it produced a .la and a .dylib file. So far, I have not been able to use these files in my iOS project.

If I could accomplish any of the following, I think my problems would be solved:
    1. Re-compile UnixODBC so that it produces a .a file, or
    2. Convert either the .la or .dylib to a .a file, or
    3. Import either the .la or .dylib to my project, so I can use it in the same way I would use a .a file.

So far, I am clueless as to how I would do any of these things (or if it's even possible). Can anybody please help me out?

Thank you!

-Rob

Community
  • 1
  • 1
Rob
  • 1,025
  • 2
  • 10
  • 27

1 Answers1

1

.dylib files are dynamically linked libraries, whereas .a files are statically linked ones (just google these two expressions). .la files are irrelevant now, they're not essential, and they don't contain any code,

If the configure script of UnixODBC supports it, you can specify the --enable-static --disable-shared options to enable building an .a archive and not a dylib. If the configure script doesn't accept these flags, then you can just go ahead a compile the source files (it will be done by configure), then instead of taking the resulting dylib, use the ar command to put the .o object files together to form a static archive.

  • Thank you! This sounds like it will fix my issue. I'll try this out and report back if it worked. – Rob Feb 06 '13 at 23:14