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
Static linking relocated addresses
I have a very basic doubt in static linking.
Suppose we have 2 object codes A and B. Object code B contains function B() which is called by A.
Now suppose in object code A at 100th location function B() is called.
Now will the function B() be…

Zephyr
- 1,521
- 3
- 22
- 42
0
votes
3 answers
.lib linking other .libs
Currently my visual studio is basically generating Engine.dll and Game.exe
Engine.dll links to some other basic libraries like:
d3dx9d.lib
ComCtl32.lib
WinMM.lib
WSock32.lib
etc.
I also wanted to try to create an Engine.lib, but I get some really…

Tony
- 417
- 4
- 11
0
votes
1 answer
MinGW, how to avoid linking statically full libstdc++
I am using mingw 64 bit with cygwin.
I know that if I compile using
x86_64-w64-mingw32-g++.exe -std=c++11 hello.cpp
the output .exe does not run unless the library path to libstdc++ and other libraries is specified in the Path environment…

Hybridslinky
- 131
- 1
- 13
0
votes
1 answer
trouble linking to libglut.a in D
I have a simple openGL D program that compiles, but I can't get it to link with libglut.a. I've tried a few different command lines:
$ dmd life.d -lglut
$ dmd life.d -L-lglut
$ dmd life.d -L/usr/lib/libglut.a
$ dmd life.d /usr/lib/libglut.a
All of…

Max
- 1,295
- 6
- 16
- 31
0
votes
0 answers
Statically linking object file that has DLL dependency
I have the C source code for a library that when used on Windows calls functions from a DLL. Can I compile the library to an object file and statically link it to my application (if I provide the linker with the name of the DLL)? Asked another way,…

c2po
- 13
- 3
0
votes
1 answer
Is it possible to link a library at runtime?
Given a Windows environment...
I know it is possible to use DLL or reflective DLL injection to load shared libraries (DLLs in the case of Windows) at runtime. As stated quite clearly here;
…

Steve Mucci
- 212
- 1
- 11
0
votes
2 answers
Problem with wxWidgets on Snow Leopard
I have a problem with getting compiled an wxWidget-application. I have installed the latest version of the library as follows:
set arch_flags="-arch x86_64 "
./configure -with-osx_cocoa --disable-shared --disable-compat24 --enable-unicode…

LonliLokli
- 1,295
- 4
- 15
- 24
0
votes
1 answer
references undefined when linking against boost 1.63 static libs
I'm linking against boost statically. When I do so, I get some undefined reference errors (below).
[100%] Linking CXX executable infiniteTests
/home/wdog/src/protos/infinite/libinfinite.a(ServiceDiscovery.cpp.o): In function…

stack user
- 835
- 1
- 9
- 28
0
votes
1 answer
relocation R_X86_64_32S against `.text' can not be used when making a shared object
I am compiling a static library, which leverages some inline assembly code.
I notice that when I use labels for the jmp instruction:
int foo(){
asm volatile
(
"mov 0x60(%r8),%r11d\n\t"
"jmp *S_401a70\n\t"
...
"S_401a70: xor…

lllllllllllll
- 8,519
- 9
- 45
- 80
0
votes
0 answers
Compiling with static GL libraries in C++
I am trying to statically link GL, GLEW, and GLFW in my CMake-based program.
Here is my current, working, non-static CMakeLists.txt:
project(GLApp)
cmake_minimum_required(VERSION 2.8)
aux_source_directory(. SRC_LIST)
file(GLOB SRC_LIST…

Ethan McTague
- 2,236
- 3
- 21
- 53
0
votes
1 answer
Static linking of protocol buffers with codelite
This is my first ever serious compiling experience on linux. I've installed codelite on ubuntu. I'm trying to build a shared library that uses protocol buffers. I've built protocol buffers with no problems. However, no matter what I do I cannot add…

Carl
- 705
- 8
- 22
0
votes
0 answers
Linking against 32 bit boost libraries
I'm trying to link my project against a couple of boost libraries and I ran into a 32 vs 64 bit problem.
I'm using Visual Studio 2015. I added path to the built boost libraries to VC++ Directories.
Here's the output I get:
2>main.obj : error…

Kirill Daybov
- 480
- 3
- 19
0
votes
0 answers
Is it possible to find out why linker links a particular static library?
I have a small C++ application that statically links a framework library, let's call it F, providing me various kinds of features. For some of them the F framework uses another static library L which therefore I also have to link. It is quite big…

Michal Wirth
- 169
- 2
- 8
0
votes
1 answer
Compiling C library in C++. Linking issue. MuPDF
I tried multiple PDF lybrary and MUPDF is my last chance to build my own small PDF application. But here I also have problems. Before that I had problem with LNK4098: defaultlib 'MSVCRT', but I solved that to set for all MUPDF library /MDd version.…

hardCode
- 39
- 6
0
votes
1 answer
C++ MinGW GCC CodeBlocks static linking
For my C++ program I would like to statically link the following dlls' in my CodeBlocks setup with the MinGW GCC compiler:
libcurl-4.dll
libeay32.dll
ssleay32.dll
Yes, I know I can't statically link these DLLs since these are Dynamic Libraries.…

TVA van Hesteren
- 1,031
- 3
- 20
- 47