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
4
votes
1 answer

Attempting to compile with my own static C library

I compiled a static library. I have two files. mylib_1.c with function foo1 in it mylib_2.c with function foo2 in it. Both #include "mylib.h". I compiled a library like so: gcc -c mylib_1.c -o mylib_1.o gcc -c mylib_2.c -o mylib_2.o ar cr mylib.a…
DEADBEEF
  • 525
  • 1
  • 5
  • 19
4
votes
1 answer

How to use C static library (.a file) in PHP

In one of our project we are specifically and compulsorily required to create C++ static libraries (.a files) , and then use them in PHP (web Application). We are successfully able to create .a files, now wondering if anyone can help us in…
NKS
  • 1,140
  • 4
  • 17
  • 35
3
votes
2 answers

How do I call unmanaged functions in C from Unity3d if I don't have a .bundle? (Mac)

I am on Mac. I have a bunch of C source code (.c and .h). I have a static library (.a). I want to use that .a library from within Unity. I looked into Unity's documentation for plug-ins (http://unity3d.com/support/documentation/Manual/Plugins.html),…
CherryQu
  • 3,343
  • 9
  • 40
  • 65
3
votes
2 answers

How to build .lib files using Code::Blocks IDE

I have a C project which I would like to build as a static library and not as a executable. My high level environment is: IDE: Code::Blocks 16.01 Operating System: Windows 7 Compiler: MinGW (GCC port for Windows) As a build target option, I…
Dean P
  • 1,841
  • 23
  • 23
3
votes
0 answers

Can I compile an iOS static library from Windows/Linux

I have C++ code, which I have managed to compile into an iOS static library ("library.a") using Xcode. I am then including this in my project (Xamarin.iOS, though this shouldn't matter) and have managed to get it working as expected. The code is…
Rufus Mall
  • 569
  • 4
  • 14
3
votes
1 answer

Compiling a c application that links to a static library on AIX

I'm trying to compile my application to link to a static library (.a file) The command I use to build is this: gcc -DUNIX -maix32 -o Release/bin/testApp Release/obj/main.o -ltestLib When I build I get the following errors: ld: 0711-317 ERROR:…
Dunc
  • 7,688
  • 10
  • 31
  • 38
2
votes
2 answers

Rcpp: Install package with static libraries for platform independent usage

I want to use the libDAI C++ library within an R-package and want the package: to be usable on Linux and Windows save disc space (the external library has ~60 Mb) the end user does not need to install boost and gmp for compilation My current setup…
happ
  • 100
  • 10
2
votes
1 answer

Static library gives strange errors on Xcode

I made a static library(.a) following the instructions of Ray Wenderlich, compiled it without errors and warnings, and then I included it on a new project. When I tried to build the new project, I got this…
Kurr0
  • 197
  • 1
  • 10
2
votes
1 answer

Java - I've got a library(.a/.so) and header(.h), how to use Java call their functions?

Someone sent me his static library(lib.a) and a header file(lib.h) it should be written in C++, I've used gcc compiler to convert the static library(lib.a) into a shared library(.so). Now I want to use Java to call library to use it's functions. I…
Confucius
  • 419
  • 3
  • 7
  • 14
2
votes
2 answers

libraries with both .a and .so - how can I force .a to be used?

I am writing a program using Qt Creator, on Linux. It uses a library, for which I have both the .so and the .a equivalents in the /usr/lib directory, for example: /usr/lib/libuseme.a /usr/lib/libuseme.so From what I understand, if I link to the…
2
votes
1 answer

Using a static MSVC 2010 libary (.lib) with MinGW?

Since a few WIN32 related things didn't quite work using MinGW, I decided to create a small static library with MSVC 2010 and link it with MinGW afterwards. However, I am currently looking for a tool that allows me to convert static MSVC…
Byzantian
  • 3,208
  • 4
  • 27
  • 31
1
vote
1 answer

Use Module which is in a statically-linked object (Fortran)

Dear stackoverflow experts, I want to create (with FORTRAN) a shared object file, lets say myso.so. In this .so I have one module file, modso.f, and one 'subroutine file', subso.f. I also have a statically-linked object (in FORTRAN again), lets say…
helios21
  • 135
  • 1
  • 9
1
vote
0 answers

go build ld: warning: ignoring file xxx/libmd5tool.a, building for macOS-x86_64 but attempting to link with file built for unknown-unsupported file f

macos monterey12.6 Trying to go build project ld: warning: ignoring file /Users/xxx/Documents/go-repo/src/scbapi/vendor/apiutil/lib/libmd5tool.a, building for macOS-x86_64 but attempting to link with file built for unknown-unsupported file format (…
RanCood
  • 11
  • 1
1
vote
0 answers

How can I add/import chibios library for embedded project in visual studio?

I want to use ch.h file from chibios in my project. The embedded project is created and is using HAL drivers for stm32. I want to find a way to add or import chibios library to the current project. My question is that how can I add these embedded…
Mary
  • 71
  • 1
  • 7
1
vote
0 answers

Do .a library files work in both Windows and Linux?

I have been given a .a library file for my project. I can see you can use .a for Windows and Linux, which is different to .dll and .so. Will the same .a file work on both Windows and Linux?
1
2
3
9 10