[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: linking at run time problem
From: |
Greg Chicares |
Subject: |
Re: linking at run time problem |
Date: |
Wed, 02 May 2007 01:55:49 +0000 |
User-agent: |
Thunderbird 1.5.0.10 (Windows/20070221) |
On 2007-05-01 22:56Z, g-h-d wrote:
>
> g++ -L/usr/local/lib -o"testing_hal" ./main.o /main.o: In function
> `hal::set_err_fn(char const*, char const*, int, int)':
> /usr/local/include/hal/err_hnd.h:257: undefined reference to `hal::err_hnd'
That suggests that a required library wasn't linked.
> g++ -L/usr/local/lib -o"testing_hal" ./main.o -lhal_base
> Finished building target: testing_hal
> Build complete for project testing_hal
Linking to the library fixes the link-time problem.
> Runtime error:
> /Debug/testing_hal: error while loading shared libraries: libhal_base.so.0:
> cannot open shared object file: No such file or directory
>
> Attempt #2 compiles but not #1, so i deduce that adding -lhal_base is
> probably a good idea, but i still have a runtime error. The incriminated
> file libhal_base.so.0 does reside in the specified library specified by -L
> i.e. /usr/local/lib.
The '-L' linker switch tells the linker (but not the
operating system) where to find that library. How you
tell the OS where to find it is OS specific; it's not
a 'make' problem.