Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [static-linking]

linking that is performed in compile time, as opposed to runtime dynamic linking

1
vote
2answers
149 views

Is it good practice to statically link libstdc++ and/or libgcc when creating distributable binaries for Linux?

Context: I have an open source project which uses JNI. While it's possible to build it yourself, I expect most users will use standard Java tools like Maven, Gradle, or SBT to download the JAR, which ...
-1
votes
1answer
56 views

Creating a “lite” version of shared library on Linux/POSIX in addition to full version

I have a large shared library, a collection of functions created from numerous .a files into libeverything.so. The code for the .a files is obviously compiled with -fPIC. I also have libeverything.a ...
0
votes
2answers
95 views

How should I include libraries that I want to statically link against in my repository?

I know how to actually do the linking, but I'm not sure what the best practice is for actually getting those libraries downloaded and into my repository. Should I just straight-out include them using ...
1
vote
2answers
857 views

How can there be “moral reasons” to avoid static linking?

SDL 2's installation page contains the following comment on static linking: However, we encourage you to not do this for various technical and moral reasons I totally get why they would mention ...
1
vote
0answers
133 views

How to get verification that you've implemented all your API in a static library?

I just learned that static library building skips the linking stage, which explains why my build process succeeds all the time when it's possible I actually haven't implemented a function in my header....
8
votes
1answer
2k views

Does providing object files satisfy LGPL relink clause?

From this question on SO, I read that: Proprietary Source code + LGPL Source code statically linked: Either you must release both parts as LGPL. Or provide everything that allow the user to relink ...
2
votes
2answers
408 views

Why use dynamic linking for less-popular libraries?

I know the difference between static and dynamic linking. I know why the notion of a library is important. And I even know why you'd want to link something like OpenGL, platform-specific APIs, or ...
7
votes
2answers
4k views

What's wrong with statically linking the STL into multiple shared libraries?

Here is the scenario: libA.so and libB.so both statically link to the same STL. libA.so has a public API that returns a std::string. libB.so calls this function and receives a copy of the string. ...
5
votes
3answers
2k views

Why are there two different kinds of linking, i.e. static and dynamic?

I've been bitten for the n-th time now by a library mismatch between a build and deployment environment. The build environment had libruby.so.2.0 and the deployment environment had libruby.a. One ruby ...
11
votes
2answers
6k views

Why does Apple only allow for Static Frameworks on iOS?

Clearly Apple has the ability to create dynamically loaded libraries (known as frameworks) for iOS, as they ship several with XCode (such as UIKit). App developers only have the ability to create ...
3
votes
2answers
2k views

How exactly does a program (executable image) and library (pre-compiled image) “link” together?

I know very well of the difference of static versus dynamic linking. What I want to know is, when linking statically (with a library like Winmm.lib on Windows), how does the linker "link" the pre-...
10
votes
2answers
13k views

Are Nested Static Library dependencies possible?

I am working in QT . Can a static library depend on another static library?(Static Lib is made by linking another static lib) If yes, is it possible that after linking to lib2, the generated lib(...
0
votes
4answers
158 views

How could distribution and reuse flexibility be hurt by linking my program as a static or dynamic library?

I'm writing a small program that I want to be able to link with other programs. I also intend to run it from a command line interface, and maybe later with a GUI interface. How could distribution ...
5
votes
3answers
5k views

C++ name mangling and linker symbol resolution

The name mangling schemes of C++ compilers vary, but they are documented publicly. Why aren't linkers made to decode a mangled symbol from an object file and attempt to find a mangled version via any ...
21
votes
5answers
10k views

Is there a modified LGPL license that allows static linking?

LGPL requires that it if a program uses LGPL-ed library, users must be able to re-link the program with a different version of the library: ... d) Do one of the following: 0) Convey the ...
7
votes
3answers
929 views

Compiler Linking: How to handle circular references?

I'm currently writing a compiler for a new language and I'm struggling with the linking aspect of new Types when there exists a circular reference. I've created a dependency tree so that I can ...
9
votes
3answers
22k views

Is it important to obfuscate C++ application code?

In the Java world, it seems to sometimes be a problem, but, what about C++? Are there different solutions? I was thinking about the fact that someone can replace the C++ library of a specific OS ...
2
votes
1answer
238 views

How can I move a library inside a project's source tree and compiling static binaries?

How can I move a library inside a project's source tree and compiling static binaries? I want to use a particular tool that utilizes ANCIENT binaries without upgrading it's API usage. This way I can ...