shared-libraries

Pack shared libraries into the elf

╄→гoц情女王★ 提交于 2019-12-17 08:53:52
问题 Is there a utility that can take ALL the SO's that an Elf needs turn them into static then converts the Elf to be SO's free? 回答1: Here are some projects you might find useful: Statifier (basically does what you want) ERESI (might do what you want, also allows for analysis of ELF targets) NOTE: I've not used either application myself. 回答2: Statifier is an option. Another option is Ermine. While Ermine is commercial it behaves better than statifier on systems with memory randomization. 回答3: I

How to set the runtime path (-rpath) of an executable with gcc under Mac OSX?

佐手、 提交于 2019-12-17 07:05:45
问题 I want to set under Mac OSX the runtime path of an executable (for the linker) at compile time, such that shared libraries at non-standard locations are found by the dynamic linker at program start. Under Linux this is possible with -Xlinker -rpath -Xlinker /path/to (or using -Wl,-rpath,/path/to ) and under Solaris you can add -R/path/to to the compiler command line. I found some information that Mac OS X gcc has -rpath support since 10.5, i.e. since ~ 2008. I tried to get it working with a

Why does GCC create a shared object instead of an executable binary according to file?

余生长醉 提交于 2019-12-17 06:42:43
问题 I have a library I am building. All of my objects compile and link successively when I run either one of: ar rcs lib/libryftts.a $^ gcc -shared $^ -o lib/libryftts.so in my Makefile. I also am able to successfully install them into /usr/local/lib When I test the file with nm, all the functions are there. My problem is that when I run gcc testing/test.c -lryftts -o test && file ./test or gcc testing/test.c lib/libryftts.a -o test && file ./test it says: test: ELF 64-bit LSB shared object

Elegantly call C++ from C

风格不统一 提交于 2019-12-17 06:27:45
问题 We develop some project in plain C (C99). But, we have one library as source codes (math library) in C++ . We need this library so I would like to ask, what is the most elegant way to integrate this source codes? Ratio between sizes of C and C++ is 20:1 so moving to C++ is not the option. Should we use static library? DLL? (It's all on Windows). 回答1: EDIT: Based on discussion in the comment, I should point out that separating things into a C-compatible struct duck and a derived class Duck is

Semantic versioning: minor or major change? (second part)

本小妞迷上赌 提交于 2019-12-14 03:58:40
问题 Some time ago I had asked whether adding fields to a struct of a shared library would require a major or a minor change in the version string according to semantic versioning. The few participants where inclined to suggest a major change. Months have passed and I have not added any fields to my struct yet. But now it might be the right time for doing it. However in the meanwhile I have also been thinking about how this could break binary compatibility with programs compiled with previous

NOT sharing all classes with shared library

帅比萌擦擦* 提交于 2019-12-14 03:39:50
问题 As ugly as win32 Microsoft compiler is by using the __declspec macro, it does have the advantage of being explicit about what you want to export or not. Moving the same code onto a Linux gnu/gcc system now means all classes are exported!(?) Is this really true? Is there a way to NOT export a class within a shared library under gcc? #ifndef WIN32 #define __IMPEXP__ #else #undef __IMPEXP__ #ifdef __BUILDING_PULSETRACKER__ #define __IMPEXP__ __declspec(dllexport) #else #define __IMPEXP__ _

Import Library benefit

℡╲_俬逩灬. 提交于 2019-12-14 03:22:45
问题 I understand pros and cons of static and dynamic linking. But what is the benefit of Import Library? 回答1: As it is stated in this answer import library (a.k.a. stub library) is useful when one wants to link executable dynamically but do not want to mess with LoadLibrary and GetProcAddress functions. 来源: https://stackoverflow.com/questions/39401403/import-library-benefit

How to get clang to link against a library without the “lib” prefix?

守給你的承諾、 提交于 2019-12-14 01:40:33
问题 My situation is I have a library that doesn't have a "lib" prefix. I'd like to link against it, and I can't recompile it (it's actually a Python module). Now, if you use the '-l' flag with GCC or clang, then the lib prefix is automatically added and the library is not found. For GCC, I can use '-l:mylib.so' to get it to link against an arbitrary file. However, this doesn't work for clang. Is it possible to get clang to link against a particular library without the 'lib' prefix? 回答1: This

Integrating an external pure Java library and having Android classes access on it

两盒软妹~` 提交于 2019-12-14 00:31:45
问题 I'm having troubles trying to get my external Java project so I can use Android classes on it as well. The library is already integrated on the Android project. For instance: I have several model classes on it that I would want to implement Parcelable so they can be seriallized accordingly, but none of the Android classes are available on them. Clarification I only did this in order to try to solve the issue So far I've only tried: Changing and matching the external library's package: Package

Overcome DLL Hell with Code::Blocks

十年热恋 提交于 2019-12-13 22:21:54
问题 I'm using Code::Blocks for a project. I have not used an IDE on Linux in years, so I'm a bit out of touch with Linux IDEs. I'm working with an OpenSSL project that uses FIPS validated library. I duplicated the GCC compiler toolchain and modified it to use OpenSSL's fipsld (and set it as default). When the project's code executes under Code::Blocks via F8 , FIPS_mode_set fails with error 252104805 (0xF06D065). 0xF06D065 is: $ openssl errstr 0xF06D065 error:0F06D065:common libcrypto routines