Questions tagged [.a]

A static library of object code in UNIX/Linux that can be used by the link editor to create an executable program.

Static libraries are simply a collection of ordinary object files; conventionally, static libraries end with the .a suffix.

This collection is created using the ar (archiver) program. Static libraries are not used as much as they once were, because of the advantages of shared libraries in certain situations

Still, sometimes they are created, have historically existed and are simpler to explain.

147 questions
551
votes
5 answers

What are .a and .so files?

I'm currently trying to port a C application to AIX and am getting confused. What are .a and .so files and how are they used when building/running an application?
Dunc
  • 7,688
  • 10
  • 31
  • 38
176
votes
6 answers

Linking static libraries to other static libraries

I have a small piece of code that depends on many static libraries (a_1-a_n). I'd like to package up that code in a static library and make it available to other people. My static library, lets call it X, compiles fine. I've created a simple sample…
Jason Sundram
  • 12,225
  • 19
  • 71
  • 86
23
votes
1 answer

Including header file from static library

I am making a test setup of a C static library and program. The library code, located in a subdirectory 'foo' of my project, contains the following files: foo/foo.c: #include void foo(void) { printf("something"); } foo/foo.h: #ifndef…
Ethan McTague
  • 2,236
  • 3
  • 21
  • 53
19
votes
4 answers

How to open a .a file

I've a little problem: I have to open a linker file that has .a extension. I use Dev-C++.
Mgst
  • 193
  • 1
  • 1
  • 4
17
votes
2 answers

Import existing c++ library (.a or .so file) ndk android

I just gone through native development in android. I am successful in getting my AndroidStudio 2.2.2 ready for native debelopment I also build sample hello-jni project What I am trying to achieve I am trying to use an existing library designed in…
karthik kolanji
  • 2,044
  • 5
  • 20
  • 56
13
votes
2 answers

Create podspec to ship static library

I'm trying to ship a static library via cocoapods. I was given the library without any build directions right now its a drop in to my iOS app. I don't need to build the library for each application using it, rather just download the lib files and…
JonMorehouse
  • 1,313
  • 6
  • 14
  • 34
12
votes
2 answers

Is using --start-group and --end-group when linking faster than creating a static library?

If one builds static libraries in one's build scripts and one wants to use those static libraries in linking the final executable, the order one mentions the .a files is important: g++ main.o hw.a gui.a -o executable If gui.a uses something defined…
Johannes Schaub - litb
  • 496,577
  • 130
  • 894
  • 1,212
12
votes
5 answers

`ar` library override timestamp

the .a archive format header requires a timestamp. This has led to countless headaches when I rebuild a static library, mainly because I can't exactly reproduce the original binary. For example (this is on my Mac, but the same thing happens in x64…
Foo Bah
  • 25,660
  • 5
  • 55
  • 79
8
votes
3 answers

in xcode project using .a files with swift erorr 'map' file not found

I'm trying to add an SDK to my Xcode project. The SDK contains .a files and (headers) .h files. The headers are imported to my Bridging-Header file (successfully). In the headers there is an #include When I run the project I get an Erorr…
mos Miler
  • 81
  • 3
6
votes
1 answer

How to import `.a` file to CMake in C++?

I've generated libBox2D.a. Now I want to import it to C++ project, but I don't know how. How I can import my libBox2D.a to my project using CMake?
Szymon Marczak
  • 1,055
  • 1
  • 16
  • 31
6
votes
2 answers

Library (.a file) or framework in iOS, what is a better choice

I have an indecision about converting my project in to lib or to framework in order to use it in another project and hide my code. I've been looking the web for some material about what is better, framework or lib. There are few kinds of frameworks…
Issa
  • 139
  • 4
  • 13
5
votes
1 answer

What's the difference between `*.framework`, `*.dylib` and `*.a` libs

I have a project, in the Framework, there have *.framework, *.dylib, *.a libs. I want to know what's them? and the difference between them.
user7693832
  • 6,119
  • 19
  • 63
  • 114
5
votes
1 answer

Is it possible for using Dlib in android like OpenCV?

Well i need a clear site or information on using Dlib in android. I searched in the net throughout to get a sample application in android using Dlib but still i can't find a one. I am not still sure whether we can use Dlib methods in android for…
Vicky
  • 921
  • 1
  • 11
  • 33
4
votes
0 answers

How to collect data from different .a files into one array? How to keep sections in .a files with ld script?

I need to collect some data from different .a files to one array. I do it by collecting data to one section first .c file TArElement __attribute__((section(".my.special.section"))) uwiveuve = { ... second .c file TArElement…
Anton
  • 41
  • 2
4
votes
1 answer

Hide symbols from a 3rd party .a file that is linked into a .so file

I am building a shared (.so) library that is composed of several .a files and a thin API layer that invokes them. I only want my API and external dependencies to be visible, so I build my code using the "hidden" visibility offered by GCC…
BareMetalCoder
  • 569
  • 5
  • 17
1
2 3
9 10