static-linking Questions

5

I am trying to make a static build of Qt (version 5.4.1) with OpenSSL support. I configured it as follows: configure -opensource -release -c++11 -static -platform win32-msvc2013 -openssl-linked -...
Dispersoid asked 31/5, 2015 at 10:3

6

Solved

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 ca...
Kendra asked 7/8, 2010 at 12:24

3

I'm trying to understand the correct way, or right approach, to provide a reasonably large C++ API for a non-open source project. I do not want to provide a "header only" library as the code base i...
Juieta asked 25/6, 2019 at 9:47

0

I have around 26 static libraries such as liba.a, libb.a, libc.a, ..., libz.a. There are two catches here: 1) circular dependencies between for example liba.a and libb.a; 2) some lib*.a has stati...
Adversity asked 27/5, 2019 at 9:24

1

I am trying to initialize a static object in a C++ file which is trying to auto register a class to a factory in its constructor (like any standard auto-registration problem). The problem is, this ...
Madelina asked 5/9, 2016 at 19:43

1

Solved

I need to make a cross-compiled OpenSSL for a MIPS device. I've tried following the documentation. Set OPENSSL_USE_STATIC_LIBS to true and set target_link_libraries to the library files you need. ...
Giess asked 14/3, 2019 at 14:32

5

Solved

I'm experimenting with the concept of pure-static-linked PIE executables on Linux, but running into the problem that the GNU binutils linker insists on adding a PT_INTERP header to the output binar...
Margaritamargarite asked 5/5, 2012 at 20:48

7

Solved

I'm trying to build an OpenCV-based project using CMake, running on Linux. So far my CMakeLists.txt files looks something like FIND_PACKAGE (OpenCV REQUIRED) ... TARGET_LINK_LIBRARIES (my-executab...
Farewell asked 20/9, 2010 at 21:2

1

Solved

Testing something else I stumbled across something that I haven't managed to figure out yet. Let's look at this snippet: #include <iostream> #include <chrono> int main () { int i = ...
Lorusso asked 16/8, 2018 at 8:15

2

Is there any way to statically link the generated .exe file from MSYS2 gcc? I tried many ways, but none of them worked. All generated .exe files require msys-2.0.dll, which I want to get rid of. So...
Duer asked 30/5, 2016 at 11:43

2

Solved

I'm writing a program in Crystal, that I intend to compile and move to other systems for execution. Ideally, it should have no dependencies, as the target systems will be fresh installations of lin...
Celloidin asked 3/2, 2016 at 0:28

1

Solved

When using external libraries, you often have to decide whether you use the static or the dynamic version of the library. Typically, you can not exchange them: If the library is build as dynamic li...
Rosado asked 29/1, 2019 at 14:58

2

Solved

I would like to compile NRPE static, so I can copy the compiled binary to an OmniOS server, where I don't want gcc to be installed on. I would prefer to install NRPE with SSl support from a reposit...
Kalie asked 19/11, 2013 at 10:25

2

Solved

When I use GCC, I can build program on my Ubuntu 15.04 using this: -static-libgcc -static-libstdc++ And compiled binary can run on "stock" Ubuntu 14.04 without any external packages, only standa...
Hellgrammite asked 22/12, 2015 at 9:4

2

Solved

I am working on a C library which compiles/links to a .a file that users can statically link into their code. The library's performance is very important, so I am writing performance-critical routi...
Bossy asked 28/11, 2018 at 2:19

4

I have a requirement that I link all my libraries statically including libstdc++, libc, pthread etc. There is one omniorb library which I want to link dynamically. Currently I have dynamically lin...
Toni asked 28/5, 2011 at 9:6

2

Solved

I am developing a native node module for AWS lambda. This node module needed json-c As per AWS lambda guidelines the node module should not have dynamic dependencies. So tried linking the static ...

2

Solved

I'm using a C++ library that can be built as either a shared or a static library. This library uses a factory technique, where static objects register themselves when the program starts and the sta...
Emelinaemeline asked 22/1, 2011 at 12:58

3

Solved

I have built glibc 2.14 and installed it in directory ~/GLIBC/glibc_install. Now I want to build and run programs using this C library instead of my system's default C library. To be sure that I...
Tetraspore asked 26/5, 2012 at 3:37

3

I have a static library file called libunp.a, I do know I could use gcc -lunp xx to link to the library. I could use #pragma comment(lib,"xxx.lib") to tell the Microsoft C/C++ compiler to include ...
Irrelevant asked 6/11, 2009 at 3:20

1

Solved

Edit: Found a solution but can't accept my own answer yet. I am having some trouble statically linking a library to my program. I am cross-compiling from Linux to Windows using the MinGW toolchain...
Ownership asked 6/9, 2018 at 13:5

2

How can I pass an argument to ranlib when compiling a static library with CMake? I tried: set_target_properties(myLibrary STATIC_LIBRARY_FLAGS "--plugin /usr/lib/gcc/x86_64-linux-gnu/4.9/liblto_p...
Molloy asked 31/8, 2015 at 20:22

3

I'm trying to link a Rust program with libsoundio. I'm using Windows and there's a GCC binary download available. I can link it like this if I put it in the same folder as my project: #[link(name ...
Nkvd asked 27/11, 2016 at 19:36

4

Solved

I am debugging static multi-threaded x86-64 C++ application on Linux. I can set breakpoints on functions and stop on them and I can walk step by step over function body. But when I try to step int...
Kaleykaleyard asked 3/6, 2013 at 15:41

6

I'm trying to get SCons to make a shared library. One of the items going into the .so is a .a static lib. I have a line like: env_2.SharedLibrary('libstuff.so', \ Split("""stuff.cxx mylib/libMin...
Pamplona asked 11/2, 2010 at 17:48

© 2022 - 2024 — McMap. All rights reserved.