static-linking

In C, is it possible to change exported function name to different one?

微笑、不失礼 提交于 2019-12-18 04:41:41
问题 all. I want to link a library which calls malloc() function. However, my target environment is different one and malloc() is supplied as inline-function. How can I make the library's call to malloc() direct to my target environment's malloc() routine? Is it any way to change the exported function name? If so I can code my_malloc() first and export it as malloc() and link the library to that one: #include <my_environment.h> // malloc() is inline function declared there void my_malloc (void) {

Do I need static libraries to statically link?

假装没事ソ 提交于 2019-12-18 04:12:50
问题 On 'C', Linux, Do I need static libraries to statically link, or the shared ones I have suffice? If not, why not? (Don't they contain the same data?) 回答1: Yes, you need static libraries to build a statically linked executable. Static libraries are bundles of compiled objects. When you statically link with to library, it is effectively the same as taking the compilation results of that library, unpacking them in your current project, and using them as if they were your own objects. Dynamic

How to link host code with a static CUDA library after separable compilation?

淺唱寂寞╮ 提交于 2019-12-17 22:37:27
问题 Alright, I have a really troubling CUDA 5.0 question about how to link things properly. I'd be really grateful for any assistance! Using the separable compilation features of CUDA 5.0, I generated a static library (*.a). This nicely links with other *.cu files when run through nvcc, I have done this many times. I'd now like to take a *.cpp file and link it against the host code in this static library using g++ or whatever, but not nvcc. If I attempt this, I get compiler errors like undefined

Static-linking of SDL2 libraries

别等时光非礼了梦想. 提交于 2019-12-17 22:16:50
问题 I am using Windows 7, Code::Blocks and MinGW. I have little to no experience when it comes to compiling/building anything, especially when Code::Blocks doesn't use makefiles. I downloaded SDL2-devel-2.0.0-mingw.tar.gz (SDL Development Libraries) from http://www.libsdl.org/tmp/download-2.0.php, and I'd like to create a standalone executable using SDL2 libraries, but so far I've always had to bundle the SDL2.dll file with the executable to make it work. I've heard that I can not static-link

Making small haskell executables?

邮差的信 提交于 2019-12-17 21:49:25
问题 Are there any good ways to make small haskell executables? With ghc6 a simple hello world program seems to come to about 370kB (523kB before strip). Hello world in C is about 4kB (9kB before strip). 回答1: With the development branch of GHC (anyone know exactly which version this was added in?): $ ghc -o hello hello.hs $ strip -p --strip-unneeded --remove-section=.comment -o hello-small hello $ du hello hello-small 700 hello 476 hello-small Add the -dynamic flag for a dynamically linked RTS: $

How to link a .DLL statically?

蹲街弑〆低调 提交于 2019-12-17 18:49:00
问题 We have a (pure native C++) .DLL that is build by VS. As clients we have some native C++ applications and a .Net-Wrapper around this DLL written in C++/CLI. Finally there are some client applications for the .Net-Wrapper written in C#. My problem is that the native.dll must be distributed in a different way than the .Net world works and the VS does not keeps track of that DLL. So to let all my C# Apps work correctly I have to copy it to each executable directory or put it somwhere in %PATH%

How to compile Haskell to a static library?

邮差的信 提交于 2019-12-17 17:45:10
问题 Hey, I'm learning Haskell and I'm interested in using it to make static libraries for using in Python and probably C. After some googling I found out how to get GHC to output a shared object, but it dynamically depends on GHC`s libraries. The resulting ELF from compiling in GHC is dynamically dependand only on C libs and it's a bit under a MB in size - it has been statically linked with GHC`s libs. How and if can this be achieved for shared objects? Example of current state: $ ghc --make

Xcode 4 Final - “armv6 armv7” issue while linking with armv6 libs

若如初见. 提交于 2019-12-17 15:42:54
问题 Until xcode 4 final (I was using 3.latest and 4 GM for the time it was available) this didn't happen. When I upgraded to xcode 4 final version, I started getting a linking error while trying to link the armv7 version with my non armv7 library (my project is set with the default Standard armv6 armv7 valid architectures): ld: warning: ignoring file ../bin/iOS static/arm/libssl.a, file was built for archive which is not the architecture being linked (armv7) ld: warning: ignoring file ../bin/iOS

how to do static linking of libwinpthread-1.dll in mingw?

主宰稳场 提交于 2019-12-17 15:16:45
问题 I use mingw from here: http://sourceforge.net/projects/mingwbuilds/files/host-windows/releases/4.7.2/32-bit/threads-posix/sjlj/x32-4.7.2-release-posix-sjlj-rev2.7z/download And I've sucessfully managed to link statically libstdc++-6.dll and libgcc_s_sjlj-1.dll by using -static-libgcc -static-libstdc++ parameters, but I cannot find a command for doing the same with libwinpthread-1.dll . 回答1: You should probably check command line options documentation for GCC. These's no '-static-something'

Program can't find libgcc_s_dw2-1.dll [duplicate]

回眸只為那壹抹淺笑 提交于 2019-12-17 07:24:00
问题 This question already has answers here : Closed 7 years ago . Possible Duplicate: The program can't start because libgcc_s_dw2-1.dll is missing I'm using Code::Blocks and MinGW 4.4 (I think) compiler to create a C++ project. I get this system error if I run it from its directory, but not from within Code::Blocks. The program can't start because libgcc_s_dw2-1.dll is missing from your computer. Try reinstalling the program to fix this problem. In this post hardmath said to add -static-libgcc