Questions tagged [static-linking]

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.

0
votes
0answers
4 views

Not able to compile statically i2c-tool

I am working on i2c-tools-4.1 and want to cross compile statically. I have done changes in Makefile as well as Module.mk but i dont see any changes in my binary file libi2c.so.0.1.1: ELF 32-bit LSB ...
0
votes
1answer
24 views

How to force the linker to look for a non-decorated name in a lib file?

Found no answer for static linking (lib files), but only to DLLs... I have a static lib in which the function I need to call is not decorated (FT_CreateDeviceInfoList). But the linker is looking for ...
0
votes
0answers
16 views

Statically compile LLVM tools

I am trying to run lli, the LLVM JIT, on a stripped-down Linux system that does not have dynamic library support. Going into build.ninja and adding the -static flag feels like a hack, and (at least ...
0
votes
1answer
25 views

compiling static curl with static openssl 1.1.1a

I have a C++ project that compiles and links to a static curl library (7.46.0). I am upgrading the curl to support openssl 1.1.1a. Building curl 7.64.0 with static openssl using below command. nmake /...
0
votes
1answer
33 views

Static linking of OpenSSL Crypto in CMake

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. ...
3
votes
1answer
62 views

Does the usage of header only libraries with different versions result in UB

Lets assume I have a library somelib.a, that is distributed as binary by the package manager. And this library makes use of the header only library anotherlib.hpp. If I now link my program against ...
0
votes
0answers
12 views

How can I get glibc as a static library?

I want to compile a program and statically link it to glibc, so it can run on other Linux distributions without the user having to do any special configuration. I tried using CFLAGS="-static -static-...
-1
votes
0answers
19 views

Extern'd functions not visible to statically-linked JIT

I have a written an LLVM JIT following the Kaleidoscope tutorial, which implements a simple toy language interpreter. Note: I previously asked a similar question on this site before I got this ...
1
vote
0answers
34 views

What package should I install to work with OpenGL

I want to use pacman to install OpenGL but I get an error compiling. I want to link with -lglut -lGLU -lGL but what packages are those? Is there a way to find out? #include <iostream> using ...
1
vote
1answer
42 views

Compiling CUDA-code to a static library (.a) on linux

I'm trying to compile a small library containing CUDA code. I have succesfully compiled it as a shared lib, but what I actually need is a static lib. I have two source files: main.c: containing a ...
0
votes
0answers
47 views

Using dynamic runtimeLibrary despite “static” in cpp.runtimeLibrary in qbs profile

I have some qbs project and I've met with some strange behavior of linking with runtime library. I used Qt static libraries and custom modules //---------MyQtGuiApplication.qbs import qbs ...
1
vote
1answer
34 views

Build a static library for c++ which is internally dependent on third-party libraries

I want to make a library say libmyfoo.a at a location /home/my/library/libmyfoo.a And I want to use this static library in the simplest form as below: Lets say this is myProgram.cpp #include "AAA.h"...
0
votes
0answers
37 views

MTd Vs MDd - Static linking win32 library in QT Creator

I have a static library built with Visual Studio as a static library (built with Run Time Librbary:Multi-threaded Debug (/MTd)). But when I am using it in my QT project, it says mismatch. xerces-...
0
votes
0answers
36 views

Unresolved external symbol in static library

I was trying to use xerces library in my project as a static library. But getting two unresolved symbols. Since I can rebuild the library, any idea how to export these? The two unresolved external ...
-1
votes
1answer
55 views

Why is Dynamic linking taking so much time?

So I wrote a very very basic virtual machine that runs on a small subset of c-. I was profiling it to try and see what the bottlenecks were, and the results really confused me. 73% of the time was ...
0
votes
1answer
28 views

Security when running static builds in docker scratch images?

I am currently evaluating different options to reduce image sizes. Apart from alpine, there's also the option to run static builds in scratch images with multi stage docker builds, which most of the ...
0
votes
0answers
16 views

Is is possible to cross-compile statically-linked native GUI binary to android without using NDK? [on hold]

I am trying to learn more about android from bottom up. I manage to cross-compile hello-world using approach similar to: Cross compiling static C hello world for Android using arm-linux-gnueabi-gcc ...
0
votes
1answer
26 views

MSVC17 Linking application with runtime statically, still getting missing dll error

I set /MT flag to have my c++ application statically linked with C runtime, so I don't have to worry about redistributing the runtime, however, upon launch I get an error message saying missing "Api-...
0
votes
2answers
48 views

undefined reference to '__imp_fmi2_import_free'

I have been trying to compile and link a test file written in c and which can communicate with FMILibrary of JModelica. I was able to compile and link it and run it in linux systems. coming to the ...
3
votes
1answer
39 views

Why cant you statically link dynamic libraries?

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 ...
0
votes
2answers
24 views

How to handle asynchronny in two separate files?

I currently have two files. delay.js : For demonstration purposes to simplify the example, let's say the file contains a single asynchronous function. (Obviously actual file is much more complex) ...
-2
votes
2answers
47 views

Why can dynamic libraries link to other libraries, but static ones can't?

Consider the following code structure: main.cpp -> depends on libone.a -> depends on libtwo.a Assume that in main.cpp only functions from libone.a are used. So realistically the programmer ...
0
votes
1answer
40 views

How to build plugin by Xcode include OpenCV library (or another 3rd party library) to give Unity to use?

I know that Unity couldn’t dynamically call 3rd party library (non-standard library) in the plugin when it runs. Therefore, we need to include some static library in the plugin before we build. But, I ...
1
vote
0answers
145 views

How to compile ffmpeg for Windows statically with MSYS2 environment?

I want to build myself standalone statically linked ffmpeg binaries for Windows from official git source code with MSYS2 environment tools. But every time I get .exe file dynamically linked to mingw ...
1
vote
0answers
198 views

Building static Qt 5.12 by mingw, can't found GLES2

I got following error when building static Qt. ....\include/QtGui/../../src/gui/opengl/qopengl.h:111:13: fatal error: GLES2/gl2.h: No such file or directory # include Here is how I ...
0
votes
0answers
32 views

compiling tcltls .so with static openssl-Lib

I need to compile tcl/tk myself and want to add the tcltls-Package. As i don't want to depend on the systems openssl-lib i want to include openssl into my shared-object. Therefore i installed ...
0
votes
0answers
16 views

MinGW-w64 fails to statically link Cython code on Windows

I have the exact question as: Cython static link with python runtime? on Windows 10 and Python 3.6. I see a libpython36.a in my \Python3\libs\ directory, gcc (MingW-w64) doesn't seem to recognize it ...
1
vote
0answers
33 views

Not able to use static library created using swift in Xcode 10.1

I have created a static library using swift in Xcode 10.1 . Imported some swift files and build the library project with Release configuration for both simulator and generic device. Then used lipo ...
0
votes
1answer
43 views

Cannot find -lfreetype (SFML static linking)

I'm trying to statically link SFML, which requires linking all other dependencies. On the SFML tutorial page it states that all dependencies are provided along side it, but I genuinly couldn't figure ...
0
votes
0answers
31 views

How to get the code size for Caffe & Tensorflow (code with dynamic loading/linking)?

These two project content dynamic loading/linking libraries. I'm trying to find out what is the minimum space usage if we install a Machine Learning framework,Caffe & Tensorflow , on embedded ...
-1
votes
1answer
82 views

emcc static linking to cpp library

I'm trying to compile my c++ code to .wasm, but my c++ code need -Llibraries/bcrypt -lbcrypt to be compiled, how i can include the library in emcc my g++ compile command : g++ --std=c++11 -lbcrypt ...
0
votes
1answer
28 views

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 ...
2
votes
0answers
82 views

Unable to statically link boost-locale due to libicu linking errors on Ubuntu 18.04

The following code: #include <boost/locale.hpp> int main() { using namespace boost::locale; generator gen; } Built with the following flags: g++ -static -static-libstdc++ -pthread ...
0
votes
1answer
19 views

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 ...
0
votes
1answer
52 views

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 ...
0
votes
1answer
51 views

How to compile a static version of unison

On my OS X box, brew install unison gives me version 2.51.2. But the system I need to sync with runs CentOS 6.10 for which there appears to be no existing 2.51.2 binary. I also can't compile from ...
1
vote
0answers
13 views

Building a binary statically to run on another distro (AqBanking)

I want to run AqBanking on a server that does not allow installation of packages for security reasons. My idea was to link a static binary. I basically did this: apt-get source aqbanking-tools apt-...
7
votes
2answers
134 views

Choose assembly implementation to use based on supported instructions

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 routines ...
-2
votes
2answers
56 views

How to link libraries using CMake [closed]

I am currently trying to figure out how to link libraries in CMake. To the best of my knowledge I have everything set up properly. However, when I try to build I get the following error. test/src/...
1
vote
1answer
53 views

Link C++ with statically , libraries not found

I want to link a g++ binary with the -static flag but I get this error I am using fedora 29 ERROR /usr/bin/ld: cannot find -lstdc++ /usr/bin/ld: cannot find -lm /usr/bin/ld: cannot find -lc collect2:...
0
votes
0answers
122 views

How can I statically compile libusb (C library) with my Golang project?

I am building a Golang application in which I need to integrate EPSON's USB printers. My project imports Google's "gousb" project (https://github.com/google/gousb) to enable that functionality, which ...
1
vote
1answer
51 views

g++ - linking stage (-L flag) not working

I am new to C++ and am trying to figure out where in the compiling process my error is. Apologies, if this question is unclear, I'm not sure what information to provide. Reference information: The ...
0
votes
1answer
59 views

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 ...
0
votes
1answer
89 views

Make linux binary portable (ELF Statifier)

I am currently having difficulties making a linux binary portable. I've tried with ELF Statifier via the following syntax: statifier /bin/ls static-ls then tried to run it on another machine which ...
0
votes
0answers
111 views

Static linking using musl lib and clang 6.0 over ubuntu 16.04

I m trying to build musl lib using clang 6.0 on an ubuntu 16.04. And then link the created libc.a to example.a using cmake 3.5.1 To build musl lib I have used these instructions (only static are ...
2
votes
2answers
74 views

How Linkers Resolve Multiply Defined Global Symbols in C

My Textbook says that: "Functions and initialized global variables get strong symbols. Uninitialized global variables get weak symbols.Given a strong symbol and multiple weak symbols, choose the ...
1
vote
1answer
83 views

linking with static library in C

Hi I'm a beginner in C and Linking, I was reading a book that has a question in linking with static library: Let a and b denote object modules or static libraries in the current directory, and ...
0
votes
0answers
120 views

how to generate tensorflow_cc static library?

Fromt the tensorflow github, I can only generate the tensorflow_cc.so(https://github.com/tensorflow/tensorflow/blob/master/tensorflow/BUILD#L478), I spent couple of hours tring to generate static one ...
0
votes
0answers
235 views

Problems linking GLFW with CMAKE

I'm trying to add GLFW to my C++ project in CLion. I've downloaded the pre-built Windows binaries, and I'm attempting to add them to my CMake file, but I'm getting errors. Here's my CMakeLists.txt ...
0
votes
0answers
34 views

using native OpenCV as static library in android studio

i want to add static Prebuilt opencv library in my android project. actually i want use opencv just in NDK ( i don't want to use java interface ). i couldn't set Android.mk , Application.mk an gradle....

http://mssss.yulina-kosm.ru