views:

72

answers:

2

I am attempting to install an application. During compilation it fails with the following error:

/usr/bin/ld: cannot find -lemu

I have installed the libemu library, and it now currently resides in /opt/libemu/. However, when I try and compile my application the library is not found. Is there any way to correct this?


EDIT: It also looks like the make is resulting in: It also looks like the make file is compiling with the following:

gcc -pthread -shared -Wl,-O1 -Wl,-Bsymbolic-functions 
build/temp.linux-x86_64-2.6/libemu_module.o 
-L/opt/libemu/lib -lemu -o build/lib.linux-x86_64-2.6/libemu.so

I have tried setting my LD_LIBRARY_PATH to /opt/libemu, still doesn't work - fails with the error mentioned above.

+2  A: 

You need to tell the linker where it is:

gcc  stuff -L/opt/libemu -lemu

or:

gcc  stuff /opt/libemu/libemu.a

where stuff is your normal compile/link options files etc.

You can also specify library paths in the LIBRARY_PATH environment variable:

LIBRARY_PATH=/opt/libemu
export LIBRARY_PATH

before you run your build. Yet another option is to see where gcc looks for libraries by running:

gcc --print-search-dirs

and put your library in one of the listed directories.

Edit: It is really not clear from your latest info what you are trying to build. Are you trying to turn a static library into a shared library? Most important - What is the exact filename of the library file you have copied into the /opt/libemu directory?

anon
I am attempting to compile a third party application where I simply issue: "make install". Where would I specify the -L/opt/ . . . ?
Louis
A: 

The environment variable LD_LIBRARY_PATH should include (but probably does not by default) /opt/libemu.

try running:

export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/opt/libemu
make install
rrhartjr
The export failed on Ubuntu, stating an invalid path identifier. After some Googling I came up with: export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$ROOTSYS/libWhich allowed me to export, however the library was still not located when I attempted to make again . . .
Louis