From simon.urbanek at r-project.org  Fri Jun  3 00:39:09 2005
From: simon.urbanek at r-project.org (Simon Urbanek)
Date: Fri Jun  3 00:39:18 2005
Subject: [Rd] could not open libRmath.so
In-Reply-To: <58618a620506021452797c8485@mail.gmail.com>
References: <58618a620506021452797c8485@mail.gmail.com>
Message-ID: <AB1D405E-2E70-487F-84FC-9DF5F31320C5@r-project.org>

On Jun 2, 2005, at 5:52 PM, Tib wrote:

> Now I use this to compile my program
> g++ engine.cpp -o engine -lm -lRmath -I/Users/tib/R/lib/R/include/
> -L/Users/tib/R/bin/
> it did not report any error, however as I executed the program
> ./engine
> it reported:
> ./engine: error while loading shared libraries: libRmath.so: cannot
> open shared object file: No such file or directory
>
> Why did it report this error but compile through?

Because you specified the path to the library for the compiler (-L/ 
Users/tib/R/bin/), but failed to do so at runtime. Something like
export LD_LIBRARY_PATH=/Users/tib/R/bin/
should do the trick, usually [I'm assuming you have libRmath.so in / 
Users/tib/R/bin].

Cheers,
Simon


[Rd] could not open libRmath.so
Simon Urbanek