static-linking

How do I bundle images into my static QT applications?

I'm building a tool that has some .bmp icon images in it. When I build the application statically, the images must be placed inside the application's folder to run, which defeats the purpose of having a static application in the first place. Is there a way to get the images to be rolled into the application during the build process? ...

Linux static linking is dead?

In fact, -static gcc flag on Linux doesn't work now. Let me cite from the GNU libc FAQ: 2.22. Even statically linked programs need some shared libraries which is not acceptable for me. What can I do? {AJ} NSS (for details just type `info libc "Name Service Switch"') won't work properly without shared libraries. NSS al...

static linking fftw3 into shared library

I'm working on some pitch correction software for Android, and I am looking to get fftw3 working on Android using the NDK. The pitch correction library (talentedhack, http://code.google.com/p/talentledhack/ incase anyone wants to know) depends on fftw3, so I am trying to compile fftw3 as a static library, then link it into the talented...

Upgrade of BOOST 1.36 to 1.43 causes linker error

At work we have an MFC Extension DLL that built fine with 1.36 but when built with 1.43 causes the following error: error LNK2005: __pRawDllMain already defined in ApObs.obj If I activate BOOST_LIB_DIAGNOSTIC the old build lists: linking to lib file: libboost_thread-vc71-mt-gd-1_35.lib and linking to lib file: libboost_thread-vc7...

Can you static link satellite assemblies?

I don't know enough about satelite assemblies to understand their construction, I'm curious if it's possible to statically link them all into a single dll and get the same functionality as if they weren't statically linked from: ResourceManager.GetString("SomeStringIdentifier", CultureInfo.GetCulture(someCultureThatYouHaveResourcesFor))...

question about link and include of different vers of a lib

Hi, Is it a problem if I have an executable and a library use different versions of another library. Example: If I have an executable: A.exe, and it basically wraps and depends on a static library A.lib Both A.exe and A.lib need another library B.lib If I have a situation like this: The A.lib library includes B.lib version ...

Mixing Static and dynamic libraries

I am working with three different libraries, a Core (can be compiled as static or DLL), Graphics (can be compiled as static or DLL - Dealing with Ogre), Physics (can be compiled as static only due to licensing - Havok). A project then uses a combination of the libraries depending on the needs. The Physics portion is dependent on some fun...

IMPLEMENT_DYNCREATE, "Use MFC in a Static Library" and inheritance

If I switch my project from using MFC in a shared DLL to use MFC in a static library, the following code won't compile: class Test : public CObject { public: //DECLARE_DYNCREATE(Test); // If I uncomment this line, it works }; class Test2 : public Test { public: DECLARE_DYNCREATE(Test2); }; IMPLEMENT_DYNCREATE(Test2, Test); // ...

VS2005: Importing a dependency into a static library without exporting its symbols?

I am trying to build a static library (foo) that uses functionality from another library (bar). Example: void foo::f1() { bar::b1(); } Unfortunately, when using foo in some of our projects (requiring us to link with bar as well to support foo), exports from bar are conflicting with other libraries. Is there a way to import bar w...

Linking against boost barfs with 'undefined reference to `boost::system::get_system_category()'

Hi, I'm having trouble statically linking an app which uses the boost 1.35 libraries. I'm using a linux debian Lenny box, with G++ 4.3.2. Linking without -static works without a hitch. Specifically, g++ -Wall -Wextra -pedantic -ggdb3 -O0 -static -l boost_thread-mt -lboost_system-mt -lboost_program_options-mt -lssl -lpthread -l crypt...

CMake: how to produce binaries "as static as possible"

I would like to have control over the type of the libraries that get found/linked with my binaries in CMake. The final goal is, to generate binaries "as static as possible" that is to link statically against every library that does have a static version available. This is important as would enable portability of binaries across different...

How to compile a program for distribution on Mac.

I am developing a program on OSX 10.6.4 (Snow Leopard), and I want to be able to run the compiled product on other Intel Macs, some of whom may not have XCode isntalled. To simplify things, I first wrote a Hello World program. #include<stdio.h> int main() { printf("Hello world!\n"); return 0; } If I compile it as gcc -static...

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...

Can text documents and other files get packaged into C executable

My C application relies on some files to copy over. Will the files be contained in the executable and not as stand-alone files? Would it have to be linked statically? I am using Eclipse CDT if it matters. ...

method of converting a static library into a dynamically linked library

If all I have of a library is a *.a static library. Is there a way I can convert that to *.so dynamically linked library? Maybe using ld? I'm using SUSE Linux. ELF platform. ...

What should we consider to use either static linking and dynamic linking?

Possible Duplicates: Static linking vs dynamic linking C++ application - should I use static or dynamic linking for the libraries? What point we should take care before selecting static and dynamic linking? ...

Static library auto-discovery and linking

I have the following problem, which seems not to have a nice solution. For example, I have an CLI utility which uses libtiff and libX11. I want to produce two versions of this utility: dynamically linked and statically linked (with as many dependences compiled-in as possible). For dynamic linking everything works as a charm: one need t...

Is it possible to link libstdc++ statically in Mac OSX 10.6?

I am trying to run my C++ program on other Mac OSX machines which may have an older copy of libstdc++, but have all the other tools. I tried to follow this approach, also mentioned in this SO question, even though it discusses a linux setup. I have small program try.cpp: #include <iostream> int main() { int a = 10; std:...

Can I link MSVCRT statically with mingw?

I have C program I compile with mingw on Windows. It works fine but requires MSVCRT.DLL. I want to link that statically (like I can do in Visual Studio). Is this possible? I tried -static flag to gcc and it didn't make any change. What about C++ program using also standard C++ library? ...

Why does gcc not implicitly supply the -fPIC flag when compiling static libraries on x86_64.

I've had numerous problems compiling shared objects that link statically against static libraries. This problem only shows up on x84_64 platforms. When doing the same compilation work on x86_32 I do not have any problems. Perhaps this is a OS specific GCC configuration thing, but my research indicates that its how GCC works on x86_64 p...