Appcelerator Titanium include static library .a in module xcconfig - titanium

I'm trying to include a static library in module.xcconfig. But the documentation isn't helpful, and all the discussion I can find does not give a solution.
Where do I put the static library, and how do I include it using OTHER_LDFLAGS? I've tried:
OTHER_LDFLAGS=$(inherited) mylib.a
OTHER_LDFLAGS=$(inherited) -lmylib
mylib.a is in the root of the module at the same level as module.xcconfig, because someone on the Appcelerator site said to do that.
build.py runs fine for the module, but once I try to build my project, I get:
The following build commands failed:
[ERROR] Ld build/Debug-iphonesimulator/ ... normal i386
[ERROR] (1 failure)
What am I doing wrong? Thanks.

add this line to the module.xcconfig
OTHER_LDFLAGS=$(inherited) -framework GameKit
where GameKit is your missing framework that is used in your library.
And add your library direct to your xCode project via drag-n-drop.

you might need to include the fill path to the library, also it should be included in the build settings of the xcode project

Related

Cannot build module in OS x mavericks - Titanium TermiT ZipFile

I used module at this link :
https://github.com/TermiT/ZipFile
But When we run this file (build.py) fallowing the I take error
The following build commands failed:
CompileC build/ZipFile.build/Release-iphoneos/zipfile.build/Objects-normal/armv7/ZipfileModule.o Classes/ZipfileModule.m normal armv7 objective-c com.apple.compilers.llvm.clang.1_0.compiler
thanks.
I had the same problem, and while searching it turned out that we're missing the GCC compiler, here's a link for what I've found, https://github.com/TermiT/ZipFile/issues/15 , and it also have a link to download the GCC compiler.

linking failed when building my own project using LLVM

I'm learning to build a llvm project, this is the reference: http://llvm.org/docs/Projects.html. I use the "llvm/projects/sample" directory as the primary project skeleton, and it works. Then I want to build tools from "llvm/examples" to my project, such as Fibonacci, it can't work. I do it this way: first copy the "llvm/examples/Fabonacci" directory to "MyProj/tools" ("MyProj" is top level of my project) and change Makefile to contain Fabonacci target, then configure & make. but the Fabonacci tool seems can't be built. It depends on some libs when linking. So what can I do if I want to build the source code from "llvm/projects/example" in my project?
You need to provide LLVM libraries to linker when building your own project. This means adding some flags, library directories and libraries themselves to link command. Build script probably needs some editing.
llvm-config tool can be used for providing necessary options to compiler/linker. Check documentation and examples.

Unit test unresolved symbol when using Objective-C++

I am trying to create unit tests to my project, I have workspace with several projects with tens of static libraries and apps. So, I created a new project for static library in this workspace and added Cocoa Touch UnitTest bundle to it. Then I added a test for one of the functions in one of the libraries in this workspace, lets say library X, I also added link dependency to my unit test bundle to lib X. But when I run unit tests (Cmd + U). I get linker error:
Undefined symbols for architecture i386:"_OSVersion", referencedfrom:-[MyUnitTest testMethodFromLibX] in MyUnitTestTest.o "_methodFromLibX", referenced symbol(s) not found for architecture i386
Why test bundle is not linking with library X? I can see libX.a and MyUnitTests.octet in build folder.
Ok, thanks all, I found cause of the problem - my libX was Objective-C++ library, so linker mangled all names, but my Unit-Tests were Objective-C library, so when it was linking it obviously couldn't find method or class by name, since linkage was different. So, I convert unit-tests into Objective-C++ library(just changed *.m -> *.mm) and everything works!
Unit tests run in the simulator, and so every library need to have a x386 version. You can use the command line to examine each - i believe "file lib.a" does this but a quick google search will turn up the name.

Error linking libxml

I want to use GData API in my project for iOS
I've followed official notes on how to add GData to project
Static library was built successfully, I've added references to it and headers folder
Than I put #import "GData.h into one of my source files and get following error while building project:libxml/tree.h : no such file or directory
In build settings - other linker flags I've specified -lxml2 (both for project and target)
In header search paths - /usr/include/libxml2 (no misspellings, I've checked), both for project and target. "${SDKROOT}/usr/include/libxml2" also didn't help
Still get the same errors
Mac OS 10.6.6, Xcode 4.0 Build 4A304a, iOS SDK 4.3
Try this: Project target-->Build Setting-->Header Search Path, Debug mode, ${BUILT_PRODUCTS_DIR}/Headers

code::blocks, libxml2 / libxml/parser.h: No such file or directory

Hello
I'm trying to write some tool using code::blocks, wxWidgets and libxml2 on Windows platform.
Things I've done:
copied libxml2.a, libxml2.dll.a and
other libs to MinGW lib/ folder
Wrote some headers like this in my
source file:
#include <libxml/xmlmemory.h>
#include <libxml/parser.h>
Added -lxml2 to linker
And now, when I'm trying to build this project I'm getting this error:
error: libxml/xmlmemory.h: No such file or directory
Anyone here experienced this error?
I believe that I misconfigured something but don't really know what.
Thanks for your ideas.
In general, it's better to not move things into the mingw directories, but to leave them in their own directories, and add search paths to the project properties so it knows where to look for them.
If you go into your project properties in Code::Blocks, hit the Project build options button, then inside the Linker Settings tab, add the two libraries you're linking against. Then In the Search directories tab, add the /include to compiler search locations, and optionally, add the /lib directory to Linker locations (This isn't necessary if you gave the full path to the .a in the linker settings.
Ok, I found the solution!
<libxml2/libxml/parser.h>
works perfectly