Reputation: 253
I want to install some great third-party libraries on Mac OS X which will be used in Objective-C for some iOS programs :)
Since I am just a beginner of Mac OS X and Objective-C, I am not so sure about the installation process. I just tried to install the libraries by compiling the source codes (simple operations like ./configure -> make -> [make check] -> make install), everything seems OK in Terminal except the "make install" process, the reason is that the make program doesn't have the permission to create the directories like "/usr/local/include" etc.
I know that I can give some params when creating makefiles to indicate another install directories, but since Mac OS is not Linux, I just want to know the appropriate directories to install the libraries; furthermore, I also want to know if these installed libraries will work correctly in Objective-C just as they work in C/C++ even on iPhone/iPad?
Does anyone has some information about the above topic? Please give me some guides.
Upvotes: 2
Views: 4707
Reputation: 75439
The problem is that you need root permission to install in the regular install directories. Try this:
sudo make install
sudo
executes the command as root, which means it can do whatever it needs to. You'll have to enter your password, and it won't echo the letters (or even asterisks) as you type them for security. Generally, it'll install the libraries in the same (or similar) places as on Linux, and work for most command-line work.
You can call any regular C library from Objective-C, and Objective-C++ exists to try to mesh Objective-C with C++, though it'll be more effort. However, I believe that third party shared libraries are not allowed for iOS apps. You could statically link the library into your app if the library can be provided as a static library rather than a dynamic one, but this will increase the size of your app. Also, some libraries won't work for iOS (things like SDL and such). You'll want to look into whether people have used those libraries on iOS devices. You'll also undoubtedly need to use Xcode to write iOS apps.
This may be condescending, but if you don't know how to run a command as root, you may not be ready to write an iPhone app. Perhaps I'm wrong - this kind of detail is usually hidden in many IDEs, and if you already use an IDE you should be able to learn Xcode, and I imagine the iOS interfaces aren't too hard to learn from documentation. It's just worrying to me that you're having trouble with something that should have been explained whenever you learned how to use make
.
Upvotes: 2