All Questions
Tagged with unix-ar static-libraries
55
questions
0
votes
0
answers
184
views
Codelite C++ build suddenly not working. ar can't find GL
I've been writing a mediocre game engine using SFML and OpenGL. Up until recently it has been building without difficulties, except for my own typos, bad code, etc. I'm building it as a static library,...
0
votes
1
answer
280
views
Converting .o file into static library in linux and make it usable in terminal
I want to create a simple library and after compilation and ar command I can get resulting .a file.
Now I want to add this file as a static library and use it in terminal, I dont know if its possible....
0
votes
0
answers
65
views
Static library with MinGW doesn't update correctly when building executables
I made a little makefile to build a static library made of several object files. Then I made a test program test.exe and I built it with the same makefile.
Executable is made of test.c and the static ...
5
votes
1
answer
7k
views
Archive has no index; run ranlib to add one (when linking with a .a containing a MachO64 object file on Linux)
I tried to create a library and test it, but an error occurred.
error code:
./libasm.a: error adding symbols: Archive has no index; run ranlib to add one
collect2: error: ld returned 1 exit status
I ...
1
vote
2
answers
248
views
How do I partially-expose object contents in an object library?
I'm compiling some C++ code into a library. Suppose my source files are mylib.cpp and util.cpp. The code in util.cpp is used in the library implementation, but is not part of the library in the sense ...
0
votes
1
answer
81
views
How to handle lib dependency while compiling?
Let's say that I have two static libraries : libA and libB and that libB uses libA.
For each library libX let's say that hX is libX's headers's directory and dX is libX's file's directory.
Now what ...
0
votes
0
answers
32
views
How to merge libraries in linux [duplicate]
Recently I wanted to build a game engine using C++ and glfw3.
I want to create a static library libengine.a and link it with libglfw3.a
and its dependencies.
My question is how can I replace this:
# ...
1
vote
1
answer
2k
views
How to force static library to include it dependencies?
I build my own static library with gcc and ar like this.
g++ \
... list of library sources ... \
... a lot of -L -l -I -D options etc... \
-c \
&& ar crf ./lib/libpackager.a *....
1
vote
0
answers
289
views
Link OpenSSL FIPS compliant (libcrypto.a) with another static library
I am using OpenSSL 1.0.2t with FIPS Object Module 2.0.16. I have taken the source code and complied both and I have libcrypto.a and libssl.a generated.
In my use case I need libcrypto.a. I have a ...
1
vote
2
answers
619
views
How to remove path to C files and other meta data from static library
I am making a static library from bunch multiple objects placed across directories.
When I run strings on the finally created static library I find that the names of the C files used to create the ...
4
votes
1
answer
1k
views
What does it mean to 'add an index to an archive file'?
My C textbook creates an archive using the -s command line option which adds an index to the following archive file.
ar -rcs libfile.a file1.o file2.o
However, I don't understand what an index is ...
3
votes
1
answer
560
views
How to combine multiple static libraries when the library name contains a space?
I am working on various flavors of Linux and I need to combine multiple static libraries such as
foo1.a
foo bar.a
foo2.a
into one single combo static library (note that the second file has a space ...
2
votes
0
answers
99
views
C++: ar -x loss symbols
I am not sure if I have some misunderstanding on ar -x command, here's how to repeat the problem:
Step 1. make sure there are symbols are there:
$ nm librocksdb.a | c++filt | grep -s 'rocksdb::...
3
votes
1
answer
1k
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
1
answer
2k
views
How to split large .a static library?
Is there a possibility to split large .a files into multiple smaller ones?
I'm currently having an issue with a .a file being multiple GiB large and GCC raises an error even with the flag -mcmodel=...