shared-libraries

What is causing sprof to complain about “inconsistency detected by ld.so”?

此生再无相见时 提交于 2019-12-12 09:31:42
问题 I'm trying to use sprof to profile some software (ossim) where almost all the code is in a shared library. I've generated a profiling file, but when I run sprof, I get the following error: > sprof /home/eca7215/usr/lib/libossim.so.1 libossim.so.1.profile -p > log Inconsistency detected by ld.so: dl-open.c: 612: _dl_open: Assertion `_dl_debug_initialize (0, args.nsid)->r_state == RT_CONSISTENT' failed! The instructions I was following said that I needed libc version at least 2.5-34, I have

What's the simplest way to write portable dynamically loadable libraries in C++?

天涯浪子 提交于 2019-12-12 08:48:12
问题 I'm working on a project which has multiple similar code paths which I'd like to separate from the main project into plugins. The project must remain cross-platform compatible, and all of the dynamic library loading APIs I've looked into are platform specific. What's the simplest way to create a dynamic library loading system which can be compiled and run on multiple operating systems without extra modification of the code? Ideally, I'd like to write one plugin, and have it work on all the

valgrind - Find memory leak in a shared library

十年热恋 提交于 2019-12-12 08:24:57
问题 I need to know ways to find out the memory leaks in a shared library which will be loaded to a release binary. I mean shared library I built with -g option but the binary that loads the shared library is not built with -g option. I get the leak report as follows. ==739== at 0x4A05809: malloc (vg_replace_malloc.c:149) ==739== by 0x84781B1: ??? ==739== by 0x87507F5: ??? ==739== by 0x874CF47: ??? ==739== by 0x874E657: ??? ==739== by 0x874F7C2: ??? ==739== by 0x8779C0C: ??? Please let me know how

How to know if one shared library depends on another shared library or not?

ε祈祈猫儿з 提交于 2019-12-12 07:27:20
问题 I wrote a shared library named "libmyssl.so", I use some openssl function in my code, the make file looks like follows: g++ -v -shared -lz -lssl -lcrypto -Wl,-soname,libmyssl.so.1,-o libmyssl.so.1.0 myssl.o After that, I use ldd command to look if it depends on libssl.so : ldd libmyssl.so.1.0 The result as follows: linux-vdso.so.1 => (0x00007fff743fe000) libstdc++.so.6 => /usr/lib/x86_64-linux-gnu/libstdc++.so.6 (0x00007f0bc963b000) libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6

Distributing Windows C++ library: how to decide whether to create static or dynamic library?

情到浓时终转凉″ 提交于 2019-12-12 07:24:56
问题 We have been converting our Java and .NET API library to C++, and are trying to figure out what is the best way to distribute a compiled version to other developers to use with their custom applications. Should it be a static library or dynamic library? We need to create for both Win32 and Win64 (and I suppose both a Debug and Release version of each target OS). Given all the frustration I've encountered trying to make sure all referenced libraries are matched (/MT versus /MD), I'm wondering

How to force using local shared libraries over system libraries?

∥☆過路亽.° 提交于 2019-12-12 07:12:15
问题 How can I force using a local library over the system library in linux? I linked my executable explicitly to some .so files in my project/lib directory e.g. (../lib/libluajit.so). Running my executable under gdb or using ldd shows that it still uses the system libluajit-5.1.so.2 I then set LD_LIBRARY_PATH to my project/lib directory and exported it, then ran my executable. Somehow it's still picking up the system library (confirmed by both gdb and ldd) I'd like to know how that's even

Read/Extract .ppt Document all text using c#

徘徊边缘 提交于 2019-12-12 06:38:32
问题 I want to extract all the text from the document .ppt file. I need some free library or some code to read/extract the .ppt document. The soultion should not dependent of Ms.Office. : dont want to use Microsoft Office Interop and IFilter 回答1: Hey take a look at the following library: Aspose.com https://github.com/asposeslides/Aspose_Slides_NET you can take a look at these also: http://www.codeproject.com/Articles/13391/Using-IFilter-in-C http://www.citeknet.com/Products/IFilters

Swift iOS Custom Framework Conflicts

杀马特。学长 韩版系。学妹 提交于 2019-12-12 06:27:46
问题 I made a custom iOS Swift framework with some simple form validation methods and some tests. I open-sourced it to Github. What if another developer uses my framework for their app but changes the method names? Could that potentially crash my app? I mean, one framework is shared between multiple apps, right? 回答1: If I understand what you're asking, only people with pull access will be able to change your framework. If someone changes it, you then download the framework with the new changes and

Building Elf Shared Library with MinGW

寵の児 提交于 2019-12-12 05:50:07
问题 I'm trying to build an shared library on Windows with MinGW, follow this tutorial: Building_elf_shared_libraries I run this step: $ gcc -fPICenter code here -c libfoo.c -o libfoo.o $ gcc -Wall -O2 -shared -Wl,-soname,libfoo.so.1 -o libfoo.so.1.0.0 libfoo.o When I get the .so I try to read it with readelf and get error: $ readelf -h libfoo.so.1.0.0 readelf: Error: Not an ELF file - it has the wrong magic bytes at the start Did I misunderstand something? 回答1: Yes you did misunderstand something

Linux c++ portable binary issue

♀尐吖头ヾ 提交于 2019-12-12 05:36:51
问题 I try to package my binary and all its shared libraries into an archive. I want user only extracts the archive to make the binary work. The executable is launched via a shell script where I set LD_LIBRARY_PATH to shared library path contained in the archive. On a first time I wanted to make it work on a RHEL 6.7 distribution so I have compiled my binary with this distribution, and when I tested it it works well. The problem is that I have now to make it work on a RHEL 7.2 (and keep RHEL 6.7