static-linking

Error linking SSL and crypto libraries installed in custom location

删除回忆录丶 提交于 2019-12-13 03:10:15
问题 I am trying to create a shared library that is to be linked against OpenSSL-1.0.2p which depends on libssl1.0 . The installed version of OpenSSL on my ubuntu bionic machine is however OpenSSL-1.1.1 which internally uses libssl1.1 . Since I do not wish to install OpenSSL-1.0 system-wide, I downloaded and compiled it separately installing it into a folder inside my home directory. I wish to use this location against which I would want my shared library to link. Here is the Makefile for the

Undefined reference when linking with Boost using g++-4.9 on a g++-5-ish distribution

北城余情 提交于 2019-12-13 02:15:21
问题 I've written the following groundbreaking application: #include <boost/program_options.hpp> int main(int argc, char** argv) { boost::program_options::options_description generic_options("foo"); return 0; } I am trying to build this on Debian Stretch, on which the default compiler is GCC 5.3.1-5, and the installed version of Boost is 1.58.0. However, for reasons which I will not go into here (which would be apparent had this not been a MCVE), I need to compile and link the binary using g++-4.9

How to create a single native shared library with no dependency for Android using Qt Creator

无人久伴 提交于 2019-12-12 22:43:59
问题 I have created a shared library using Qt Creator and I have added the Android SDK, Android NDK and Android Qt kit. Then I compiled my library for Android successfully. I even tested it in an Android application successfully. As I am not using the Qt libraries, my library does not depend on huge Qt libraries. But unexpectedly, here is my dependencies: [matin@Lenovo-X1-Fedora ~]$ ndk-depends libMatinChess.so WARNING: Could not find library: libgnustl_shared.so libMatinChess.so libz.so libstdc++

Error in linking static files in django project deployed on pythonanywhere

时间秒杀一切 提交于 2019-12-12 22:39:28
问题 I have deployed a django(1.7) project in pythonanywhere and its link is- http://drchitradhawle.pythonanywhere.com/ I guess there is the problem with static file linking and bootstrap.Plz anybody help me to sort out the problem also tell me whole procedure to link any static file and bootstrap in a django project. My project structure is - home -DrChitraDhawle -website -webpage -static -css -images -templates -website -settings.py settings.py file is - STATIC_ROOT = "/home/DrChitraDhawle

buildroot file system & cross compiling: dynamically linked application fails but static ok. How to link against uClibc

我是研究僧i 提交于 2019-12-12 22:02:04
问题 I have a buildroot created file system, and I am trying to execute some c-code on lighttpd server. I have created a simple C module that just prints out few lines of html. Code looks like this: #include "stdio.h" int main(void) { printf( "Content-Type: text/plain\n\n" ); printf("testing C code\n"); return 0; } I'm using compiler from Ubuntu repository, to compile it arm-linux-gnueabi-gcc -o test.cgi test.c . If I compile with -static flag, it will run just fine, and I can see the html

GCC: --whole-archive recipe for static linking to pthread stopped working in recent gcc versions

早过忘川 提交于 2019-12-12 19:21:31
问题 Static linking against pthread is a difficult topic on Linux. It used to work to wrap -lpthread as -Wl,--whole-archive -lpthread -Wl,--no-whole-archive (the details can be found in this answer). The effect was that symbols (for pthread) were strong, not weak. Since around Ubuntu 18.04 (between gcc 5.4.0 and gcc 7.4.0) that behavior seemed to have changed, and pthread symbols now always end up as weak symbols independent of the --whole-archive option. Because of that, the -whole-archive recipe

linking 3rd party static libs in cgo library

回眸只為那壹抹淺笑 提交于 2019-12-12 09:48:35
问题 I have a Go library that provides bindings for the C++ OpenImageIO library (OpenImageiGO). I've been happily building my bindings via the standard dynamic linking to libOpenImageIO, but am now trying to link statically. I'm running into an issue where no matter which combination of flags I try, the external linker fails with a ton of "undefined reference" errors. I seem to recall seeing this issue raised in the past, saying that there was an issue regarding the order in which the linker saw

Compiling one shared library on Linux to target all distributions

爱⌒轻易说出口 提交于 2019-12-12 08:11:28
问题 We want to create one shared library (.so) to target all distributions, including old ones. The code is written in C++ and uses C++11 features, so the compiler must be at least gcc 4.7. We noticed that if we compile our code on a Linux machine with gcc 4.7.2 installed (e.g., Ubuntu 12.10) then the .so produced has “version 1 (GNU/Linux)” while on older os (e.g., CentOS 5.6) the version is “version 1 (SYSV)” – and libraries with the GNU/Linux newer version cannot be used on older os. So we

Creating static libraries

时光毁灭记忆、已成空白 提交于 2019-12-12 07:39:40
问题 I'm trying to create a static library to use inside my PHP extension. To do that, I'm compiling my .c files using gcc -c file.c -o file.o and obtaining .o files. I then use ar rcs lib.a *.o to archive all the compiled objects into an .a file. After doing this, I'm referring to this .a file when compiling my PHP extension, but I get the following error: *** Warning: Linking the shared library <extension>.la against the *** static library lib.a is not portable! If I use the .o files instead of

How to force include static objects from a static library in C++ (MSVC 11)

北战南征 提交于 2019-12-12 05:23:15
问题 I am trying to initialize a static object in a C++ file which is trying to auto register a class to a factory in its constructor (like any standard auto-registration problem). The problem is, this is compiled to a static library, and while linking to an executable, that is optimized away. There should have been a very simple solution to that, but surprisingly, looks like it's not that simple. Here's my class: In Factory.h (part of static lib project) class DummyClass : public BaseFactoryClass