static-linking

CMake failing to statically link SDL2

折月煮酒 提交于 2019-12-06 02:25:57
问题 I'm trying to build a simple SDL2 game with CMake and MSYS Makefiles. I want to statically link SDL2 so I can distribute a single executable without having to include the SDL2.dll. Here's my CMakeLists.txt file: project(racer-sdl) cmake_minimum_required(VERSION 2.8) set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11") set(CMAKE_EXE_LINKER_FLAGS "-static") include(FindPkgConfig) pkg_search_module(SDL2 sdl2) if (SDL2_FOUND) message(STATUS "Using SDL2") add_definitions(-DUSE_SDL2) include

Include mingw libraries in compiled file

≯℡__Kan透↙ 提交于 2019-12-06 02:03:20
I am using cmake to generate a Eclipse CDT MinGW Project. (Eclipse Version Kepler) This is my Cmakelist: project(IMGTODICOM) find_package(ITK REQUIRED) include(${ITK_USE_FILE}) add_executable(IMGTODICOM IMGTODICOM.cxx) target_link_libraries(IMGTODICOM ITKReview ${ITK_LIBRARIES}) The code compile and run without problem in my computer, but in other PC it does not run. Some dll like libgcc_s_dw2-1.dll are required. I looked for this dll in my computer and I found it in C:\MinGW\bin . To solve the problem I copied the content of this folder in the other PC and the exe file finally run. However, I

two static libraries with duplicate symbols in Xcode

你离开我真会死。 提交于 2019-12-05 20:57:53
I have two static libraries which seem to have duplicate symbols(TBXML.o) and won't compile. ld: duplicate symbol _OBJC_METACLASS_$_TBXML in /Users/Hoya/Desktop/SocialSync/include/SMUFLib/deviceLib/libSFCommonLibs.a(TBXML.o) and /Users/Hoya/Desktop/SocialSync/Cauly/libCaulyDevice.a(TBXML.o) for architecture armv6 Command /Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/clang failed with exit code 1 The developer of both libraries don't provide the source code so there is nothing I can do to edit the code directly to fix it. Is there anything I can do to work around this without nagging

linking and paging in the system without virtual memory support

六眼飞鱼酱① 提交于 2019-12-05 19:41:53
First of all, is virtual memory a hardware feature of the system, or is it implemented solely by OS? During link-time relocation, the linker assigns run-time addresses to each section and each symbol, in the generated executable Do those run-time addresses correspond to virtual addresses? What if the system for which the executable is generated, does not use virtual memory? Next, if virtual memory is not used, then the application's address space is limited to the physical address space allocated for it by OS after load-time relocation Does page fault occur if no virtual memory is used? I

static compilation of proftpd on AIX

跟風遠走 提交于 2019-12-05 17:16:48
I'd like to compile proftpd on AIX to make it deployable on other server without having to reinstall all gnu lib library on each server. I already manage to compile it dynamicaly, but I can't manage to get it compile with the option LDFLAG="-Wl,-static" like advise in the official proftpd documentation. here the config.log error I get This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. It was created by configure, which was generated by GNU Autoconf 2.61. Invocation command line was $ ./configure LDFLAGS=-Wl,-static -

linking opencv libraries included as an external project via cmake [duplicate]

删除回忆录丶 提交于 2019-12-05 15:47:00
问题 This question already has answers here : Configuring an c++ OpenCV project with Cmake (2 answers) Closed 5 years ago . I'm relatively new to cmake and after days of struggling couldn't figure out the following thing: I have a project that depends on opencv (which is a cmake project on its own) and I want to statically link opencv libraries. What I'm doing is I have a copy of opencv source code in my project and include it into my CMakeLists.txt via ExternalProject_Add(my_copy_of_opencv

Linking against boost barfs with 'undefined reference to `boost::system::get_system_category()'

雨燕双飞 提交于 2019-12-05 15:05:44
问题 I'm having trouble statically linking an app which uses the boost 1.35 libraries. I'm using a linux debian Lenny box, with G++ 4.3.2. Linking without -static works without a hitch. Specifically, g++ -Wall -Wextra -pedantic -ggdb3 -O0 -static -l boost_thread-mt -lboost_system-mt -lboost_program_options-mt -lssl -lpthread -l crypto main.o comandos.o utils.o tunnel.o opciones.o decode.o sysutils.o -o sapp main.o: In function `__static_initialization_and_destruction_0': /usr/include/boost/system

Statically link OpenSSL in XCode

混江龙づ霸主 提交于 2019-12-05 12:01:16
I am trying to link libssl.a and libcrypto.a static libraries in XCode command line project [under Link Binary With Libraries]. I have included Openssl header files in search path. Compilation succeeds but execution fails with dyld: Library not loaded: /usr/local/ssl/lib/libcrypto.1.0.0.dylib . Why does it look for dylib when I am linking it statically? How can this be fixed? Any help would be appreciable. jww Why does it look for dylib when I am linking it statically? How can this be fixed? Apple's linker uses the dylib or share object if its available, regardless of of your linker flags like

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

南笙酒味 提交于 2019-12-05 10:03:44
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 (2.6.6) . I add include dir and get error about missing Python26.lib. So I am trying to compile it. The

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

怎甘沉沦 提交于 2019-12-05 09:02:39
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 lot of errors of this kind: /usr/lib/gcc/x86_64-linux-gnu/4.8/../../../x86_64-linux-gnu/libicuuc.a