static-linking

PyInstaller; “could not find or load the Qt platform plugin ”windows\"

≡放荡痞女 提交于 2019-12-03 16:07:01
My PyInstaller spec: # -*- mode: python -*- block_cipher = None a = Analysis(['test.py'], pathex=['C:\\Users\\admin\\compile'], binaries=[('C:\\Python361\\Lib\\site-packages\\PyQt5\\Qt\\plugins\\platforms\\qwindows.dll', 'qwindows.dll')], datas=[], hiddenimports=[], hookspath=[], runtime_hooks=[], excludes=[], win_no_prefer_redirects=False, win_private_assemblies=False, cipher=block_cipher) pyz = PYZ(a.pure, a.zipped_data, cipher=block_cipher) exe = EXE(pyz, a.scripts, a.binaries, a.zipfiles, a.datas, name='test', debug=False, strip=False, upx=False, runtime_tmpdir=None, console=False , icon=

Boost library static linking on Xcode 4

眉间皱痕 提交于 2019-12-03 15:56:16
I am using the Boost library on OS X using Xcode. Boost was installed on my system using macports. I have successfully built my app by adding the 3 boost libraries I need (for example, libboost_thread-mt.a) to that Targets 'Link Binary With Libraries' list. However I need to link these libraries statically so that the app will run on other computers without the boost library needing to be installed. How do I do this exactly? Through my numerous google searches I'm finding I might need to add '-static' - where do I add this in Xcode? If you've linked with a .a library, then you have already

CMake: Linking statically against libgcc and libstdc++ into a shared library

江枫思渺然 提交于 2019-12-03 15:44:48
问题 Problem: I am having difficulties linking glibcc/glibc++ into a shared library using CMake and GCC4.9 on my Ubuntu 16.04 installation. Additional conditions: Loading the shared library gives a problem om the Red Hat production environment(where I copy it to), I believe because it uses a different libstc++ version(error: GLIBCXX_3_4_20 not found). I do not have sudo rights and cannot upgrade the machine. As I derived from this blog, this post, I tried linking static linking against libgcc and

Compiling one shared library on Linux to target all distributions

杀马特。学长 韩版系。学妹 提交于 2019-12-03 15:21:12
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 tried the approach of installing gcc 4.7 on the CentOS 5.6 machine, compile our code with this compiler

Linking a Static C Library in Xcode 7?

China☆狼群 提交于 2019-12-03 13:56:53
问题 I'm currently trying to link a static C library I've created to a fresh Xcode project. To link it, I followed the following instructions: 1) Navigate to Build Phases 2) Expand Link Binaries With Library 3) Added an "other" library, and then specified the .a file in question. Unfortunately, the project won't compile and throws the following error: ld: library not found for -ltxht I'm not sure exactly what to make of this. The library seems to appear okay in the project as a project file, and I

Size of a library and the executable

限于喜欢 提交于 2019-12-03 11:56:17
I have a static library *.lib created using MSVC on windows. The size of library is say 70KB. Then I have an application which links this library. But now the size of the final executable (*.exe) is 29KB, less than the library. What i want to know is : Since the library is statically linked, I was thinking it should add directly to the executable size and the final exe size should be more than that? Does windows exe format also do some compression of the binary data? How is it for linux systems, that is how do sizes of library on linux (*.a/*.la file) relate with size of linux executable (*

Can Clang compile code with GCC compiled .a libs?

↘锁芯ラ 提交于 2019-12-03 11:02:57
I have my project currently compiling under gcc. It uses Boost, ZeroMQ as static .a libraries and some .so libraries like SDL. I want to go clang all the way but not right now. I wonder if it is possible to compile code that uses .a and .so libraries that were compiled under gcc with clang? Yes, you usually can use clang with GCC compiled libraries (and vice versa, use gcc with CLANG compiled libraries), because in fact it is not compilation but linking which is relevant. You might be unlucky and get unpleasant suprises. You could in principle have some dependencies on the version of libstdc++

Linking library without a header file?

梦想的初衷 提交于 2019-12-03 09:24:51
问题 I'm attempting to link a static library in C++ using Visual Studio 2010. Trouble is, the library (and accompanying header ) have a lot of MFC objects in them. I would like to call one of the library's functions without recompiling my project to include MFC, or recompiling the library to not use MFC. This codeproject article seems to imply that this is possible if I define the function to be external in my project (using the "extern" keyword). However, I've had no luck. No matter what I try, I

Cython: Compile a Standalone Static Executable

北战南征 提交于 2019-12-03 08:45:36
I'm trying to compile an executable (ELF file) that does not use a dynamic loader. I used Cython to compile Python to C: cython3 -3 test.py --embed Then gcc test.c -otest $(pkg-config --libs --cflags python3) to compile C generated file. Now I'd like to compile test.c in a static executable. Usually I use -static flag, but here it return collect2: error: ld returned 1 exit status . How can I do? EDIT 1: Not the full messge becouse body is limited to 30000 chars a long list of warnings and errors like these : ... /usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/libpython3.5m.a(pyexpat

How to deal with 3rd party c++ libraries LNK4099 Warning in VisualStudio

偶尔善良 提交于 2019-12-03 08:03:18
I have a Visual Studio c++ project where I use the linker Settings /WX (TreatWarningsAsLinkerErrors=true) In Debug, I compile with /Zi (Debug Database), which works fine. Now I have a 3rd party SDK which comes with a static library, but no .pdb file. As soon as I link this file in Debug, I get LNK4099: 3rd-party.lib(3rd-party.obj) : warning LNK4099: PDB "vc90.pdb" was not found "3rd-party.lib(3rd-party.obj)" or with "C:\OutDir\vc90.pdb" Please note that this message is misleading, as placing vc90.pdb next to 3rd-party.lib does not solve the problem, because the source code and pdb of that 3rd