A static library or statically-linked library is a set of routines, external functions and variables which are resolved in a caller at compile-time and copied into a target application by a compiler, linker, or binder, producing an object file and a stand-alone executable. This executable and the process of compiling it are both known as a static build of the program.
Questions tagged [static-linking]
1772 questions
0
votes
1 answer
Statically or dynamically linking to C-Runtime (CRT) for binaries running in containers?
So far, I've always preferred statically linking to CRT for its advantages. Does the fact that I'm going to run the binaries in containers make any difference? I'm new to Docker and I'd like to know if there's the "right" way.

n0p
- 713
- 10
- 23
0
votes
3 answers
How to build static library using RAD Studio 2010?
I have been confused by C++ Builder 2010 assuming my library is dynamic. I did not find any options or help in documents regarding what I need to change in the project to build static library.
Now I produce DLL, but I need to produce LIB, so I can…

Sergey
- 685
- 2
- 8
- 30
0
votes
1 answer
Library linked to a library which itself is linked to an application -> undefined reference
I am looking at my problem for hours and I am stuck...
I have a library lib_1 with function getNumber().
Then I have a library lib_2 with function addNumbers().
addNumbers() calls getNumber() from lib_1.
My CMakeLists.txt:
add_library( lib_1…

madmax
- 1,803
- 3
- 25
- 50
0
votes
1 answer
How to execute a function from a statically loaded library in linux?
I am writing a native launcher in linux for a java program. The launcher should load libjvm.so statically and execute the function JNI_CreateJavaVM() via a function pointer, so I can launch the executable without having to first set LD_LIBRARY_PATH.…

Grumblesaurus
- 3,021
- 3
- 31
- 61
0
votes
1 answer
How to export functions that have no name from a dll
I have a .dll I want to statically link to my C++ exe. I have created a header I believe to contain accurate function signatures, so I need to build a lib file from my dll. I use dumpbin to get the names of the functions in the dll, but most…

john
- 3
- 2
0
votes
2 answers
cuda and c++ problem
hi i have a cuda program which run successfully
here is code for cuda program
#include
#include
__global__ void square_array(float *a, int N)
{
int idx = blockIdx.x * blockDim.x + threadIdx.x;
if (idx

user513164
- 1,788
- 3
- 20
- 26
0
votes
2 answers
LZ4HC Compile problem: LZ4_compressBound undefined
I tried to create an executable file for LZ4HC (I used the source code from lz4 homepage), but when I was trying to execute the file, it displayed "Symbol error LZ4_compressBound undefined".
Neither static linking nor dynamical linking wasn't…

Tsubaki
- 61
- 5
0
votes
1 answer
Unable to link prebuilt static library with shared library in Android NDK
AOSP 7.1.1_r50 Tree
├── abi
├── art
├── bionic
├── bootable
├── build
├── cts
├── dalvik
├── developers
├── development
├── device
├── docs
├── external
├── frameworks
├── hardware
├── libcore
├── libnativehelper
├── libtest
│ ├── libA
│ └──…

acalb
- 74
- 2
- 7
0
votes
2 answers
CMake linked librarys cannot be found
I've created a very basic c++ sample using the ZeroMQ library on my linux machine.
Building the project
To build the project, I decided to use CMake. Currently my CMakeLists.txt looks like this:
cmake_minimum_required (VERSION…

johni07
- 761
- 1
- 11
- 31
0
votes
0 answers
How to create a static Qt application with protobuf files on Linux?
I want to build a static qt application. First of all I build qt static version on my linux machine. In the first time when I builded static application, I received errors because my qt can't link my application with some linux *.so librarys. I…

Albert
- 81
- 2
- 8
0
votes
0 answers
How to link against an older version of GLIBC?
I am compiling on a machine with GLIBC_2.27 (Ubuntu 18.04) a shared library to be loaded on a machine with GLIBC_2.17 (Centos 7). While essentially every other library can be linked statically into my shared library, glibc cannot. So, I scanned the…

KevinZ
- 3,036
- 1
- 18
- 26
0
votes
3 answers
Access static variable from CPP file to other header file
I'm trying to access the static variable in other header file from a CPP file.
"Boo.hpp"
#ifndef Boo_hpp
#define Boo_hpp
static int num;
class Boo
{
public:
Boo()
{
num = 35;
}
};
#endif /* Boo_hpp */
"Foo.hpp"
#ifndef…

Zack Lee
- 2,784
- 6
- 35
- 77
0
votes
1 answer
How to stop creating .asm files when linking a library in the linked library (grpc) in MSBuild C++
We have a static library that exports some grpc.pb.cc, grpc.pb.h files and except that a bunch of other ordinary files. We call this LibMicroservicesClient.
Then we have another library that is linking this library using ProjectReference in…

Martin Kosicky
- 471
- 4
- 12
0
votes
2 answers
Can I build a Go program while statically linking some DLLs with it?
If you ran a go app with Windows DLL dependencies on a slow hdd disk, it sometimes occurs that Windows takes too long to load those dll.
If you put your go app into a windows service you get serious problems.
Especially on slow hdd disks, this leads…

Eric
- 115
- 1
- 10
0
votes
1 answer
Statically linking libvips to a Rust program in Windows
There is a lib-sys for libvips on crates.io, however it uses pkg-config which searches the system for the library to link to dynamically, not statically.
I want to provide libvips with the final binary of my software in .dll or .exe along with it…

Fdrph
- 1
- 1