Skip to main content

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.

static-linking
1 vote
1 answer
28 views

Why is linking a dynamic library against a static library apparently easy on Windows but on Linux `-fPIC` makes that difficult? [closed]

I am working on adapting an existing ODBC driver so that it can target Linux. ODBC Drivers are generally distributed as DLLs on Windows and shared objects (.so) on Linux. The driver depends on Boost. ...
William Navarre's user avatar
0 votes
2 answers
70 views

How to configure my libraries and dependencies to compile my App as static

I am Programming an App with visual studio 2022, in c++, x64 with libraries installed with help of vcpkg. They are dynamic link libraries. I want to use my App as static, to run it in another PC ...
juanlg's user avatar
  • 3
1 vote
1 answer
72 views

Can static-libraries functions get inlined?

Can Static-libraries functions get inlined? lets say I have these files main.cpp #include <lib/header.hpp> int main() { return lib::meaningoflife(); } lib/header.hpp namespace lib { ...
user24551355's user avatar
0 votes
0 answers
30 views

Hiding non-exported symbols in static libraries on Windows

I have a set of C files that are compiled and linked into a library. If I create a normal dynamic library (.so, .dylib or .dll) I can make sure only those functions marked as EXPORTED are visible to ...
magicus's user avatar
  • 131
1 vote
0 answers
52 views

Flex Scanner continuously running after implementing steps from authoritative book

I'm on Linux Ubuntu. I'm reimplementing the Flex scanner example provided at page 5 of "Managing projects with GNU make" by ROBERT MECKLENBURG. count_words.c (application source code): #...
yossi-matkal's user avatar
0 votes
1 answer
74 views

Is it possible to build opencv statically under Linux without having problems with missing/incompatible libraries?

I'm trying to distribute an opencv binary on different Linux operating systems, but I've failed because of dependency problems. What I'm aiming for is something similar to the opencv-python pip ...
smbape's user avatar
  • 1
0 votes
0 answers
33 views

Linking project with premake and make on linux

I have been trying to link my project on arch linux with g++ 14.1.1. I use premake5.0.0-beta2 in order to generate the makefiles. It worked under Windows when i generate with premake5 vs2022 but on ...
Keyonz's user avatar
  • 1
0 votes
0 answers
61 views

How to static link dependency in meson build?

I am trying to static link a dependency in the meson build but I am getting this error: WARNING: Static library 'sndfile' not found for dependency 'sndfile', may not be statically linked WARNING: ...
Fawad Bhatti's user avatar
0 votes
1 answer
66 views

attempting to link libc statically with clang, ldd showing dynamic linking?

I'd like to compile a C program with system libraries (such as libc) linked statically, with all my other custom libraries (such as openssl) linked dynamically. When I compile a "Hello World"...
Austin M's user avatar
0 votes
0 answers
30 views

How do I configure my library to best support static builds of dependent projects?

Suppose I am developing the libfoo library, written in a compiled language, and am using CMake to configure its build. This library itself depends on another library, libbar. Thus, if someone else is ...
einpoklum's user avatar
  • 127k
1 vote
1 answer
69 views

Missing symbols when statically linking library with static dependencies

I have an executable (test) using a static library (A), which uses another static library (B). The file structure is as follow: test: { CMakeLists.txt, main.cpp, deps: { A: { ...
luis's user avatar
  • 2,257
1 vote
0 answers
62 views

Static link in .net looking for shared library

I'm trying to test this static linking example with .net in linux and keep getting the following exception; System.DllNotFoundException: Unable to load shared library 'nativelib' or one of its ...
user2384330's user avatar
0 votes
1 answer
54 views

Use Go runtime with -buildmode=c-archive

Is it possible to have Go code use the Go runtime with this buildmode? -buildmode=c-archive I am building my Go code as a static library and linking it with .o files that were compiled from native ...
CorkiMain's user avatar
1 vote
0 answers
52 views

Paho Mqtt in Unreal Engine 5.3.2

I'm trying to create a plugin for Unreal Engine 5.3.2 for connecting to an mqtt broker in c++ and for that I need to use paho.mqtt.c and paho.mqtt.cpp. I built the 2 libraries with cmake. When I tried ...
Christina Repou's user avatar
0 votes
0 answers
51 views

Ceres solver, include issues

I created a new C++ project in Visual Studio that uses ceres, installed it using vcpkg. I did the static linking process that I do with other libraries (linking the include and .lib file) for ceres ...
Lucifer Holmes's user avatar

15 30 50 per page
1
2 3 4 5
122