4,592 questions
0
votes
0
answers
39
views
How do I specify shared library flags in pkgconf files?
I've got a library (Google's protobuf, FWIW) which requires a certain compile-time flag if it's been built into a shared library. However, if it's been built into a static library, then it mustn't ...
3
votes
2
answers
145
views
What is the purpose of the ar “-l” option?
For context, I have been working on a game engine for a while now. The engine requires several libraries to function (Wayland, XKB, Vulkan, etc.). Because the added complexity of shared libraries ...
0
votes
0
answers
30
views
What is the best way to make CMake not install an included package/submodule? [duplicate]
I am trying to build and package an application with CMake, using Azure IoT C SDK. The projects instructs you to include it in your application by doing something like:
cmake_minimum_required (VERSION ...
3
votes
1
answer
230
views
__asan_default_options() ignored when used in a STATIC library and linked against an executable
I'm trying to globally configure AddressSanitizer (ASan) for multiple executables in my C++ project by defining the __asan_default_options() function, like this:
extern "C" const char* ...
0
votes
1
answer
114
views
How to compile a C++ project that uses a .a or .so library without having to provide all the .hpp files again?
I have a library that is already compiled to libserver.a
And then I have main.cpp like this:
#include <picohttp/picohttp.hpp>
#include <iostream>
The picohttp is already compiled to ...
1
vote
0
answers
167
views
How do I statically include libgccjit?
I've just compiled GCC from source, which gave me a libgccjit.so file to dynamically include from my program. However, perhaps I wouldn't want to bundle the file alongside the program if I were to ...
0
votes
0
answers
76
views
How do I use a Bazel built project/set of libraries , built as a submodule into a autotools based project?
I’m trying to integrate Quiche library (which uses Bazel as its build system) into an existing Autotools-based C++ project. I need it as a third-party submodule.
I am facing issues with:-
Linking the ...
2
votes
1
answer
210
views
Failing to link static libraries during Rust unit testing [closed]
I have been working on this simple example. This entire project is being compiled on a (Linux AArch64) Raspberry Pi 3B.
Say I have a simple assembly function (that does SIMD addition on AArch64) ...
0
votes
1
answer
120
views
statically linking SDL2 on Linux and macOS "like on Windows"
i had made a game on C using SDL2, SDL2_image, SDL2_mixer and SDL2_ttf libraries installed on Linux (Ubuntu) by sudo apt-get install libsdl2-dev (for example), and i wanted to improve it so it will be ...
1
vote
1
answer
68
views
Using a shared library within static library used by 2nd shared library and other applications, Linux tools
Basic question: Can one specify, when building a static library (and ONLY when building the static library), that the static library needs to link with a shared object?
I'm working on a project that ...
1
vote
1
answer
76
views
How do I link startup file inside of static library in GCC?
Clarification
I want to create static library from my code to share the artifacts (but not the code). I will call this Main_Project.
In my Main_Project, I have startup.s and flash.ld files.
startup.s:
...
0
votes
0
answers
120
views
Qt6: Static linked qml module
Problem description:
In Qt5, it was straightforward to work with QML resources in a static library. We simply created a .qrc file to include the QML files along with a qmldir, set QML_IMPORT_PATH for ...
1
vote
1
answer
233
views
building DLL based on libzip-static.lib
Thanks to kiyolee I have a VS2022 solution to build zlib and libzip (git clone of https://github.com/kiyolee/libzip-win-build and https://github.com/kiyolee/zlib-win-build) and I'd like to extend this ...
0
votes
0
answers
67
views
How to privately link a library to an external static library with CMake
I have a library B that privately depends on an external static library A.
I would like library B to statically link to library A such that any library that links to library B then doesn't need to ...
1
vote
1
answer
346
views
wasm-ld --export-all does not work with static libraries
While playing with building WASM modules using clang toolchain I hit a behavior that I'm struggling to understand. Basically, I have a very simple C++ code (in test.cc):
extern "C" int foo() ...
3
votes
1
answer
149
views
Visual Studio- Strip PDB file path from static library
I'm trying to remove the PDB path in order not to expose my computer's internal directory structure in libraries that are going to be distributed publicly.
In EXE and and DLL files I can specify "...
0
votes
0
answers
59
views
Error importing a Windows static library as a plugin
I am trying to import a third-party static library as a plugin into unity. I copied the library to Assets/Plugins/x64 folder and set the OS of the Plugin to Windows and architecture to x64. However, ...
0
votes
0
answers
547
views
How to link C++ project statically to zstd.lib?
I have a VS2022 C++ project that uses zstd. Previously, it used zstd v1.5.2; I changed this to v1.5.6 (the current version). Now when I attempt to run the project, I get an error "The code ...
0
votes
1
answer
123
views
How can I link a Go static library to a C program
I'm trying to call a Go function from a C program. I have built a static library from my Go source, however, ld is unable to find the function I want to call from the C program.
Go code:
package main
...
0
votes
1
answer
197
views
How to tell GNU linker to only try to find unresolved symbol so far from a specific static library?
I added some symbols into a existing src file, this src file is used by both the main program and an independent library. The added symbols belong to the main program hence locate in a static library ...
2
votes
1
answer
306
views
Hide symbol and source file name in C static library using cmake
I found a lot of questions on the hidden symbol topic in C static library.
I tried a lot of things:
-> Add strip and optimisation -O3 -s CFLAGS
-> Add -Wl,--exclude-libs,ALL" "-Wl,-...
1
vote
0
answers
108
views
Unable to static build the application using QML
I am working on a desktop Qt (6.2.0) application with UI built on QML (used through resource). I am looking forward to create static build for this application, but it fails because libGLX.a is not ...
2
votes
1
answer
292
views
Running `objdump` on an intermediate cmake target
I'm cross-compiling and I have a collection of assembly language programs in many files.
I define a static library, libtop.a to contain them all...
add_library(top
STATIC
/path/to/one.S
/...
1
vote
1
answer
93
views
Prevent symbol from static to override libc symbol
I have a static library which I don't control that defines the symbol gettimeofday(). The main function needs to use this function but I don't want it to use the one from the library, I just want the ...
1
vote
0
answers
71
views
Why use a dynamic library when only a single application will use it
I understand generally how dynamic static libraries work.
But i don't understand why a lot of libraries online will recommend building them to be dynamic, or why some programs like Unity ship with ...