Tag Info

Hot answers tagged

17

A .a file is a static library, while a .so file is a shared object (dynamic) library similar to a DLL on Windows. There's some detailed information about the differences between the two on this page.


17

NOTE: I'm going to assume that your machine has a memory mapping unit (MMU). There is a Linux version (µClinux) that doesn't require an MMU, and this answer doesn't apply there. What is an MMU? It's hardware—part of the processor and/or memory controller. Understanding shared library linking doesn't require you to understand exactly how an MMU works, just ...


15

As a follow on, a .a file is an "ar" archive. Not unlike a tar archive, it stores .o or object files, allowing them to be pulled out of the archive, and linked into a program, among other things. You could use ar to store other files if you wanted. You can get a listing of the members of an ar file with the -t parameter, for instance: ar -t /usr/lib/libc.a ...


13

Non-executable shared objects work fine, but libraries marked executable may also be runnable as standalone programs. So, what's the point of setting this x? None, unless you want them to emit version or other info Must all library packagers do that? No What will happen if I dlopen() a shared library that has 0644 permissions? You'll get ...


12

It's GCC's runtime library, which contains some low-level functions that GCC emits calls to (like long long division on 32-bit CPUs).


12

Conceptually, a library function is part of your process. At run-time, your executable code and the code of any libraries (such as libc.so) it depends on, get linked into a single process. So, when you call a function in such a library, it executes as part of your process, with the same resources and privileges. It's conceptually the same as calling a ...


10

In the latest versions of gcc compiler require that libraries follow the object or source files. So to compile this it should be: gcc pthread_sample.c -lpthread Normally though pthread code is compiled this way: gcc -pthread pthread_sample.c


9

Boost is a mostly header-only library, so there is no library to link with (most of the time). As for the headers, Ubuntu place them in /usr/include/, which is one of the include paths GCC use by default. So any #include <boost/foreach.hpp> will work out of the box on Ubuntu.


8

ltrace -- A library call tracer. It only works on Linux and in a small subset of architectures. Calls to dlopen()ed libraries will not be traced. Further pointers from man page and /etc/ltrace.conf


8

Debian and Ubuntu are moving to a new multiarch implementation (spec). Among other things, this involves moving arch-specific libraries into /usr/lib/<triplet>, dropping the limitations of lib32 and lib64 (where will the new x32 ABI go? where do qemulated binaries live? etc.) as well as extending the package manager to handle mixed-architecture ...


8

You don't need to. Add the directory to /etc/ld.so.conf or a new file in /etc/ld.so.conf.d/, depending on distro. After that, you must run (at least on Redhat) ldconfig as root. As a word of caution, you need to be careful which libraries you add to the system shared library path (via the environment, ld.so.conf, or putting in /usr/local/lib). In ...


8

Ah yes this is a very confusing part if you've dealt with Unixes for any length of time. There is a standard that most Unixes "try" to follow called FHS - Filesystem Hierarchy Standard. Given I primarily use Red Hat based distros I'm most familiar with their take on FHS for Fedora, CentOS, and RHEL Linux distros. But I've used Debian & BSD based distros ...


7

There's not really such a thing as a "library call". You can call a function that's linked to a shared library. And that just means that the library path is looked up at runtime to determine the location of the function to call. System calls are low level kernel calls handled by the kernel.


7

Since the source code for this wkhtmltoimage tool is available, I'd suggest you recompile it from source with your system's native glibc. It will likely be even quicker than recompiling glibc, which is no easy task. A statically linked executable already includes code for all the C library calls it needs to make, so you cannot separately compile a new ...


7

I did this quite frequently in my last job - the solution that seemed to work best was to create a ~/usr directory, and use the --prefix argument to point the ./configure scripts in the right direction. Here's the steps: Create ~/usr directory, and include, lib and bin directories underneath it. In your .profile, .bashrc, or other shell init script, add ...


7

Under HP-UX, shared libraries are mapped into memory using mmap(), and all memory pages in the system have protection bits which are coupled with the kernel and processor hardware's memory page protection mechanisms. In order to execute the contents of any page of memory on the system, that page must have PROT_EXEC set - a useful feature to prevent data ...


7

You don't have to copy anything anywhere. You should add the atlas libraries to the list of locations ld will search. In directory /etc/ld.so.conf.d you can add the file atlas-lib.conf. This file should contain the directory of libatlas.so.3gf, which is /usr/lib/atlas-base. You can do this by running echo "/usr/lib/atlas-base" | sudo tee ...


7

You have not said which OS you are using so I am going to assume Linux and will use Debian as an example. The quick answer to your question is no as far as I know. This might be a useful workaround though: ldd your_prog | awk '{print $1}' | sed 's/\..*//' | while read n; do echo "----- $n ----"; apt-cache search ^$n; done This will parse the ldd output ...


6

You need to install the libX11 package: $ rpm -qf /usr/lib/libX11.so.6 libX11-1.3.1-3.fc13.i686 Just go $ yum -y install libX11 One more thing though: if you don't know how to find and install a library package, care to share why you are trying to compile a piece of software that is officially packaged for Fedora 13 in the most recent version? $ ...


6

As msw says, it appears that your application wants to use the OpenWindows and Xview libraries that were provided in older Sun systems. I believe they're not even around on newer Solaris installs anymore, but the free software projects OpenWindows Augmented Compatibility Environment and The XView Toolkit may provide compatible-enough implementations of ...


6

The version info in not explicitly stored in an ELF file. What you have in there is the name of the library, the soname, which includes the major version. The full version is usually stored as a part of the library file name. If you have library, say libtest.so, then you usually have: libtest.so.1.0.1 - The library file itself, containing the full version ...


6

There should be a package called liblo-dev on Debian that should provide this header.


6

If you've already run ldconfig after building the library, keep reading. If not, read aboout ldconfig first. /usr/local/lib might not be in the library path that ldconfig uses. You can just do this: ldconfig /usr/local/lib And the stuff should be added to the linker cache, but it is probably better to add the path properly. Make sure you have a ...


6

The error here was due to not having enough RAM on the VirtualMachine. Running strace ./programname indicated that the program was being killed just as it started running, before loading any of the libraries. Increasing the amount of RAM available ensured that the program could work. Useful responses There were some useful responses from others namely @slm ...


6

It sounds like you're looking for Audacity which is a cross-platform open source audio editor. One of its features is to allow you to generate tones. It's a multi-track audio editor, so you can easily create a stereo tone. Under the Generate menu, you're able to create Sine, Sawtooth, and Square waveform tones of arbitrary frequency, amplitude, and length ...


6

You can do this with ldd command: NAME ldd - print shared library dependencies SYNOPSIS ldd [OPTION]... FILE... DESCRIPTION ldd prints the shared libraries required by each program or shared library specified on the command line. .... Example: $ ldd /bin/ls linux-vdso.so.1 => (0x00007fff87ffe000) ...


5

The main goals of EGLIBC (described http://www.eglibc.org/mission) are all targeting embedded platforms: Provide options to reduce on-disk and in-memory footprint: As long as you want to keep binary compatibility to glibc these options are useless or have nearly no effect on x86-64. Support cross-compilation and cross-validation: Well... Who does ...


5

If you type man man in your shell, you will see the list of the manual sections 2 System calls (functions provided by the kernel) 3 Library calls (functions within program libraries) For instance, you will find chmod in the section 2 of the manual when typing man chmod. And fprintf in the section 3.


5

No, it doesn't. It appears to mean that the version of libz you linked against when you compiled your program was built with different tools than the version on the madriva system you're using. The mandriva copy is missing symbol version info which was present in the copy of the libz library your program originally linked against. This has to do with ...


5

You can call ldd on it to see if -fopenmp was used: $ cat x.c int foo() { return 0 ; } $ gcc -shared -fopenmp x.c -o x.so $ ldd x.so linux-vdso.so.1 => (0x00007fff293d6000) libgomp.so.1 => /usr/lib/libgomp.so.1 (0x00007fa942998000) libpthread.so.0 => /lib/libpthread.so.0 (0x00007fa94277b000) libc.so.6 => /lib/libc.so.6 ...



Only top voted, non community-wiki answers of a minimum length are eligible