3

I am on a brand new 5.1 NetBSD box.

I copied the "Hello World" code from here rosettacode.org

The code compiles with this command:

cc -I /usr/X11R7/include -L /usr/X11R7/lib -lX11 helloworld.c

When I run a.out, I get the following error:

Shared object "libX11.so.6" not found

I confirmed that /usr/X11R7/lib/libX11.so.6 does exist.

ldd output:

./a.out:
    -lX11.6 => not found
    -c.12 => /usr/lib/libc.so.12

How do I properly link against X11 on NetBSD?

0

1 Answer 1

2

The official NetBSD answer is to use RPATH. Crazy.

1
  • I should have mentioned I am still a C novice. I had come across that link before posting my question, but wasnt quite sure what I was looking at. Appending -R /usr/X11R7/lib worked, thanks man! Commented May 8, 2012 at 5:26

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.