Farzad Towhidi
Farzad Towhidi

Reputation: 383

Setting LD_LIBRARY_PATH in Cygwin

I am following the tutorial : http://java.sun.com/developer/onlineTraining/Programming/JDCBook/jniexamp.html

when I reach the part where I am supposed to set the library path :

Unix or Linux:

LD_LIBRARY_PATH=`pwd`
export LD_LIBRARY_PATH

Windows NT/2000/95:

set PATH=%path%;

Neither of these work in cygwin. I keep getting an error when trying to run my program.

Upvotes: 7

Views: 10895

Answers (2)

Jonathan Wakely
Jonathan Wakely

Reputation: 171263

Cygwin doesn't use LD_LIBRARY_PATH, it looks for shared libraries in PATH, so try:

export PATH=`pwd`:$PATH

That will add the current directory to the front of the PATH.

Upvotes: 18

William Pursell
William Pursell

Reputation: 212238

Is that

LD_LIBRARY_PATH=$(pwd)

and you just messed up the html, or are you really running:

LD_LIBRARY_PATH=pwd

If the latter, try adding the $() to get the current working directory into the path. Also, you can

echo $LD_LIBRARY_PATH

to ensure it contains what you want. You might consider doing

LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$(pwd)

to avoid discarding previous contents of the path.

Upvotes: 0

Related Questions