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.

1
vote
0answers
11 views

How to embed a static library into a shared library - on OSX

I have asked this question on linux, but now I need the same info on macos... The question is (adapted to macos): I am trying to create a shared library, libbar.dylib, that embeds a commercial static ...
0
votes
0answers
14 views

How to fix 'Project ERROR: Unknown module(s) in QT: serialbus' with qt static-build

I'm setting up static-build for Qt application with Windows 7. I can build application without static-build setup in the same machine. Qt version-5.10.0 in windows 64bit. Compiler - MinGW-32bit I ...
0
votes
1answer
51 views

standard_init_linux.go:207: exec user process caused “no such file or directory” while trying to statically link c libs

I am unable to dockerize and use a utility written in c in go. I have run this program locally without docker and it works I tried using gccgo like so go build -compiler gccgo -gccgoflags -static-...
2
votes
1answer
46 views

How to embed a static library into a shared library?

On linux I am trying to create a shared library, libbar.so, that embeds a commercial static library (licensing is fine). The commercial library has 4 versions: libfoo-seq.a, libfoo-mt.a, libfoo-seq.so,...
1
vote
1answer
46 views

why can my gcc command not have -static parameter

I usually use gcc to compile my C program, it works ok, but when I tried to compile static library with -static parameter it always failed. Although I tried some solutions on google, but it still ...
1
vote
1answer
32 views

Can I force a dynamic library to link to a specific dynamic library dependency?

I'm building an dynamic library, libfoo.so, which depends on libcrypto.so. Within my autotools Makefile.am file, I have a line like this: libfoo_la_LIBADD += -L${OPENSSL_DIR}/lib -lcrypto where $...
1
vote
1answer
34 views

How do I create Rust programs statically linked for musl on ARMv7 using Raspian/Debian?

I am trying to create a statically linked version of a Rust program on ARMv7 (Raspian/Debian) by using the armv7-unknown-linux-musleabihf target in Cargo. The build fails for the dependency backtrace-...
0
votes
1answer
57 views

How to fix “invalid use of non-static member function” in a library importing another library

I'm writing a library for arduino which at a certain point must call a function after a fixed delay without using the delay function. Since standard c++ libraries are not included, I have to use ...
0
votes
0answers
34 views

How to install MySQL to (or with) Static Version

i know there are some topics about this already, however after two days of trying all i could (mainly I was not aware what Im doing, so maybe i did it wrong), therefore if I can kindly ask you not to ...
-1
votes
2answers
48 views

Qt Creator - How to deploy application using static parameter

I am trying on windows deploy and application as static, so the single exe file will include all required dlls inside. So when I distribute this single exe file amoung PCs, it will be working fine. ...
2
votes
1answer
47 views

Compile Python 3.6 statically with OpenSSL

I'm trying to compile Python 3.6 on Linux statically with OpenSSL. My build happens in a dockerfile, but essentially does: $ ./configure --prefix=/task/build --disable-shared LDFLAGS="-static" $ ...
0
votes
0answers
18 views

I am concerned about linking static libraries compiled with different threading models (Dwarf and SJLJ)

I have successfully linked the precompiled Dwarf libcurl.a (not libcurl.dll.a) with my SJLJ C++ application, and it is working without problems so far. I am concerned about this threading model ...
0
votes
1answer
41 views

static linking with cmake fails [duplicate]

I am trying to link to a static c++ Library with cmake on ubuntu. the library is installed here: /usr/local/lib/libfrnetlib.a and headers are located here: /usr/local/include/frnetlib Thanks for any ...
0
votes
0answers
51 views

GCC cannot find static library

I was trying to build strongswan staticlly. I compiled openssl static library in a non-standard lib directory. I added -static to CFLAGS, and -L<path_to_static_library> to LDFLAGS in ./...
0
votes
1answer
31 views

Add debug symbols when linking static library

I am developing Qt application for macos. There I am linking static lib to executable. I would like to add debug symbols produced in lib's build to the executable. How could I achieve that ? I am ...
0
votes
0answers
22 views

ffmpeg static link in Visual Studio [duplicate]

I have build ffmpeg static library on Windows. It seems that everything completed with success. The result of build are following files: libavcodec.a libavdevice.a libavfilter.a libavformat.a ...
1
vote
0answers
54 views

How to avoid msvcrt.dll compiling with mingw-64 32 bits?

I have some C++ code that I compile to various platforms, namely Linux 32/64 bits, Windows 32/64 bits. For the Windows part, I use the latest gcc compiler provided by mingw-w64 package. The trouble I ...
0
votes
2answers
38 views

Clang compiler ignoring the .a library file

This compiling works OK: $ clang -target x86_64-unknown-freebsd10.0 --sysroot=/opt/cross-freebsd-10/ -l:libconfuse.so main.cpp This one does not (undefined references on internal functions): $ ...
0
votes
1answer
49 views

Why can't I link against shaderc?

I have a vulkan project that is trying to use shaderc. The library was installed under the following path (linux system): ./libraries/shaderc/build/libshaderc Doing ls in this directory gives: ...
0
votes
1answer
13 views

static link to ldd output libraries

Static link to ldd output dynamic libraries except for glibc. I've been using ffmpeg to extract rtsp key frames and I want to make the c program work on xilinx zyqn board after static compiling. But ...
1
vote
1answer
66 views

Is it possible to compile a static library with an external dependancy that is unresolvable at compilation time?

I've created a web server using C and C++, which works in the following way: First, it initialize the socket for the connection. Then, when the server receives an HTTP request, it calls a function ...
0
votes
0answers
20 views

Error while building QT for static build / atlbase.h is missing

I am currently trying to build Qt for static linking. I followed the guide here http://amin-ahmadi.com/2016/09/22/how-to-build-qt-5-7-statically-using-msvc14-microsoft-visual-studio-2015/ I am using ...
1
vote
0answers
51 views

What does the “Rva+Base” mean in a MSVC linker generated map file?

I compiled a C program and linked with the Microsoft linker link.exe. The linker generated a *.map file. Below are some snippets: Start Length Name Class 0001:00000000 ...
0
votes
0answers
16 views

Error while linking mysql.h to a C program

I'm setting up MySQL database backend to use with my C program(on windows 10 64-bit), currently I am just testing following code that is very basic. #include<stdio.h> #include<stdlib.h> #...
1
vote
2answers
265 views

How to make static linking with C++ standard library?

i am has an object file(a.obj) and i am need to get executable(a.exe) file via linker call from command line. I am received a.obj file from this program: #include "stdio.h" int main(){ puts("...
1
vote
0answers
47 views

Linking to statically compiled z3 needs additional libraries on Linux

I used CMake to compile a static version of (a fairly recent of) z3 using: cmake -DBUILD_LIBZ3_SHARED=false -DCMAKE_INSTALL_PREFIX=/opt/z3-devel -G "Unix Makefiles" ../ Now when I statically link ...
0
votes
1answer
119 views

Why 64-bit project in Visual Studio still uses 32-bit static-libraries? [duplicate]

I created a Win32 program in VS2017, and turn into x64 Release Configuration. I found that input libs in linker that were evaluated with %(AdditionalDependencies) still point to those libs in 32-bit. ...
0
votes
0answers
10 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
32 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
20 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 ...
1
vote
1answer
128 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
173 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
65 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
36 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
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
69 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
63 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
84 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
75 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
47 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
56 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
42 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
1answer
30 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
83 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
80 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
25 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
51 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
2answers
66 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
293 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
308 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 ...

http://mssss.yulina-kosm.ru