static-libraries

Library code memory footprint analysis.

Let's say we have a some library compiled into .a file. After that this library is linked with other code into some executable file .exe. Size of .a file is 6Mb while this size of .exe file is 3Mb. Obvious explanation of this is that linker has thrower out unused code from the library. What I want to know is the real library's code footp...

how to create static library with protect to access .m file

i have start create my static library and then add .h and .m file to my project, then set role of .h file as public after that build and copy mylibraryfile and .h file from build folder to another project then i click on .h file and Go To Counterpart Button still able to access to my .m file? how can i fix it? or i do somethings wro...

Release mode static library much larger than debug mode version

Hi everyone, today i found out that the compiled static library i'm working on is much larger in Release mode than in Debug. I found it very surprising, since most of the time the exact opposite happens (as far as i can tell). The size in debug mode is slightly over 3 MB (its a fairly large project), but in release it goes up to 6,5 MB...

extern variables in static library, using Objective-C

Hello, I've built a static library, to be linked in my iPhone apps. This library uses some global variables and functions, like in C. My problem is, when using for example: extern void do_stuff (const int a) { return a*a; } extern const int a_variable; extern const int an_array[DEFINED_VALUE]; When I use this function, or access...

Qt - Get rid from .dll file missing errors.

I have created a GUI which requires .dll files in order to work. Here the list of those: mingwm10.dll libgcc_s_dw2-1.dll QtCore4.dll QtGui4.dll I have read that I should write CONFIG += static in .pro file. But it does not work. Could you help? ...

How to add to Interface builder classes in a static library, permanently?

Hi, all. I know the thread on http://stackoverflow.com/questions/1058766/interface-builder-cant-see-classes-in-a-static-library there add to InterfaceBuilder(IB) classes in static library, temporary. The way is drag & drop the header files(.h). It's working in one time booting the IB I wanna permanently add to IB the classes. How to d...

Is there a way to make a function global to the library and to those who include/link the library?

Hey all, I'm a bit confused now. I thought that when you used extern on a function, it would become global to everything, but it doesn't seem so... What I want right now, is to have some set of functions that I can use in my static library and in the program that links it. How do I that? I'm using Objective-C ...

Link libpq.a(Postgres lib) with Xcode project, dependency errors

Hi! I am trying to link libpq.a to a c++ library being build on Xcode, to use Postgres functions's so I can connect and retrieve data. My problem is that when I build the project, it complains about references from the libpq.a, like in the image below: few minutes ago, it was much more errors... it was complaning about openssl lib ...

How to build a static library for both iPhone OS 3 and OS 4?

I created a .a lib file and it was built under iPhone OS 3.0 (in XCode 3.2.2). Now I found that it doesn't work on OS 4. I was using the lipo command to build the .a file for both simulator version and device version: lipo -create libdevice.a libsimulator.a -output libcombined.a Now I created another .a file under iPhone OS 4.0 (in XC...

iPhone static library linking problem

Hello, I having trouble with app that uses my static libs. Here is my setup: I have 3 libs, Utilities, Share and Misc. Share and Misc depend on Utilities. They are compiling just fine when I compile them separately. Every lib is in its own XCode project. I want to build an app that uses features from Utilities and Share, so I added the...

Is there a way to preserve debug information for a static library that is purely an aggregate of other static libraries?

I have a project that builds a static library that is purely an aggregate of other static libraries. This is achieved by adding the input libraries to the project as files. However, even if debug information is available for the input libraries, there is none available for the output aggregate library. If debug information is required fo...

Problem with linking against a static library which has inline functions

Hi all, i have a static library which (among other things) implements a tiny function that only returns some string from a table of const strings. This function is not called anywhere inside the library, but still it's declared as inline. For clarity, it looks like this: namespace flow { inline const char* GetName( BYTE methodType ...

Static library dependency compiles in simulator on Xcode 3.2.3, fails on device

Upgrading to XCode 3.2.3 and iPhone 3.2/4.0 SDK has introduced a strange bug into my build process. I have a static library, Compton, which itself depends on three20. I build Compton as a dependency of the client apps that it powers. When I compile Compton as its own project in either simulator or device mode, 3.2 or 4.0 SDK, everythi...

Getting undefined references when linking against a static library

I made a static library with GCC. Building of the library was OK. When I use it the linker throws undefined reference errors on some functions. But nm says the functions are defined and exported in the static library (marked with T). I know about the linking order that I need to put the libraries after that module that needs them so thi...

Static libraries & build configurations in Xcode

I've included a static library into my project (by using Xcode project references) and I've got a question about building with it. The included Xcode project has 2 build configurations, debug and release, whereas my project has 3, debug, release and distribution. When building with debug, my project is built with it's debug config, and...

What is inside .lib file of Static library, Statically linked dynamic library and dynamically linked dynamic library?

What is inside .lib file of Static library, Statically linked dynamic library and dynamically linked dynamic library? How think there is no need for a .lib file in dynamically linked dynamic library and also that in static linking, the .lib file is nothing but a .obj file with all the methods. Is it correct? ...

Embedding linker dependencies in an object file?

Let's say I have a source file, say helper.c, which gets compiled into an object library (helper.a). Now, this uses functionality from many system libraries, so currently when I want to link helper.a into an executable, I end up having to list all the dependencies: gcc main.c helper.a -o my_app -lrt -lpthreads ... What's the common ap...

How do you create, compile and use static and dynamic libraries in linux-like systems?

Hello, this is my main question: How do you create, compile and use static and dynamic libraries in linux-like systems? What is the difference between them? Are there any good free tutorials explaining this stuff for a total idiota like me. I've only done c# programming before. I know a little C, C++ and Objective-C. I'm developing fo...

How to implement a "function" to be performed on an array in C#

Coming from a non-OO background in Matlab, I'm looking to perform some of the operations I am used to in a best-practice manner for C#. I have a class, which imports data from a source, and formats it into, amongst other things, an array of ints. I am going to want to perform some operations on this array. To keep it simple, lets say ...

How to resolve unrecognized selector sent to class?

My Question is similar to This SO question, but with the main difference being that I'm using class methods. Some code: OpenFeint+private.h @interface OpenFeint (Private) // ... + (void) createSharedInstance; OpenFeint+private.mm + (void) createSharedInstance { //... } OpenFeint.mm + (void) initializeWithProductKey:(NSString*...