NetBSD-Users archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: linking issue - what am I doing wrong?



On Fri, 25 Mar 2016, Rhialto wrote:
It looks like you need to give the runtime library path to the linker. See ld's -rpath option.

Yep. J. Hannken-Illjes sent me a note about the same issue and I was able to make it work.

Unfortunately different compilers have slightly different ways of specifying this (and passing it on to the linker). I think -Wl,-rpath,arg is a common variant.

Well, I'm glad I'm learning about this. I'm sure it'll be useful on NetBSD and other platforms that don't use something like ldconfig.

I have a rant somewhere about how this is better than a global system-wide search path such as used by lunix or freebsd, but I'd have to look it up :)

No sweat, brother, I have no dog in that fight. I'm just trying to make my simple little tutorial programs work. I used to be a lot better with C, and I've been striving lately to get better so I can participate in some projects I care about. I'm not surprised that I'm tripping over the linker after not writing any real C in 10 years.

I guess this is how pkgsrc has to compile a _lot_ of stuff. The syntax for GCC is a bit clumsy, but it works. Once it's compiled in, it pretty well stays working. So, at least there is that. I don't have to mess around with ldconfig et al. Learning this also helps me understand the differences between platforms.

-Swift



Home | Main Index | Thread Index | Old Index