static-linking

Qt static build - impossible size

让人想犯罪 __ 提交于 2019-12-11 08:17:14
问题 I am quite new to Qt programming, and i tried long to understand how linking the libraries work. I need to distribute a small program - 1000 lines or so - that i developed to a few people. I built statically Qt because I need a static build , and now my programs size increased drammatically. I only use Qpushbuttons, Qlinedits, Qlabels, and a few more things and I ended up with a compiled program of over 160Mb, while just a few MB would be reasonable . I assume it included unwanted libraries

How to Avoid `msvcrt.dll` Compiling with MinGW64?

点点圈 提交于 2019-12-11 06:35:28
问题 I have some C++ code that I compile to various platforms, namely Linux 32/64 bits, Windows 32/64 bits. For the Windows part, I use the latest gcc compiler provided by mingw-w64 package. The trouble I am having is that the 32-bit compilation drags the libc API that Microsoft provides through msvcrt.dll, and that DLL has some problems: is not distributable (it comes with Windows and is not replaceable) has versions (every Windows version has a different one, with added functionality) it depends

Delphi link to windows dll statically or dynamically

那年仲夏 提交于 2019-12-11 06:17:32
问题 I am aware that implicitly linking to libraries at load time can lead to performance increases and as such I was wondering if it was good practice to link in this way at compile time thus increasing executable size (admittedly this is only marginal) compared to linking explicitly at runtime. My question is when linking against Microsoft Windows dll files located in System32, is it 'better' to link at load time as you can be mostly certain that the libraries will be present or follow the

Unable to configure Qt for static building

Deadly 提交于 2019-12-11 05:26:46
问题 Essentially this is a repost of this question which was never answered. I am trying to set up Qt for static linking following these instructions. So far, all I've done is go to where my Qt version is, and run configure -static I get some output, ending in: Sources are in..............C:\QtSDK\Desktop\Qt\4.8.0\msvc2010 Build is done in............C:\QtSDK\Desktop\Qt\4.8.0\msvc2010 Install prefix..............C:\QtSDK\Desktop\Qt\4.8.0\msvc2010 Headers installed to........C:/QtSDK/Desktop/Qt/4.8

Force cmake to link shared library with static library without mentioning a specific target

我怕爱的太早我们不能终老 提交于 2019-12-11 02:14:32
问题 I am trying to make a shared library linked with a static version of librt. Currently I am doing this: CMAKE_MINIMUM_REQUIRED(VERSION 2.6) ADD_LIBRARY(memtrace SHARED memtrace.c) ADD_LIBRARY(lib_real_time STATIC IMPORTED) SET_TARGET_PROPERTIES(lib_real_time PROPERTIES IMPORTED_LOCATION /usr/lib/x86_64-linux-gnu/librt.a) TARGET_LINK_LIBRARIES(memtrace lib_real_time) But I do not want to specify the path like this. Since librt is always in standard paths, I'd rather have cmake find it. Like in

How to embed a static library into a shared library?

情到浓时终转凉″ 提交于 2019-12-11 00:03:36
问题 On linux I am trying to create a shared library, libbar.so, that embeds a commercial static library (licensing is fine). The commercial library has 4 versions: libfoo-seq.a, libfoo-mt.a, libfoo-seq.so, and libfoo-mt.so (they all provide the same symbols, just the code is sequential/multi-threaded, and the lib is static/shared). Of these four I want my code always to use the sequential foo library, so when I create libbar.so I link together my object files and libfoo-seq.a. The problem is that

How can I pass arguments to ranlib using cmake?

三世轮回 提交于 2019-12-10 23:37:38
问题 How can I pass an argument to ranlib when compiling a static library with CMake? I tried: set_target_properties(myLibrary STATIC_LIBRARY_FLAGS "--plugin /usr/lib/gcc/x86_64-linux-gnu/4.9/liblto_plugin.so") and this worked for ar but not for the subsequent ranlib command. 回答1: Have you tried this? SET(CMAKE_C_ARCHIVE_FINISH "<CMAKE_RANLIB> -no_warning_for_no_symbols -c <TARGET>") SET(CMAKE_CXX_ARCHIVE_FINISH "<CMAKE_RANLIB> -no_warning_for_no_symbols -c <TARGET>") On the Mac, this is how I

How to debug static dependency loading problems?

孤街浪徒 提交于 2019-12-10 23:35:35
问题 How can I debug a scenario where a Visual C++ 2010 SP1 application is unable to completely load its dependencies, and quits prematurely, without showing its UI? I am interested in a good guides to Fusion Logs, dependency walker, and remote debugger, if you think they are relevant. Is it something that can be easily verified with WinDbg? What about Process Explorer? Is it possible to launch a process on a remote machine with remote debugger attached? Would it be possible to verify if a proper

Error when statically building a windows application

こ雲淡風輕ζ 提交于 2019-12-10 20:22:06
问题 I have an application that compiles and works fine when i dynamically link everything, but when I want to have a static build of it it will not compile. In visual studio 2010 I set the Use MFC in a Static Library option. When I do that I get this error: Error 1 error LNK2001: unresolved external symbol _wWinMain@16 LIBCMT.lib(wwincrt0.obj) I have tried adding LIBCMT.lib as an additional library, but that doesn't change anything. Any ideas on how to fix this problem? 回答1: From the message that

How to link against v8?

点点圈 提交于 2019-12-10 18:24:23
问题 I successfully compiled v8 javascript engine (on windows) ; now I try to follow the Getting started article but I am stuck at this point: Compile hello_world.cpp, linking to the static libraries created in the build process. The example is for linux (and probably for an earlier version). I tried to link against all libraries that I could without success: User@PC:/cygdrive/c/Users/Yvain/Documents/depot_tools/v8/build/Release g++ -std=c++0x -I"C:\Users\Yvain\Documents\depot_tools\v8" -Llib -lv8