Questions tagged [static-libraries]

A static library is an archive of object files. Used as a linker input, the linker extracts the object files it needs to carry on the linkage.

0
votes
0answers
23 views

How to add a static library to Yocto SDK package

I have a .a and .h file that should be added into the SDK installer. The header file is correctly put in the {includedir} aka /usr/include However, the static lib file which is set to be added in {...
1
vote
1answer
61 views

Is this a static build?

Firstly, forgive me for my ignorance on this topic - I'm new to compiling as a whole and far from a programmer, and I'm trying to understand the concept of static vs shared builds/libraries. I've ...
-2
votes
0answers
55 views

compile a file.c with a .h file [closed]

I'm learning C programming, and I have a problem with developing my own library. Let's make a simple example. I have 3 files, prova.c, lib.h, lib.c, with the following code: prova.c #include <...
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
42 views

Unresolved external when building static qt

I need to build static QT 5.12.1 libs on Windows 10 using qt-everywhere-src-5.12.1.tar.xz as source That's how I set up my build environment: CALL "C:\Program Files (x86)\Microsoft Visual Studio\...
0
votes
0answers
11 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
20 views

Building the protobuf library as a static library

Is there a elegant way to build the protobuf library as a static library with bazel? If not then not is there a way to build in bazel and get the absolute path of the so for linking?
-2
votes
0answers
20 views

detect frame pointer in static lib

Can I determine in a static lib file in linux if it was compiled with frame pointer omitted or present? In my application, I want to know if it is boost that is using up so much time and I suspect ...
1
vote
0answers
13 views

Link DLLs that share the same static library

Actually I've the case where two DLLs library_1 and library_2 use functions of a static library vendor.lib, and additionally, library_2 links against library_1 (see diagram below). When I try to ...
3
votes
1answer
57 views

Using gcc compile some package statically got an error about libprocps.a

# g++ -v Using built-in specs. COLLECT_GCC=g++ COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-linux-gnu/7/lto-wrapper OFFLOAD_TARGET_NAMES=nvptx-none ...
0
votes
1answer
21 views

How to add opendnp3 as a static C++ library

I am currently trying to set up the opendnp3 C++ library as a static library. I've built the solution following their build guide for Windows and have been able to generate several .lib files which I ...
0
votes
0answers
20 views

Including a static lib dependency in a pod

I have a project with a nested library, and I'm trying to include it as a dependency for the pod. My podspec follows: Pod::Spec.new do |s| s.name ="MyPod" s.version ="0.0.1" s....
1
vote
0answers
25 views

How to install a static library both on Windows and Linux using Cmake?

I want to install a library both on windows and linux using same CMakeLists.txt file. My cmake file is: cmake_minimum_required(VERSION 2.6) project(library) include_directories(include) file(GLOB ...
-1
votes
1answer
22 views

How cmake can set different gcc flags for each module?

I want create project c++ (gcc) with submodules - static libraries. Base library should be always build optimized and without debug info, main module can be not optimized and with debug info. First ...
-1
votes
0answers
41 views

Library Size Increment Observed when One Large C File is Splited to Multiple C files

When one Large C File is Divided to Multiple C files Observed a Reasonably big increment in Library size , But unable to Find the actual root cause!!
0
votes
1answer
15 views

Is it possible to re-initialize a static library?

In our iOS app we use a closed source statically linked library (foo.a + header files). The library keeps its own internal state, most likely in global variables. And unfortunately, after a while, ...
-1
votes
1answer
36 views

Xcode 10 static library doesn't include x86_64 arch

I am building a static library to be used with another project I'm working on, and eventually it will be included in a framework I'm developing. When I bring the library into my project, the arm ...
1
vote
1answer
27 views

How do I create a library (.a file) in Atmel Studio 7?

I have a body of code that's best packaged up as a library. How do I create a library in Atmel Studio 7?
0
votes
0answers
20 views

compiling c code with libtiif static from mac for windows

I have a c code which is using tiff library and jpeg library, as static libraries. I have successfully compiled them on mac for mac with makeFile using gcc. Now I want to make the same for windows, ...
0
votes
0answers
31 views

How does find_package(Boost) work with static and shared libraries?

I am currently working on a project that has multiple libraries and multiple executables. Some of the executables will link some of the libraries statically and others will be linked dynamically. My ...
-4
votes
0answers
28 views

Trouble linking static library w/ Android.mk

So I have a static library, libmyproj.a. This library has public methods foo(). I am able to link this static library to a tiny hello.cpp application. The issue I am running into is when I try to ...
0
votes
0answers
35 views

will .a static file, supported only for “armv7 armv7s i386 arm64” platforms, work in my Mac osx project with architecture (x86_64)?

I am using "text to speech", third party library for my Mac osx app. This library have some static library (.a files). I have checked which all architecture it supports using lipo : lipo -info ...
0
votes
2answers
29 views

Easiest way to do runtime md5sum on the .text section of a static library

Brainhive, I'm looking for a way to make sure my code wasn't altered, initial thought was to find the start address of the .text section and the size of it, run md5sum (or other hash) and compare to ...
0
votes
0answers
35 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-...
2
votes
0answers
50 views

Metal file as part of a static library used for a ios project

I'm trying to replace the opengl api in my static library with the Metal api( for ios). I looked into other answers that provides "ways to provide Metal shaders with a static library". So may I know ...
0
votes
0answers
49 views

Issue while linking static library in c

I am learning to use Static libraries in C-language using XCode. I have created a basic math library with header and definition files and compiled it. libmymath.a is generated. I have created a ...
0
votes
0answers
16 views

Linker vs Librarian For Static Library Dependencies

When writing a static library (A) that depends on another static library (B), visual studio offers two options: Integrate the dependent library (B) inside your library (A). This means that when your ...
0
votes
1answer
45 views

Right Way Of Storing Thread ID In A Static Library

I am developing a multi threaded project and need the main thread's id for various reasons. Is this the right execution of doing this: //this is in the static library std::thread::id * FMainThreadID; ...
0
votes
0answers
24 views

Go cmd/link: don't generate runtime for plugin

In follow-up to my recent question "Cannot compile plugin for a shared object" , I found the following abandoned changelist https://go-review.googlesource.com/c/go/+/61090 The programmer seems to ...
0
votes
0answers
40 views

how to hide template definition in header files of a static library

I am building a static library wherein I am making use of generics by using templates. This is a sample template header file of the library to compute average #ifndef AVERAGE_H_ #define AVERAGE_H_ #...
0
votes
1answer
28 views

ld: undefined reference, but it should leave them unresolved

I am unable to produce a library, which works with another library (SDL). I am using MinGW for make, and ld to link. I am confused because a) it shouldn't be trying to link in these libraries, but do ...
0
votes
0answers
58 views

Inheritance in cmake from c++

I have an interface in c++ which is parent of a class. What I want is to make a project with cmake with 2 different CMakelists, one for the interface, and the other one for the class in a subdirectory....
0
votes
0answers
48 views

How to link an interface with static lib with CMake

What I want is a main library, based on an interface (in the future more than one). That interface must be used by other libs, like lib1 and lib2. The idea is to create lib1 and lib2 as static, and ...
1
vote
0answers
67 views

C++ console application is not compiling in Xcode 9.3 on macOS

I am developing a C++ console(Command Line) application on mac using Xcode (9.3). It was compiling and running fine but then I did some code changes and after that it's showing some strange compile ...
-2
votes
1answer
42 views

C++ static library is not compiling in xcode on mac [duplicate]

I am new to stack overflow. I am developing a static c++ library on mac using xcode(9.3). It was compiling and running fine but then i did some code changes and after that its showing some strange ...
0
votes
0answers
25 views

Trying to link static into the shared library - got Undefined reference

My goal is to use api from static library within source of shared library, by using cmake 3.4. Very simple code for static library // Header class Structure { public: int sum( int a, int b ); ...
0
votes
1answer
40 views

Static wrapper for Cuda NPP library

I faced a problem trying to create static wrapper for some of NPP icc functions, to call them from cGo (Golang) environment. I'm able to create and compile (C language) executable, with provided ...
3
votes
0answers
43 views

Cannot compile plugin for a shared object

It looks like my issue is that GoLang includes the runtime in plugins so that they cannot be shared. I did go install -buildmode=shared std And then I try to compile my plugin as shared: go build -...
1
vote
1answer
46 views

sfml static linkage errors in visualStudio 2017

I'm having some issues with game programming for a while now. I wouldn't say I'm new to programming, but linking libraries is a new thing for me. And so this is my issue: when i started programming an ...
0
votes
0answers
33 views

Creating static library with CoreData in iOS

I am trying to create CoreDataKit using a static library. It contains: xcdatamodel or model file NSManagedObject or Entity ( Since static library can have only objects files hence model file can't ...
0
votes
1answer
32 views

Linking libs into a binary in order to make it static on most of linux environment

I am currently searching for a way to make a binary that I just compiled, a portable binary for most of all linux environment. I was considering Ermine but it's not free (looking for a free solution ...
1
vote
1answer
41 views

Delay initialisation of static variables in a 3rd party library

I'm linking against a 3rd party library that uses static variables. These end up getting initialised before main and grab resources prematurely, causing some havoc in my application. Is there any ...
1
vote
1answer
111 views

Compiler Optimizations - Function has no address

I am a C++ developer from some time but I have not used much pointers to member functions. I found already some dangerous scenarios when using such pointers. I need some colleague with more experience ...
-4
votes
1answer
38 views

static linking results in cant open source file

Okay so i pretty much want to use this library https://github.com/stevemk14ebr/PolyHook_2_0 I cloned the Github and as stated changed the CMAKE to STATIC_LINKING so my .lib file gets created instead ...
1
vote
1answer
29 views

Including a static library in CMAKE from a different folder for an Android Project

I am trying to convert my Android NDK cpp projects (ndk-build with Android.mk) to CMAKE in Android Studio. I have a project hierarchy like this: . ├── Module1 │   ├── CMakeLists.txt │   ├── include │ ...
0
votes
1answer
12 views

How to provide version number in library Zip folder

I am devloping a library for web application . There is a option to download to library as a zip folder. What is best way to provide version number in that zip folder. Is it good to provide a readme....
0
votes
1answer
51 views

C++ does linking same static library in multiple file units increase size/bloat?

I'm using the libcurl library in C++, which is a pretty big library (.lib file is about 2MB), the project is compiled with CURL_STATICLIB As for now I only have one .cpp file which includes the ...
0
votes
0answers
21 views

Objects not registered in the factory when the code is compiled as a library but works fine as stand alone

We are trying to transform a code of ours into a library to allow some interfacing with other codes. In the code, we use a lot an object factory relying on the singleton pattern where objects are ...
2
votes
1answer
69 views

ar command does not produce index when combining static libraries

I am trying to follow the answer given here to combine multiple static libraries into a single archive under MinGW64. Specifically, I use CMake and specify the following command: ...
0
votes
1answer
39 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 ...

http://mssss.yulina-kosm.ru