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.

This tag is for questions about the Unix archiver utility, commonly known as "ar". It is used to maintain groups of files as a single file, known as an archive. Today, it is primarily used to create and maintain static libraries in conjunction with a linker.

For more information on ar, see Wikipedia.

NOTE: Do not use this tag for questions about augmented reality! The tag should be used instead.

181 questions
0
votes
1 answer

ar: crs: no such file or directory

I am trying to install the SCIP optimisation suite version 3.1.0 http://scip.zib.de/download.php?fname=scipoptsuite-3.1.0.tgz The software is compiled by typing the 'make' command in the scipoptsuite-3.1.0 directory. The package contains three…
TBradley
  • 31
  • 1
  • 6
0
votes
2 answers

What's wrong with my code? (Printing File names inside an Archive File)

I'm trying to write a program to open an archive file from Unix, read the files in and print what files are inside the archive and just the filename. Below is my code -- it compiles, but I got some weird output in the terminal -- e.g. ?;?U?. It…
user2203774
  • 609
  • 4
  • 13
  • 25
0
votes
1 answer

Linking to static library consisting of several libraries and object files using a single header file

I'm working on a quite large and messy project that I haven't really got time to clean up and I've been tasked with providing an API for it. What I'm trying to do is wrapping all the ugly stuff up in a single static library and then provide it with…
0
votes
1 answer

How can I compile a library archive with a source code file with gcc?

TL;DR - I need to compile archive.a with test.o to make an executable. Background - I am trying to call a function in a separate library from a software package I am modifying but the function (a string parser) is creating a segmentation violation.…
William Everett
  • 751
  • 1
  • 8
  • 18
0
votes
1 answer

Archiving Two .a files

I have a C++ project that can be compiled with -D UNICODE. When I compile it without that Define, it creates a bunch of object files which I then add to a .a archive file using the command: ar.exe rcs Cpplib.a *.o Then I compile it with that define…
Brandon
  • 22,723
  • 11
  • 93
  • 186
0
votes
1 answer

Difference between using LIB and ar under cygwin

Under cygwin, with libtool I am trying to link a static library. the --mode=link cl.exe line invokes ar cru on the .obj files to create the .lib. However, I know there's another program under windows, LIB. As far as I understand, it's equivalent to…
Stefano Borini
  • 138,652
  • 96
  • 297
  • 431
0
votes
1 answer

memory leak in a formatting string, correct null termination

I think I have an issue with terminating my strings, because I'm having trouble displaying them. I'm trying to recreate the unix ar command in C and I almost have -v laid out, but now that I've got permissions in there, I can't seem to get them…
hobbes131
  • 313
  • 6
  • 14
0
votes
1 answer

Compiling on Beagleboard - Fail on AR

I am Compiling on a Beagleboard-Xm, Kernel: root@beagleboard:~# uname -a Linux beagleboard 2.6.32 #3 PREEMPT Tue Jul 26 10:56:56 CEST 2011 armv7l unknown I now try to compile a static library with CMake, and everything is working fine, until it…
EGOrecords
  • 1,959
  • 2
  • 19
  • 33
0
votes
1 answer

Memory overlapping with ld and ar commands

I have linked some texts files with this command: ld -r -b binary -o resources1.o *.txt And I get a file resources.o with this content: nm resources1.o 00000018 D _binary_texto4_txt_end 00000018 A _binary_texto4_txt_size 00000000 D…
Cesar Ortiz
  • 884
  • 1
  • 8
  • 25
0
votes
1 answer

archive of archive files

Possible Duplicate: How to merge two “ar” static libraries into one I have multiple archive file as below folder1/libfolder1.a folder2/libfolder2.a folder3/libfolder3.a all these library have bunch of obj files. I want to create one single…
0
votes
1 answer

Is it possible to mix different versions of gcc and ld?

My environment is arm-linux-androideabi (Android 2.2 on a Toshiba AC100). I have 2 sets of GCC compilers for my environment(installed at separate locations on the device): 4.4.3 (Android NDK on Android) 4.6.0 (R + GCC on Android) The problem I…
Samveen
  • 3,482
  • 35
  • 52
-1
votes
0 answers

Script not producing correct output when run from cron

I have no idea what is happening here ?? I have a script which give the status of db down or up .if i run in normal terminal like command prompt its wrking but in crons only print and send mailx msg.please help me i am struggling since long.Somebody…
Raj
  • 1
  • 2
-1
votes
1 answer

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 after this settings: set (CMAKE_AR…
ilw
  • 2,499
  • 5
  • 30
  • 54
-1
votes
1 answer

Why does the linker complain “file was built for archive which is not the architecture being linked” when the architecture is correct?

When trying to build a binary (see MWE below) that links a static library using clang I am getting the following error message: ⟩⟩⟩ clang -o test bar.a test.o ld: warning: ignoring file bar.a, file was built for archive which is not the architecture…
Konrad Rudolph
  • 530,221
  • 131
  • 937
  • 1,214
-2
votes
1 answer

How to limit the visibility of an exported symbol?

I'm compiling and archiving a library (call it libbar.a). The key translation units in that library use a function void foo() defined (non-statically) in a foo.cpp which also gets compiled and put in the library. I want to avoid this void foo()…
einpoklum
  • 118,144
  • 57
  • 340
  • 684
1 2 3
12
13