error while loading shared libraries: libopencv_core.so.3.1 - eclipse

A bit confused. I set up all required lib paths and still have loading shared libraries error.
From the terminal when I type
>>pkg-config --libs opencv
-L/usr/local/lib -lopencv_cudabgsegm -lopencv_cudaobjdetect -lopencv_cudastereo -lopencv_shape -lopencv_stitching -lopencv_cudafeatures2d -lopencv_superres -lopencv_cudacodec -lopencv_videostab -lopencv_cudaoptflow -lopencv_cudalegacy -lopencv_calib3d -lopencv_features2d -lopencv_objdetect -lopencv_highgui -lopencv_videoio -lopencv_photo -lopencv_imgcodecs -lopencv_cudawarping -lopencv_cudaimgproc -lopencv_cudafilters -lopencv_video -lopencv_ml -lopencv_imgproc -lopencv_flann -lopencv_cudaarithm -lopencv_core -lopencv_cudev
Inside the file
sudo gedit /etc/ld.so.conf.d/opencv.conf
I have /usr/local/lib
Then in Eclipse, I set up all include and lib paths as shown in the attached images.
Then build the project has no error.
But when I debug, the error is
error while loading shared libraries: libopencv_core.so.3.1: cannot open shared object file: No such file or directory
What could be wrong?
Thanks

As batuman posted on Feb 2 at 10:10, run at terminal:
sudo ldconfig
Verified 9 Sept 2016, Ubuntu 16.04.1, Eclipse Luna and Opencv 3.1

Related

log4c link error in eclipse

Been trying to use log4c in an eclipse IDE. No matter what I try, I can't seem to resolve the __log4c_category_vlog reference in my link.
I can see __log4c_category_vlog via an objdump of the liblog4c.a file, I've tried modifying some of the code in the category.c/category.h files before I do the make/make install, all to no avail. I've set my linker to point to the proper lib64 folder, added proper include etc in Eclipse.
The sample programs that come with log4c compile/link/run ok, so I must be missing something obvious. Any help/heads up appreciated!
log4c version:1.2.4
Eclipse version:luna
Linux: Opensuse 13.2
gcc version: 4.8.3 20140627
/home/david/build3/include/log4c/category.h:359: undefined reference to __log4c_category_vlog'
makefile:30: recipe for target 'testLog4c' failed
./src/testLog4c.o: In functionlog4c_category_log':

netbeans cannot open shared library during RUN comm

everything worked fine but I've just tried to run my CUDA programs on Linux Ubuntu 12.10 in NetBeans and I get error:
dist/Debug/GNU-Linux-x86/my_cuda_1: error while loading shared
libraries: libcudart.so.5.0: cannot open shared object file: No such
file or directory
RUN FAILED (exit value 127, total time: 191ms)
the projects can build: compile + link without problems, I can also run it from commandline but if I try run it from NetBeans I get this error.
I was able to run it few minutes ago, what might happened?
I have added file my_lib to ld.so.conf.d containing such text:
/usr/local/cuda-5.0/lib64:/lib
/usr/lib
/usr/lib64
can it be a link issue libcudart.so.5.0 -> licudart.so?
there are two libs in cuda/lib libcudart.so.5.0 (link) and libcudart.so (link) and libcudart.so.5.0.35 (shared lib)
why it complains about .so.5.0? mayve link like:
sudo ln -s /usr/lib/x86_64-linux-gnu/libglut.so.3 /usr/lib/libglut.so
is necessary
it is related to link to shared library I think
root#comp:# echo $LD_LIBRARY_PATH
/usr/lib/nvidia-current:/usr/local/cuda-5.0/lib::/usr/local/cuda-5.0/lib64:/lib
isn't this :: a problem? seems that No because I changed this and still same error. I specify PATHS, I run ldconfig, I put exports in the .bashrc, still nothing.
the reason is that I cannot load these libraries if program is started from NetBeans GUI, however I start NetBeans as root always
add to the Project -> Properties -> Run -> Environment
Name: LD_LIBRARY_PATH
Value:
$LD_LIBRARY_PATH:/usr/lib/nvidia-current:/usr/local/cuda-5.0/lib:/usr/local/cuda-5.0/lib64:/lib
Thank you all. I don't know what happened before as it worked just fine.

Issues with g++ and Eclipse on Linux - unresolved symbols

I am running Ubuntu 64bit version, and downloaded the latest 64bit Eclipse.
Installed g++ along with build-essential. Tested g++ to make sure it works from terminal, and it works fine.
alex#ubuntu:~/Desktop$ g++ test.cpp -o test
alex#ubuntu:~/Desktop$ ./test
Hello World!alex#ubuntu:~/Desktop$
However, trying to build simple C++ Hello Word project(one of the default projects that comes with Eclipse), I am getting error.
Description Resource Path Location Type
Program "g++" not found in PATH Preferences, C++/Build/Settings/Discovery, [CDT GCC Builtin Compiler Settings] options C/C++ Scanner Discovery Problem
I have added Environment variable named g++ with value /usr/bin/g++ and the above error went away, however, now I am getting unresolved errors, though project compiles and in the Console shows !!!Hello World!!!
Description Resource Path Location Type
Symbol 'endl' could not be resolved test_hello.cpp /test_hello/src line 13 Semantic Error
Symbol 'cout' could not be resolved test_hello.cpp /test_hello/src line 13 Semantic Error
Symbol 'std' could not be resolved test_hello.cpp /test_hello/src line 10 Semantic Error
Have I correctly entered Environmental variable ?? How can I get fix the "unresolved" error ?? Thanks !
When compiling there are two important things to consider:
1.) Is my path up-to-date with executables?
2.) Is my library path correct?
It appears you satisfy 1.) but not 2.)
The unresolved symbol error means that Eclipse cannot find your library via LD_LIBRARY_PATH or some other medium. It's attempting to locate the standard compiled C++ library.
How did you install g++?
Kindly do this and post the results:
Project > Properties > C/C++ Build > Environment
If everything there appears nominal, you can try
/sbin/ldconfig
which should hopefully re-parse your system library paths and might update your environment.

Eclipse linker not finding my libraries

I am having problems getting NSight Eclipse to link in my libraries:
Building target: SA_V1
Invoking: NVCC Linker
nvcc -L/home/streaming/VidApp_V1.0/src/AudioPreconditioning6Ch/dist/Release/GNU-Linux-x86 -L/home/streaming/cuda-workspace/libConfig/Debug -L/usr/lib32 -link -o "SA_V1" ./V1.1/DeckLinkAPIDispatch.o ./V1.1/DeckLinkAPIDispatch_v7_6.o ./V1.1/audio.o ./V1.1/capture.o ./V1.1/cudaEngine.o ./V1.1/decklink.o ./V1.1/engine.o ./V1.1/filter.o ./V1.1/filterKernel.o ./V1.1/initialize.o ./V1.1/main.o ./V1.1/playback.o ./V1.1/utils.o ./V1.1/videoFuncThread.o ./V1.1/vif.o ./V1.1/vof.o -llibAudioPreconditioning6Ch.so -lliblibConfig.so -llibtiff.so.4.3.2
/usr/bin/ld: cannot find -llibAudioPreconditioning6Ch.so
==> searching for the library I get:
/home/streaming/VidApp_V1.0/src/AudioPreconditioning6Ch/dist/Debug/GNU-Linux-x86/libAudioPreconditioning6Ch.so
/home/streaming/VidApp_V1.0/src/AudioPreconditioning6Ch/dist/Release/GNU-Linux-x86/libAudioPreconditioning6Ch.so
/home/streaming/dist/lib64/libAudioPreconditioning6Ch.so
What am I doing wrong?
Library names in Linux are not the same as in Windows. in VS, i was linking libConfig.lib, so when eclipse asked for the name of the library i typed in: liblibConfig.so which is the name of the file. Uh uh. In Linux the prefix lib is understood as a prefix and the suffix .so is also not part of the name. so entering: libConfig as the library to load (which gets inserted into make as: -llibConfig) solves the problem

PDFlib works only if the library is in /usr/lib not in a custom path

we are using PDFlib for personalizing PDFs.
The pdflib.jar library and the libpdf_java.so file are both in the folder:
/home/user/my/custom/library/path/
I start the server with this argument:
java -Djava.library.path=/home/user/my/custom/library/path/
like it is mentioned in the pdflib tutorial
After deploying on my jBoss5 Server i got this error message:
ERROR [STDERR] Cannot load the PDFlib shared library/DLL for Java.
Make sure to properly install the native PDFlib library. For your
information, the current value of java.library.path is:
/home/user/my/custom/library/path/
So, the path ist correct (i tried it with and without the / at the end)
If I put the jar and the lib in my /usr/lib folder, everything works fine, but not with my custom folders.
I use it on a linux 64bit, if that matters!
The custom folder and the files got chmod 755 - so this shouldn't be the problem
Looking forward to your hints!