How to get RPATH with $ORIGIN to work on Code::Blocks GCC?

前端 未结 3 1009
你的背包
你的背包 2020-12-25 14:24

I\'m trying to link an RPATH containing the special string $ORIGIN into an executable built using GCC with the Code::Blocks IDE. I\'ve specified

-Wl,-R$ORIGI         


        
3条回答
  •  抹茶落季
    2020-12-25 15:19

    In addition to kblucks answer that addresses the question for Code:Blocks.... For those like me who stumbled across this page looking for how to do this with Make. The trick is to use an extra $ sign as an escape character and to enclose it with quotes:

    -Wl,-R,'$$ORIGIN/../lib'
    

    Full explanation can be had here: Using ORIGIN for a dynamic runtime library search path

提交回复
热议问题