Questions tagged [unix-ar]
The Unix archiver utility, used primarily for maintaining static libraries. For questions about augmented reality, use [augmented-reality], not this tag.
unix-ar
180
questions
1
vote
1
answer
249
views
Combining two static libraries into one dynamic library whilst avoiding multiple definitions
Note: This is not a duplicate question, because no other answer considers multiple definition challenges.
I am trying to combine two static libraries into one. (This works).
Then convert that static ...
1
vote
1
answer
983
views
'illegal option -- U' when running the ar command from a Makefile compiling C code
I am running macOS X Catalina and trying to run the 'Make' file, but it tells me the following:
(base) charliesharpe@MacBook-Pro alterbbn_v2.2 % make
AlterBBN v2.2 - A. Arbey, J. Auffinger, K. ...
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
279
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....
3
votes
1
answer
340
views
hit roadblock while trying to compile lua for emscripten usage, using windows, "unable to find ar rcu"
i've been stuck on this problem for hours, without finding any solutions. I'm currently trying to compile lua 5.3.4 for Emscripten for use in my project. ive hit a roadblock thought, I need to compile ...
0
votes
1
answer
954
views
How to update shared library file
I'm trying to add a .lo object file compiled through libtool with clang into a shared library file.
$ libtool --tag=CC --mode=compile clang -c newobject.c -shared
Is there an equivalent command to
$...
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 ...
0
votes
1
answer
2k
views
How set CMAKE_STATIC_LINKER_FLAGS immediately after the executable file? [tcc -ar]
How set CMAKE_STATIC_LINKER_FLAGS in CMakeLists.txt immediately after the executable file?
for example:
I need:
tcc.exe-arqc staticRun.lib CMakeFiles/staticRun.dir/utils/system.c.obj
but cmake ...
0
votes
1
answer
725
views
problem with ar, linking and undefined reference
I have a software package consisting of some 500+ fortran .f files. It is rather well organized into various subfolders, and there is one high level compile script which calls the various Makefile's ...
3
votes
1
answer
267
views
GNU Make: Using the wildcard function with implicit rules
I have a project structure that looks something like this:
.
└── src
├── Module1
│ ├── source1.cc
│ ├── source2.cc
│ └── source3.cc
├── Module2
│ ├── source1.cc
│ ...
0
votes
0
answers
26
views
Makefile runs an unspecified command [duplicate]
I have a makefile that compiles C source files into corresponding object files and then archives those object files. This is what the makefile looks like:-
.PHONY = all clean fclean re
SRC = ./src/
...
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 ...
1
vote
1
answer
760
views
Combine static libraries in a Makefile using ar [duplicate]
I have a bunch of static libraries and I need to combine into a single file using ar in Makefile.
For example,
ar -M <<EOM
CREATE app.a
ADDLIB lib1.a
ADDLIB lib2.a
ADDLIB lib3.a
....
....
....
...