Linux capabilities (setcap) seems to disable LD_LIBRARY_PATH

As already stated in other answers, this behavior is intended. There is some kind of workaround if you can compile (or at least link) the application yourself. Then you can pass -Wl,-rpath <yourDynamicLibraryPath> to gcc or -rpath <yourDynamicLibraryPath> to ld and you won’t have to specify LD_LIBRARY_PATH at all on execution.

Can I use shared library created in C++ in a C program?

You want something more like this (and here I will use a slightly more meaningful example): C/C++ header – animal.h #ifndef ANIMAL_H #define ANIMAL_H #ifdef __cplusplus class Animal { public: Animal() : age(0), height(0) {} Animal(int age, float height) : age(age), height(height) {} virtual ~Animal() {} int getAge(); void setAge(int new_age); float getHeight(); void setHeight(float … Read more

How do you tell Valgrind to completely suppress a particular .so file?

For most of the suppression types, you omit the wildcard, like so: { name Memcheck:Cond obj:/path/to/lib/lib.so.10.1 } { name Memcheck:Free obj:/path/to/lib/lib.so.10.1 } { name Memcheck:Value8 obj:/path/to/lib/lib.so.10.1 } Note that you must list each type of error separately, you can’t wildcard them. You must also list the entire pathname of the library (as shown by valgrind, … Read more

Nested structures in Ruby Fiddle

How about: data.c #include <stdio.h> struct A { int a_id; }; struct B { int b_id; struct A a_nested; }; void dump_b(struct B* b) { printf(“B.b_id: %d\n”, b->b_id); printf(“B.a_nested.a_id: %d\n”, b->a_nested.a_id); } fiddle.rb # frozen_string_literal: true require ‘fiddle’ require ‘fiddle/import’ module Test extend Fiddle::Importer dlload ‘./data.dylib’ B = struct [ “int id”, “int a_id” ] … Read more

Relation between object file and shared object file

Let’s say you have the following C source file, call it name.c #include <stdio.h> #include <stdlib.h> void print_name(const char * name) { printf(“My name is %s\n”, name); } When you compile it, with cc name.c you generate name.o. The .o contains the compiled code and data for all functions and variables defined in name.c, as … Read more

unused DT entry: type 0x1d arg

What are “unused DT entry” errors? If you have reached this page, it’s probably because you have compiled or attempted to run some binaries on your ARM based Android system, with the result that your binary/app crashes or generates a lot of warnings in your logcat. Typically something like this: WARNING: linker: /blahblah/libopenssl.so: unused DT … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)