static-linking

CPython sources - how to build a STATIC python26.lib?

青春壹個敷衍的年華 提交于 2019-12-07 04:38:41
问题 I'm trying to compile my hello.pyx file to an exe using Cython. First step was to compile the hello.pyx into a hello.cpp file using command "cython --cplus --embed hello.pyx". Embed option means to Generate a main() function that embeds the Python interpreter . I'm trying to create an independent exe with no dependencies. In hello.cpp I have an #include "Python.h" , so I'm downloading Python sources from here: http://www.python.org/download/releases/2.6.6/ , choosing Gzipped source tar ball

Statically link a haskell program that uses C++ wrapper library

落爺英雄遲暮 提交于 2019-12-07 03:32:33
问题 I am trying to make a program that, via some of the third party modules, is dependant upon icu library. I suspect that the dependency is via Network.HTTP.Conduit but maybe via something else. Dynamically linked binary is not portable even between adjacent versions of the same distribution because libicu* are of different versions that are not compatible. So I am trying to build the program statically: $ ghc --make -static -optc-static -optl-static my-prog.hs -optl-pthread and I am getting a

Bytestring linking in ghc

谁都会走 提交于 2019-12-07 00:31:52
问题 Consider the following simple code: import Crypto.Hash.SHA1 (hashlazy) import qualified Data.ByteString as BS main = return () I installed cabal install --global bytestring and then I obtain (on a newly installed Ubuntu 12.04 machine using ghc 7.4.1): GHCi runtime linker: fatal error: I found a duplicate definition for symbol fps_minimum whilst processing object file /usr/local/lib/bytestring-0.10.0.1/ghc-7.4.1/HSbytestring-0.10.0.1.o This could be caused by: * Loading two different object

How to follow linking order when linking against static library with gnu-make?

佐手、 提交于 2019-12-06 22:20:37
问题 I've got the following problem: cc -g -O2 -Wall -Wextra -Isrc -rdynamic -DNDEBUG build/liblcthw.a tests/list_tests.c -o tests/list_tests /tmp/ccpvGjZp.o: In function `test_create': ~/lcthw/tests/list_tests.c:12: undefined reference to `List_create' collect2: ld returned 1 exit status make: *** [tests/list_tests] Error 1 But cc -g -O2 -Wall -Wextra -Isrc -rdynamic -DNDEBUG tests/list_tests.c build/liblcthw.a -o tests/list_tests runs just fine, nm shows the expected content, tests run,

How to link to D Libraries in a D program

故事扮演 提交于 2019-12-06 21:28:32
问题 I´m new to the D Programming Language and have a very simple problem. I want to compile a D Script Library once and then use it in my other D projects. In C I linked to the .lib files and created headers for them, but in D I don´t find things like that (are there even some sort of headers in D?) I use D-IDE as my IDE and DMD2 as my compiler. 回答1: there are .di (D interface) files which can be used as header these can be generated from your sources with the -H compiler switch however the

CMake on Linux: “target platform does not support dynamic linking”

霸气de小男生 提交于 2019-12-06 20:24:35
问题 I have the very simple CMakeLists.txt CMAKE_MINIMUM_REQUIRED(VERSION 2.8) FIND_PACKAGE(VTK REQUIRED) PROJECT(test CXX) that really doesn't do anything. The package VTK is correctly found under /usr/lib/vtk-5.8/VTKConfig.cmake . This file includes a number of statements of the type ADD_LIBRARY(foobar SHARED IMPORTED) to indicate that the shared library libfoobar.so will need to be linked in executables. Upon creating Makefiles using the above script, however, CMake will complain that CMake

gcc: confused about -static -shared -fPIE -fPIC -Wl,-pie

五迷三道 提交于 2019-12-06 08:15:16
I'm trying to build clang, with all library static linked in. So that I can run it on CentOS 6 with ancient GCC 4.4 version. At first, I think adding the option -static by turning on LLVM_BUILD_STATIC is enough. But in the link stage, it errors out. dynamic STT_GNU_IFUNC symbol `strcmp' with pointer equality in `/usr/lib/../lib64/libc.a(strcmp.o)' can not be used when making an executable; recompile with -fPIE and relink with -pie So, I add -fPIE -Wl,-pie to CMAKE_CXX_FLAGS, and it says -- Performing Test HAVE_CXX_ATOMICS_WITH_LIB -- Performing Test HAVE_CXX_ATOMICS_WITH_LIB - Failed CMake

How to compile SDL program and run it without DLL

倖福魔咒の 提交于 2019-12-06 07:20:20
is it possible to compile SDL library program into exec and run it without having "sdl.dll"? for example let say i wrote sdl program and it works and everything but the thing is to run the program on windows, i need to have "sdl.dll" within the same folder or system folder. is it possible to compile it so that i can just take the exec with me without needing to have "sdl.dll" along with it? i am using visual studio 2010 express. Typically the procedure for this kind of stuff is: Download the source code for the library. In SDL's case: http://www.libsdl.org/download-1.2.php . Build the library

How to compile c program so that it doesn't depend on any library?

帅比萌擦擦* 提交于 2019-12-06 06:59:46
问题 It seems even a hello world program depends on several libraries: libc.so.6 => /lib64/libc.so.6 (0x00000034f4000000) /lib64/ld-linux-x86-64.so.2 (0x00000034f3c00000) How can I static link all stuff ? 回答1: Link with -static . "On systems that support dynamic linking, this prevents linking with the shared libraries." Edit: Yes this will increase the size of your executable. You can go two routes, either do what Marco van de Voort recommends ( -nostdlib , bake your own standard library or find a

Linking partially static and partially dynamic in GCC

给你一囗甜甜゛ 提交于 2019-12-06 04:03:08
I'm trying to compile a very simple (as simple as hello world) C program using both dynamic and static linking with GCC. I want to know how to do this in general, so my minimal test example is simply trying to link libc as static and libm dynamically. I've come across at least the following other questions regarding the same topic: GCC: static linking only some libraries Static link of shared library function in gcc Some of the answers therein suggest things such as using -Wl,-Bstatic and -Wl,-Bdynamic to specify which libraries are respectively static and dynamic. Also suggested is among