MySQL Improperly Configured Reason: unsafe use of relative path

In OS X El Capitan (10.11), Apple added System Integrity Protection. This prevents programs in protected locations like /usr from calling a shared library that uses a relative reference to another shared library. In the case of _mysql.so, it contains a relative reference to the shared library libmysqlclient.18.dylib. In the future, the shared library _mysql.so … Read more

Linking GLEW with CMake

Typical CMake scripts like FindGLEW will define variables that specify the paths and files that your project needs. If the script can’t automatically identify the correct paths (usually because of nonstandard install location, which is fine), then it leaves these variables up to you to fill in. With command line CMake, you use the -D … Read more

`bash: ./a.out: No such file or directory` on running executable produced by `ld`

ld -lc a.o There are several things wrong with this command line: In general, user-level code should never use ld directly, and always use appropriate compiler front end (gcc here) to perform the link. As you have discovered, the link command line that gcc constructs is quite complicated, and the command line that you’ve accepted … Read more

dlopen from memory?

I needed a solution to this because I have a scriptable system that has no filesystem (using blobs from a database) and needs to load binary plugins to support some scripts. This is the solution I came up with which works on FreeBSD but may not be portable. void *dlblob(const void *blob, size_t len) { … Read more