objective-c static library intellij appcode - objective-c

New to objective-c. Finally found a tutorial that describes how to create and use a static library in x-code. I'm surprised that building and using libraries is such an arduous process. Is there a more efficient way to create and use static libraries?
I installed JetBrain app-code. But I can't follow the same steps since I can't figure out how to create a workspace in app-code.
Could someone please lists the steps for creating and using a static library in app-code?
Also, how can I change my build path in app-code? I tried to change the path in project properties...there is a text-box but its value keeps reverting back to the default?
I think I'm missing something, because the jet-brain products I've worked with (resharper for C#, and intell-j for Java) are very high quality.
Thanks in advance.

at this moment, AppCode doesn't have full project configuration facilities: you cannot create targets in it. This functionality will be added in the future versions.
Meanwhile, you can use Xcode to setup you project and then switch back to AppCode.
As for the build path reverting to the default, could you please file a bug report in the tracker?

Related

how to compile objective c file in google native client?

I have a npapi plugin(bundle) for chrome, which use C++ and objective-c. now it needs to be build by google native client.
I wonder that can nacl support objective-c? how to compile o-c file by MakeFile
And if possible, how to build nacl plugin in Xcode? I tried, but i found that the libraries of nacl are " archive with no architecture specification".(use lipo -info *.a)
I hope someone to help me, thanks a lot!!!
If you use Objective-C without any of its usual libraries then you should be able to use the PNaCl toolchain (which is based on LLVM) to have it parse Objective-C. I'm not aware of projects that have done this, so you should definitely let folks on the mailing list know if you get something working (do keep the questions on SO, though!).
It sounds like your application won't be running on the open web (where only architecture-independent PNaCl can run, not NaCl), so you could either use the PNaCl toolchain to create a .pexe, or you could use the same toolchain to create a .nexe for each architecture you target. The documentation I linked to helps with both approaches, but note that using the PNaCl toolchain to create a .nexe is currently being improved. You can therefore follow the instructions on the bug tracker, or try out nacl-clang when it's released (or build it yourself if you're brave).

Retrieve Framework List

I'd like to know if it is possible to get a list of the frameworks being used in an Objective-C project.
Perhaps there's some way to access XCode's "Build Phases"? Doesn't matter if it's some obscure method not advised by Apple, I'm trying to make an XCode plugin.
Thanks
I haven't written a Xcode plugin (yet), but is there a way for you to use terminal commands? If this is possible you could open the projects build path and simply use
ls *.framework
They should also be linked in the .xcodeproj file.

Xcode: how to build a static library project correctly?

This question will be easy for Xcode pros but for a MonoTouch developer it seems to be impossible to resolve. :-)
I'm using Xcode 4.5 and I want to target iOS 5.1 and above and iOS Simulator 5.1 and above.
I have a a library project here and it is coming with a prebuilt binary named "DemoLib" (no extension and it is 11MB in size). The library is a fat lib for Simulator and iOS 5.1+.
I can use that library without any problem.
However if I try to build the library myself, I end up with a "DemoLib.a" file (notice the extension and the size of 30MB). How can I get the same build result? What is a .a file compared to the file without extension?
I tried to build the project "for running", and "for archiving" in Xcode. Both results in the same 30MB .a file.
I was expecting some dropdown in Xcode where one could select "DEBUG" or "RELEASE" build and the latter one would create the smaller lib.
Of course I could never tell without seeing the framework's project file. Having said that, there is an excellent guide to creating and compiling iOS frameworks here: https://github.com/jverkoey/iOS-Framework
Using the above guide, you should be able to recreate your framework's project from scratch, add the files you have to it, and properly compile it.
Hope this helps! :)
Did it come with a Makefile? Create a new target, set the build settings of the target to what's in the Makefile, then set your project to depend on that new target.
A file with the .a is a static library, which means it depends on nothing external and all the code it needs is compiled inside it. I think no extension generally implies dynamic library, which means it'll depend on some dependencies being present on your system to link against. Maybe that's why the .a is so much bigger. I think Xcode will build static by default because iOS does not allow the use of dynamic libraries.
The dropdown for what to build is in your scheme. Command+shift+< to view your scheme. Within the scheme you can edit which environment each method of building will use.

importing one Xcode project into another

I am trying to import one of my xcode projects into another, and I was just wondering if there were some best practices for this task, or if anyone has any advice how to make this happen?
Thanks.
Not sure exactly what you mean by import.
If you want to do a framework then you'll want this.
Framework Docs
If you want to do a shared library then you'll want this.
Shared Libs
Just click on .xcodeproj file and it will be automatically opened in whatever version of xcode installed in your system and if the project was created in an older version just click on "Modernise Project" which you can find at the bottom of your xcode and xcode will take care of the rest.

Library search path for libstdc++

I have compiled shared libraries dynamically linked against libstdc++.so using GLIBCXX_3.4.11. I want to send my code to someone whose stdc++ library is only of version 3.4.10. Rather than ask him to update his library version (this is a software customer, so I can't assume they'll be willing or able to change system files) I would like to ship the appropriate version of libstdc++.so, placed in a lib folder with the directory location of my code. How do I get my own code to use the appropriate (later) version? I find that /etc/ld.so.conf includes the directory /lib64, where an offending older version of libstdc++.so resides. Setting LD_LIBRARY_PATH does not override this. This seems to deviate from the advertised behavior. Any idea why this is happening? How do I complete my rather simple task?
Thanks.
I understand that this question is old, but I found it while trying to sort out my own linking trouble which was similar. You will have to build your program against a version of libstdc++ which is compatible with your colleague's version of the library. The easiest solution, of course, is to link against his version of the library so he doesn't need to make special tweaks on his side to link your library.
To do this, you will want to install a version of GCC which can build binary compatible libraries so you can actually link against his version of libstdc++. GLIBCXX_3.4.11 is from gcc-4.4 and later, so you will need gcc-4.3. Build your program using this and you should be in good shape.
You can consult the following page for a list of library ABI compatabilities:
http://gcc.gnu.org/onlinedocs/libstdc++/manual/abi.html
You could also build an rpm/deb which requires the version of libstdc++ you already have and if it's not available, refuse to install. This gives you a bit of an interface which gives him a promise that if his system is setup with the correct dependencies, he can use your library. In that sense, it's like a loose SLA for your library in what you do and don't support.
Hope that helps!