This is an intriguing one. I suspect I'm being punished for an earlier team decision to put all third party libraries under /OPT.

I can compile link and run inside QtCreator as myself without issue. I need to be able to do a setuid() thought to assign some capabilities. Add two build steps. First sets owner to root:root. Second does chmod -v +s my_program. This part works perfectly.

dir -l my_program
-rwsrwsr-x 1 root root 26082113 Feb 13 08:19 my_program

now it dies instantly in the debugger looking for the qwt shared library. The "system" environment under the run option has the same LD_LIBRARY_PATH as the build environment.

Is this really using the LD_LIBRARY_PATH from root and not the one provided by the environment?