Questions tagged [static-linking]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
1 vote
1 answer
75 views

create an statically linked executable from a dynamically linked executable and its dependencies

Take cat as an example, if I do ldd $(which cat), it shows linux-vdso.so.1 (0x00007fff8afbb000) libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007fb3102dd000) /lib64/ld-linux-x86-64.so.2 (...
user avatar
  • 291
1 vote
0 answers
177 views

How to write a file PkgConfig.pc file that supports both static and shared linking

I am writing a little library as a self challenge. I plan to target Linux based systems. I want to add a libname.pc file so as to add support for PkgConfig. Here, is my current file: prefix=/usr/local ...
user avatar
1 vote
1 answer
744 views

How to compile a program statically on NixOS?

I'm trying to compile a simple program into a static executable: $ cat hello.c #include <stdio.h> int main() { puts("Hello, world!"); } However, I'm met with the following error: $...
user avatar
0 votes
0 answers
114 views

How to debug a cpp file that's part of a so file in the software?

So I have this software which has multiple .so files. For one of the so file and I made some changes to the code but I want to see the line by line execution of file present in the so file. Just to ...
user avatar
0 votes
1 answer
304 views

why static libraries use relocatable object files while share libraries use source file?

I was reading a textbook which describes static libraries anad shared libraries. There are two source files, addvec.c and multvec.c, to create a static library of them, we would use the ar tool as ...
user avatar
  • 159
3 votes
1 answer
814 views

Build a standalone bash

I would like to build standalone bash binaries, which would hopefully work on a good portion of the linux distributions out there. Complete coverage is definitely not a goal. How would I approach this?...
user avatar
  • 41
1 vote
1 answer
2k views

Where are static libraries used by gcc or g++ stored, and how are they identified?

I've been trying to determine if my Ubuntu (linux) system has -static libraries. When would they be located, and what suffix would identify them?
user avatar
  • 139
0 votes
1 answer
285 views

Installing gtkmm from source

I know that gtkmm can be installed using package manager, but here I am keen to install it from source. It requires me to install the Dependencies: libsigc++ 2.0 GTK+ 3.0 glibmm cairomm pangomm ...
user avatar
  • 1,362
0 votes
1 answer
471 views

Check which library compiled in linux

I want to compile a C file with gcc, to embedded arm that is running Gnu/Linux . How can I known which function/header files that I need to compile statically, and which dynamically?(I don't want to ...
user avatar
1 vote
1 answer
747 views

How to build instance of Emacs to run on an x86_64 system different from the one it was built on?

I want to build the latest version of Emacs (from git.sv.gnu.org) for a CentOS system, but the building must be done on a Debian system1. Both systems run on x86_64 architectures. I've seen ...
user avatar
  • 12.7k
2 votes
1 answer
4k views

Apache + mod_ssl build not linking to my OpenSSL build

I have spent some time searching online but none of what I found seems to help. I'm running CentOS 6 64bit and would like to compile Apache with mod_ssl and need to link it to my own OpenSSL build (...
user avatar
  • 43
1 vote
0 answers
106 views

statically link a libtiff tool

I downloaded the latest version of libtiff, made some modifications, and now want to produce a statically-linked version of one of the components, tiffset. I disabled most of the unneeded libraries ...
user avatar
  • 3,530
2 votes
1 answer
958 views

Error during static build of libvorbis and libmp3lame

I'm having trouble trying to build a static binary of ffmpeg - I've got almost the whole build working, with the exception of two libs - libvorbis and libmp3lame. These two libs are failing during ./...
user avatar
1 vote
1 answer
11k views

Static linking .so into my executable

I have a .cpp code I wrote, which is written around a commercial software program where they provide a big c++ library class to use. I want to static link their one shared object libtdfdll.so into my ...
user avatar
  • 4,111
1 vote
1 answer
2k views

Building "cross linux system" programs, with different libc/musl interpreter

My goal is simple: I would like to create a program that bootstraps the nix package manager on any architecture, as a non-root user, with as few depends as possible. For now, what I did is the ...
user avatar
  • 2,116
1 vote
0 answers
60 views

list the link files of a process [duplicate]

Saying that there is a running process named a. Is it possible to list all of the lib files that a needs, including static link files and dynamic link files (.a, .so)?
user avatar
  • 2,809
18 votes
1 answer
3k views

What is bash-static used for?

What is the purpose of bash-static compared to regular bash? Is it good as a rescue shell or what is it good for?
user avatar
1 vote
3 answers
447 views

Installed 2 libraries side to side and need both. What solution to avoid linking problems?

I installed two versions of openCV one is openCV3 and another one openCV2.4 on my ubuntu 16.04 machine and need both. However I am now unable to compile C++ code which is intended for openCV3. I get ...
user avatar
0 votes
1 answer
796 views

Unable to login through putty in Centos but able to ping to the VM

I was able to login through putty until I changed the VM configuration to static ipaddress and restarted the network and rebooted the VM I see the sshd service is running as well. I am able to ping ...
user avatar
3 votes
0 answers
472 views

Opening a TUN device from QEmu x86 for ARMv7 fails

On Banana PI-R1 (ARMv7), with qemu-i386-static, I'm trying to execute Barracuda VPN client statically linked for x86. Following this topic works : Running X86 binaries on armv7 But, when the VPN tries ...
user avatar
  • 41
0 votes
1 answer
8k views

Public static IP only for a Vagrantfile

I modified the Vagrantfile for taiga-vagrant based on VAGRANT DOCS/Public Networks as follows: # -*- mode: ruby -*- # vi: set ft=ruby : require "./source.rb" ROOT_PATH = File.dirname(__FILE__) ...
user avatar
1 vote
1 answer
3k views

Static compilation of wget

I downloaded the source code of wget and tried a static compilation. These are the steps that I followed : ./configure LDFLAGS=-static At the end the output shown is as follows : Version: ...
user avatar
0 votes
1 answer
12k views

Building binary with static objects included

Is it possible to build a binary with dependent .so files included so that the binary can be built once and used on machines with the same hardware and OS, without them having the .so files? For ...
user avatar
  • 228
2 votes
1 answer
934 views

Types of dynamic linking in Unix/Linux environments

When creating a windows static library, we simply create a .lib file which should be included in the linker path. When creating a windows shared library, along with the .dll, we also a generate a ....
user avatar
1 vote
1 answer
1k views

Getting segmentation faults from inside glib and gobject - I THINK I want to build/statically link against an independant version of glib2

I don't yet fully understand how segfaults and backtraces work, but I get the impression that if the function at the top of the list references "glib" or "gobject", you have Bad Issues(TM) with ...
user avatar
  • 889
2 votes
1 answer
14k views

Linking a static library when compiling a C program

I'm linking *.a file with *.c file, so I have used the following command: gcc abc.c -l ad.a (here abc is the C source file and ad is the static library file) then after executing the following ...
user avatar
0 votes
4 answers
2k views

Compiling C/C++ code by way of including preprocessor build instructions in an actual C/C++ source file

I've got reasons for not wanting to rely on a specific build system. I don't mean to dis anybody's favorite, but I really just want to stick to what comes with the compiler. In this case, GCC. ...
user avatar
2 votes
2 answers
2k views

how to add curlcpp to the library/include path?

I'm using Arch Linux and have successfully built https://github.com/JosephP91/curlcpp However, I have no idea how to build the example program. I keep getting fatal error: curl_easy.h: No such file ...
user avatar
  • 203
7 votes
1 answer
1k views

Effect of static and dynamic linking on start address

I have a simple C program. I run: $ gcc Q1.c -Wall -save-temps -o Q1 Then I inspect the executable generated: $ objdump -f Q1 Q1: file format elf32-i386 architecture: i386, flags 0x00000112: ...
user avatar
2 votes
1 answer
259 views

How to link different (incompatible) libraries at runtime depending on program?

I have a number of legacy codes that need to be compiled with specific (and often conflicting) libraries. To be specific I have a program which can only be compiled with g77 and another program which ...
user avatar
5 votes
1 answer
8k views

Why can't ld find this library?

I'm not very knowledgeable on this topic, and therefore can't figure out why the following command does not work: $ gfortran -o dsimpletest -O dsimpletest.o ../lib/libdmumps.a \ ../lib/...
user avatar
  • 8,251
2 votes
1 answer
3k views

Linker errors when compiling against glib...?

I'm having trouble compiling a simple, sample program against glib on Ubunutu. I get these errors. I can get it to compile but not link with the -c flag. Which I believe means I have the glib ...
user avatar
  • 2,419
8 votes
2 answers
12k views

How can I get a static C compiler?

I'm playing around with chroot environments, and I'd like to have a portable C compiler so that I can easily set up some basic build-tools in each environment without having to move too many libraries ...
user avatar
  • 2,515
2 votes
1 answer
866 views

How does prelink work

I was wondering how prelinking works. If I prelink my whole system and than delete glibc, will the system 'get up' after restart?
user avatar
16 votes
3 answers
15k views

Creating Static Binary

I installed an application [ e.g. fdisk ]. But it required libraries for execution. I am looking for utility/tool which will help me to create a static binary from already installed binaries. So that ...
user avatar
  • 13.5k
3 votes
2 answers
1k views

Linux static compilation issue

I am building testdisk as static and run make static it returns the following error /usr/bin/ld: cannot find -luuid collect2: ld returned 1 exit status What's the problem? In the makefile I have ...
user avatar
  • 137