static-libraries

Xcode vs. static library vs. armv6

I have a home-rolled static library to which I link my iPhone app. Works great in Debug mode for Simulator, armv7 (iPhone 4), and even in my unit test app in OS X (GHUnit). However, when I try to run debug my app on my iPhone 3G with iOS 3.0, no dice. The app dies in runtime when it tries to access my library classes. Both the app & lib...

Windows static library

Hi, I created a static library, I have the .lib and headers. My friend try to use this library, but when he include this headers, his compiler didn't find the dependencies(other libs and header). Is it possible to create a static library in Visual Studio 2008, which don't need any other dependencies, just the compiler add the required d...

difference between static and dynamic libraray in xcode for iphone

what is the difference between static and dynamic library in xcode?? and why apple dont allow us to make dynamic lib??? ...

Duplicate symbol between two libraries

Hello, I have the following problem: I'm linking against the Admob library which contains some part of the GData API. But I also want to link with the GData static library to use it directly in my own application. Of course, I get duplicate symbols at link time. How can I avoid that? ...

Translate makefile to produce static libxxx.a instead of dynamic libxxx.dylib

I am compiling a library (http://www.antisphere.com/Wiki/tools:anttweakbar) but issuing "make" with its included makefile on my mac produces a dynamic library (.dylib). I would much rather have a static library so that I can deploy it with my app. Is it easy/possible to translate the flags in the makefile to produce a static library? It...

Exporting member function of a static library

Is it possible (or relevant at all) to export member functions of a static library? When I "dumpbin /EXPORTS" my .lib file I don't see any of my defined class members. Linking to this lib file succeeds, but I use an external tool that fails to read non-exported symbols. Also tried adding a .def file with no results. ...

C++ visual studio libraries

Hello! Is there any way to make static libraries built in Microsoft Visual Studio independent from used CRT (with debug support / without it)? I mean like, for simple C library it is possible to generate code using gcc and then use the same static library in visual studio. The resulting library.a file is completely independent from /MT...

Xcode 3.2.3 and up - static libs with targets for multiple platforms

Hi. I have a static lib project with targets for iPhone and for os x. With Xcode 3.2.2 and earlier versions all worked just fine, but in 3.2.3 apple seems to have introduced changes in how to handle target settings. In 3.2.2 I just could choose "base-sdk" from drop-down menu and set up a target for each, iPhone simulator, iPhone device a...

How to merge two "ar" static libraries into one

Hi I have 2 static linux libraries, created by ar cr, libabc.a and libxyz.a. I want to merge them into one static library libaz.a. How can I do this. I want to create a merged static library, not to give both libraries to final link of applications ...

Hardware FPU error from ld when linking with .a archive

I have a strange problem that I can't seem to solve. I'm developing in C/assembly on an embedded ARM board with no FPU, and using GCC's soft floats. Everything is compiled with -msoft-float as a CFLAG I'm trying to make an .a library in one directory and link with my kernel. When I do so, I get an error from ld: ERROR: lib/libfoo.a(s...

Differences between a shared object and an ordinary library in Linux

What are the main differences between binding to a shared object or to an ordinary object? Also how is this possible to share some variables between some programs and knowing that our variables are never changed by another program? ...

Linker Error in Objective-C static library with unit testing

In my Cocoa Touch static library project, I have a target set apart for unit testing with OCUnit. When I build the project, I have several unit tests that are supposed to automatically run, but when I actually build the project, I get this linker errors: "_OBJC_CLASS_$_ObjectIntTreeMap_ObjectEntry", referenced from: objc-class-ref-to-Ob...

Segmentation fault when call an static library function from OpenGL

I have simple OpenGL C program (from NeHe lesson 2). There is initialization function InitGL. And i have function foo in my static library: void foo(double *p) { p[0] = 1.0; } When i define array of double at start of InitGL: double arr[1000]; and modify it in InitGL all works fine. When i allocate memory for this array dynam...

What is the Visual studio equivalent to GNU ld option --whole-archive

When linking a static library against an executable, unreferenced symbols are normally discarded. In my case some otherwise unused objects are used to register their respective classes into a factory and if the object are discarded, this registration fails. Under Unix where we use gcc, I can pass the flag --whole-archive to the linker l...

Debug symbols not found for static lib in Visual C++ 2008

Hello, I'm trying to debug a static library using MFC in Visual Studio 2008. When running the project in debug mode the breakpoints turn into circles and hovering over them produces the message "The breakpoint will not currently be hit. No symbols have been loaded for this document" The project configuration is set to "Debug", and...

SConscript StaticLibrary atribute error.

Hi, I couldn't find any information on the net, so I kindly ask you for one. I have my build environment set up properly, My compiler is 'cl' from VS express package. I try to build static library, when i set my tools to 'default' everything works, but when i set it to 'msvc' i have following error: scons: Reading SConscript files ......

Static lib loading related problem - please help

Hi all, Suppose I want to version the libs in binaries made. For static libs, I thought this approach would work but it does not: LibInfo.h - Base class for all libinfo classes. Registers an object in gvLibInfo vector when a child is constructed. #ifndef IFACE_H #define IFACE_H #include <vector> class LibInfo; extern std::ve...

Variable dissapears in binary which is available in static lib

Hi, I have the problem mentioned. I create an object inside a static lib, it is there when I run nm on the static lib, but when i link the lib to a binary and run nm it has disappeared. I know this problem has been asked before, but I could not find any answers. It is important for me to be able to retain that variable in the binary ...

How do I fix symbol name collision between static libs in Visual Studio/C++?

My platform is Windows / Visual Studio / C++ I have two static .lib files. They are from two different vendors. Unfortunately the lib symbols are colliding on a globally defined symbol that each file defines. They both choose the same name for something. eek! Is there a way to namespace or "hide" the symbols from the two libraries fr...

Using Objective-C++ static library in straight Objective-C target

I build a static library that uses Objective-C++. When it is used in a straight Objective-C target, I get Undefined symbols: "___gxx_personality_v0", referenced from: I can solve this by adding -lstdc++ to the target's "Other Linker Flags". Question: Is there a way to specify this in the static library itself to make this step unne...