I don’t understand -Wl,-rpath -Wl,

The -Wl,xxx option for gcc passes a comma-separated list of tokens as a space-separated list of arguments to the linker. So eventually becomes a linker call In your case, you want to say “ld -rpath .“, so you pass this to gcc as -Wl,-rpath,. Alternatively, you can specify repeat instances of -Wl: Note that there is no comma between aaa and the second -Wl. Or, in … Read more