static-libraries

How can I specify that library X must be linked statically ?

I have a piece of software which is linked against several libraries. They all exists in a dynamic (.so) and a static (.a) version. By default, when using g++ it chooses the dynamic version of the libraries and that's fine with me. However, one of them absolutely needs to be linked statically. I thought about using -static but then it ...

What does a GCC compiled static library contain?

My application links against libsamplerate.a. I am doing this to make distributing the final binary easier. I am worried that perhaps the code inside the .a file depends on some other libraries I also will need to distribute. But if it doesn't I am worried I am bloating up my application too much by including multiple copies of eg. lib...

Creating static library for iPhone

There's an open source library that I would like to use for my iPhone app. The library is written in C and compiles with Makefiles. I would like to use a static library. If I add the .a file to my project dependencies, it works well with the simulator, but it doesn't link when targeting the iPhone SDK (certainly because the .a file is...

static linking on AIX with pthread

I've been reading and researching this for a couple of days now, and decided I need some outside assistance! (and this site seemed like a nice place, so I thought I'd post my question here and see how it goes) our little company hasn't built our applications on AIX for several years, and I've been assigned this task (good thing I like ...

Mixing Static Libraries of C Code built from different versions of Visual Studio 2002 and later

I have a static linkable library of C and Fortran routines compiled and linked together using the Visual Studio 2002 C (v7.0) Compiler and the Intel Fortran 9.0.018 Compiler. The C code in my library calls and links to the Microsoft C-RunTime (MSCRT) 2002 static libraries (single-threaded). I believe the actual version number of the 200...

g++: In what order should static and dynamic libraries be linked?

Let's say we got a main executable called "my_app" and it uses several other libraries: 3 libraries are linked statically, and other 3 are linked dynamically. In which order should they be linked against "my_app"? But in which order should these be linked? Let's say we got libSA (as in Static A) which depends on libSB, and libSC which ...

VC++ resources in a static library

Is it possible to build resources into a static library and reuse them by simply linking with the library? I'm primarily thinking about the case where you call a function in the library which in turn accesses resources. ...

Proper way to link against libraries from libraries for the iPhone/CocoaTouch

I'm writing a static library for the iPhone and I'm wondering if what I'm doing is recommended or if I should take a different approach. The static library I'm writing is dependant on libxml2. libxml2 has a dynamic library (dylib) and a static library (a). I've tried two approaches. Approach one - When I attempt to link against the s...

Convert a Static Library to a Shared Library

I have a third-party library which consists mainly of a large number of static (.a) library files. I can compile this into a single .a library file, but I really need it to be a single .so shared library file. Is there any way to convert a static .a file into a shared .so file? Or more generally is there a good way to combine a huge n...

How can I force MSVC++ to ignore CRT dependencies of a static library?

I don't know if it's possible to do this, but I would like the /NODEFAULTLIB to be applied to a static library project. I have many application projects (A.exe, B.dll, C.dll) that use a common static library D.lib. This library has a lot of code and also has other .lib dependencies as well. One of them is the openssl library, which seem...

Can you reference Xib files from static libraries on the iPhone?

In my app, i currently have all my code separated into a static library, to make it easier to set up the xcode project targets for the actual app and for unit tests for my code. The problem with this is that i want to put most of my xib files in the static library as well, but it seems that when i run my app and try to reference the xib...

Can I use a Visual Studio 6 compiled C++ static library in Visual Studio 2008?

Is it possible to use a C++ static library (.lib) compiled using Visual Studio 6 in Visual Studio 2008? ...

Adding a static library to an iPhone project

Hi guys, The motivation for this question is me trying to get LDAP functions to work with an iPhone application which is a project I'm attempting for part of my dissertation. When I was developing the application I used the ldap.framework framework that is part of Mac OS X. This works fine in the simulator, but when I try to now get t...

Why C# is not dynamic language?

I heard on some podcast that C# is not dynamic language, but Ruby is. I searched online to understand why, but no success. So here is my question; what is “Dynamic Language”? Is this means there’s a static language? Why C# is a dynamic language and what other languages are dynamic? If C# is not dynamic, so why Microsoft is pushing is ...

ld linker question: the --whole-archive option

The only real use of the --whole-archive linker option that I have seen is in creating shared libraries from static ones. Recently I came across Makefile(s) which always use this option when linking with in house static libraries. This of course causes the executables to unnecessarily pull in unreferenced object code. My reaction to this...

Compile linux kernel (2.6) module including non kernel headers

Is it possible to compile a linux kernel(2.6) module that includes functionality defined by non-kernel includes? For example: kernelmodule.h #include <linux/init.h> #include <linux/module.h> #include <linux/kernel.h> // printk() // ... #include <openssl/sha.h> // ... Makefile obj-m := kernelmodule.o all: $(MAKE) -C /lib/mo...

How to convert an ActiveX (webbrower hosted) project into static library project?

I have an ActiveX component which contains a control (webbrowser control embedded in composite control dialog pane) for accessing certain URL. The ActiveX component accessing URL can be used in other MFC or VB projects. The usage is to register the ActiveX component (use regsvr32 cmd) and then insert the control in a dialog window by usi...

How to static link on OS X

I'm trying to link to a static library on OS X. I used the -static flag in the gcc command but I an error message: ld_classic: can't locate file for: -lcrt0.o collect2: ld returned 1 exit status I looked in the man pages and it reads something like: This option will not work on Mac OS X unless all libraries (including libgcc.a) ...

error LNK2019: unresolved external symbol Visual C++

I've got this MFC application i'm working on that needs to have an embedded database. so, i went on hunting for a slick,fast "embeddable" db 4 it and stumbled accross SQLite. now, i've created a DB with it, and i created a static library project with VS2k8.the library project will be used in another main project . in the library projec...

Static linking with Sunstudio

I'm trying to link my library xxx to a library yyy. I want to link statically so that I don't need to package yyy along with xxx when I deliver xxx. I have two versions of yyy provided by a third-party: libyyy.so and libyyyln.a. So here I go and link with -lyyyln. I do not get any error message when I link. The dependency on yyyln does ...