views:

369

answers:

2

I'm trying to compile a small OpenCV program using Eclipse. I'm limited in library locations, as I'm running them on a University shared server. I have a fully working makefile, with which I can compile and run the program from the terminal as intended, however when using Eclipse, it compiles fine but on running I get the following error:

/home/cserv2_a/soc_ug/sc06ijh/PhD/year1/testing/camtest1/Debug/camtest1: error while loading shared libraries: libcv.so.0: cannot open shared object file: No such file or directory

I've set the LD_ LIBRARY_PATH environment variable both in eclipse and my .bashrc (space added to stop it italising) and checked that it points to the correct place (it must or the terminal compiled program wouldn't run!).

I am having to compile with -m32 flags, because the vision department library hasn't updated their OpenCV build to 64-Bit, but this works fine with a standard makefile (see below). I'm wondering if somewhere along the line this is messing up the library paths?

all: camtest1

%:%.cpp

g++ -O3 -m32 -I/home/csunix/vislib/opencv/include/opencv -L/home/csunix/vislib/libs/opencv $^ -L/home/csunix/vislib/libs/ffmpeg -lcv -lcvaux -lcxcore -lhighgui -lstdc++ -lavcodec -lavformat -lavutil -o $@

Thanks in advance!

A: 

Scratch that, I'd set the environment for compiling but not for running the program, so it still wasn't seeing the LD_LIBRARY_PATH!

ianhales
A: 

wanna library automation upate

tara