Skip to main content

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.

static-libraries
0 votes
1 answer
213 views

Errors when statically linking libsndfile with vcpkg and running sf_open

So here's a bit of example code: #include<sndfile.h> int main() { SNDFILE* sndfile; SF_INFO sfinfo; sndfile = sf_open("", SFM_READ, &sfinfo); std::cout << "...
1 vote
1 answer
1k views

Tell cmake to build static version of the library

Let's consider CuteLogger CMakeLists.txt, it contains ADD_LIBRARY(${library_target} SHARED ${sources} ${includes}) which instructs cmake to build the shared version (.dylib on macOS). I know I can ...
0 votes
1 answer
529 views

.lib and .dll file size difference on visual studio and cmake

I followed https://learn.microsoft.com/en-us/cpp/build/walkthrough-creating-and-using-a-dynamic-link-library-cpp?view=msvc-170 to create the dll in debug mode and did the same using cmake. ...
2 votes
3 answers
149 views

What is the need for a library in C++?

Header files contain only the declaration of the function and the actual implementation of the function is in the library. If they don't want to share source code they can share the obj file. Why do ...
6 votes
1 answer
7k views

What does 'target_link_libraries' do when the target is a static library and the target link is a static library too?

From the following example: CMakeList.txt file: include_directories(inc) # Grab all the cpp and h files to be compile. file(GLOB SOURCES inc/*.h inc/*.hpp src/*.cpp ) add_library(...
1 vote
1 answer
143 views

Are macOS libraries for Apple Silicon any different?

A library can be static or dynamic. Respectively, on macOS it can be a .a or a .dylib file, as far as I know. Let's say I'm going to use it for both, the old (non silicon) apple computers (i.e. those ...
0 votes
1 answer
2k views

Link all C++ lib dependencies into a dll

So I'm trying to compile a VS project into a dll but I can't seem to get all the .lib dependencies to be included with the dll.
0 votes
1 answer
123 views

How to specify the DLL file that I want my LIB to be linked to? - Visual Studio 2019

I have different versions of the same DLL file and I want to make sure it's linked to the latest version. But inside the LIB file there's only specified the "FileName.dll" which I guess it's ...
0 votes
1 answer
60 views

Custom Static Library (.a lib) not found when building MakeFile for C++ Linux project

I have a custom library I made called AceLibraryLinux and I'm trying to use it in a C++ Linux program I made called RumPi (Raspberry Pi application I'm making). The .a file is called "...
0 votes
0 answers
16 views

grpc c++ - Shared library vs static library

I tried to build grpc c++ in two ways. One with -DBUILD_SHARED_LIBS=ON and one without it. When it is off, I get in the lib/ directory, for example: 360M libgrpc.a (Any many other libraries) When it ...
0 votes
1 answer
218 views

C++ utility::conversions is not working in Static Linked Library

I have a c++ MFC application. Everything was working for me until I excluded some of the headers i used and set them inside a separated static linked library project. Now, everything compiles fine, ...
0 votes
1 answer
969 views

How to add 2 different C libraries with same name but having entirely different functionalities without changing the name?

How to add 2 different C libraries with same name but having entirely different functionalities without changing the name? For example one s/w product comes with lib named libabc.so And my lib is ...
0 votes
2 answers
2k views

I have .lib and .dll files, but not .h - how to use methods from those libraries in other C++ project?

I need to import into my Visual Studio 2019 C++ project (call this A) methods from another very, very big project (call this B). Actually I have a .sol file for this B project and could succesfully ...
0 votes
1 answer
453 views

Library's CMake generates DLL. Application's CMake wants LIB

My library has minimal, straightforward CMake code with the pertinent lines add_library(MyLib <sources>) install( TARGETS MyLib LIBRARY DESTINATION ${destination}/lib RUNTIME ...
0 votes
1 answer
245 views

visual studio and linking to pre-compilied binaries (lib / dll)

Some libraries are available to download as pre-compiled binaries, usually in specific architecture (x32 or x64) but I have also noticed that some pre-compiled binaries are splitted based on visual ...

15 30 50 per page
1
2 3 4 5
305