Using SFML in Eclipse (Linux) - c++

I'm trying to get SFML (www.sfml-dev.org) running under Eclipse which is running on Ubuntu 16.04, my c++ compiler is nvcc as this is a cuda project. I have my includes and libraries set up as follows:
The project builds fine, but when I run it I get the error message:
error while loading shared libraries: libsfml-window.so.2.4: cannot open shared object file: No such file or directory
This is weird, because the file exists (/home/timo/cuda-workspace/CudaTutorial/SFML/lib). Does anyone know how I can resolve this issue?

Well, in the end creating a conf file did it:
gksudo gedit /etc/ld.so.conf.d/sfml.conf
/lib/SFML/lib
sudo ldconfig
(I put the SFML build into lib in case I want to use it in another project).

Related

octave libs not linking properly

I built octave-4.4.0 and created binaries and libs in my own path instead of /usr/local, and i am able to link my cpp program through CMakeList and its working fine.
the same octave folder when i shipped to different ubuntu in another machine and try linking the cpp program as same way through CMakeList i am unable to do execute the binary. i am getting this error. I moved octave by tar (with symlink)
error: feval: function 'pkg' not found terminate called after throwing
an instance of 'octave::execution_exception'
please help me to resolve this

GTK 3 Eclipse error while loading shared libraries: libgtk-3.so.0

I'm currently using Eclipse IDE for C/C++ Developers Version: 2018-09 (4.9.0) to build a simple GTK 3 app. But after I build and then run the app, in Eclipse, I get the following error:
Debug/Test: error while loading shared libraries: libgtk-3.so.0: cannot open shared object file: No such file or directory
However, When I start the executable from a terminal, it starts just fine.
How can I resolve the shared library not found so I can run the app directly from within Eclipse?

{OpenCV Error} error while loading shared libraries: libgfortran.so.1: cannot open shared object file: No such file or directory

SYSTEM: Ubuntu 16 LTS
Compiler: g++
I)
I have built OpenCV from source. I followed these steps:
1.) Downloaded OpenCV source / code (3.1.0)
2.) Unzipped it
3.) Used cmake with default settings (cmake ..) because any other options were throwing up make errors later on
4.) make -j4
5.) successful install
Now when I compile from the command line using
g++ -o testwav wavfil.cpp `pkg-config opencv --cflags --libsopencv`;./testwav
I get the following error
./testwav: error while loading shared libraries: libgfortran.so.1: cannot open shared object file: No such file or directory
This happens for all c++ files using OpenCV only. Normal c++ files (using only standard c++ in-built libraries) work fine though.
On doing some research I cant find anything specific to this error, but I can find a solution to a general case for it, i.e., when an .so file is not found (means your libraries are missing or you dont have access permissions or need to use sudo to run the command).
I think it is because of OpenCV pointing to the wrong libraries. I had come across something about modifying .pc files but I cant seem to find it right now. I may be wrong about this.
II)
I need help setting up the OpenCV with geany, does anyone have experience with this?

ROS package checked out from SVN. Can't build it on eclipse

I've checked out a ROS package that I have on my repository on a different PC (ubuntu).
The problem is that while rosmake (or make for that matter) from cli, in eclipse it gives me the following error.
/usr/bin/make all
rospack: error while loading shared libraries: librospack.so: cannot open shared object file: No such file or directory
Makefile:1: /cmake.mk: No such file or directory
make: * No rule to make target `/cmake.mk'. Stop.
I suppose it's problem is eclipse's build enviroment. How do I debug this?
Shouldn't it work out of the box?
It seems that because I was running eclipse from an icon it couldn't get the environment variables. I had to change the link to bash -i -c eclipse.

How to use OpenCV2.2 with Dev C++ 4.9.9.2?

I wish to use opencv on my project work. Therefore, I downladed OpenCV2.2 http://sourceforge.net/projects/opencvlibrary/ and installed it. Then I made following configuration in Dev C++ 4.9.9.2 since i am using Dev C++ compiler for my works;
OpenCV library is installed in the C:\ OpenCV2.2 directory
Open Dev C++ and Tools ->Compiler Options and then add a new compiler named OpenCV
Then, click Add these commands to the linker command line and include following linker: -lopencv_core220d -lopencv_highgui220d -lopencv_video220d -lopencv_ml220d -lopencv_legacy220d -lopencv_imgproc220d
Add C:\ OpenCV2.2\include\opencv and C:\ OpenCV2.2\include\opencv2 on to C includes and C++ Includes on directories.
Also add static libaries paths to C:\ OpenCV2.2\lib and bin directory path to the C:\ OpenCV2.2\bin
then, i tried to compilng C programs on the sample directory but I got lot of error messages
Then, I downloaded Cmake (Windows (Win32 Installer) cmake-2.8.4-win32-x86.exe- binary distributions) from “http://www.cmake.org/cmake/resources/software.html and instaled it. According to the OpenCV installation guide (http://opencv.willowgarage.com/wiki/InstallGuide), I tried to configure opencv using Cmake. I did this using Cmake GUI and also tried using command line however both attempts were not success anf got lot of error messages (ex.Error in configuration process , project files may be invalid).
Please give me correct steps to do this.