Build and install libsocketcan for x86_64 - c++

I have downloaded the the libsocketcan project and built and installed it successfully (no errors) using:
./autogen.sh
./configure
make
make install
and the configure step outputs:
checking build system type... x86_64-pc-linux-gnu
By my program still complains about the missing libsocketcan file:
qt.canbus.plugins.socketcan: Cannot load library socketcan: (socketcan: cannot open shared object file: No such file or directory)
qt.canbus.plugins.socketcan: Cannot load library libsocketcan, some functionality will not be available.
Cannot load library socketcan: (socketcan: cannot open shared object file: No such file or directory)
I notice that libsocketcan.* can be found in /usr/local/lib, but not in /usr/local/lib64. I think thats the problem. Why are the above steps not building and installing the 64-bit versions of the library? I tried symlinking the .so file into the /usr/local/lib64 but it had no effect. I also tried adding the path to the /usr/local/lib/libsocketcan.so in the ld.config.conf file but also no effect (and I ran ldconfig).
I'm working in Fedora 34 x86_64.

Related

wxWidgets jpeg library build issue

I'm trying to build wxWidgets library into a custom path on a Fedora 27 operative system.
I achieved the wx-config file path recognition and works with the cmake execution. Also, I load libraries and include dirs based on modified wxWidgets finder cmake file that sets thewx-config custom path successfully.
But cmake does not load my wxWidgets configuration. I mean, wx_gtk2u_jpeg-3.1 builded lib could not be founded (suposed to be /usr/lib/libwx_gtk2u_jpeg-3.1.so). I need jpeg dependency from wxWidgets for my project.
I'm sure that problem is not about cmake files. However, the problem is wxWidgets compilation because cmake can found the other builded dependencies into /usr/lib/
I actually installed the libjpeg-turbo-devel package that includes the libjpeg.h needed for wxWidgets building without success of libwx_gtk2u_jpeg-3.1.so creation.
The weirdest part is that $ wx-config --libs shows the wx_gtk2u_jpeg-3.1 lib to be linked and the hint paths that it should be founded.
wxWidgets commands for building:
$ ./configure --with-libjpeg=builtin --with-libpng=builtin --with-libtiff=builtin --with-zlib=builtin --with-expat=builtin --enable-webviewwebkit=no --prefix=/opt/cpp_dependencies/2018Q1/usr'
$ make -j 4
$ make install
You can check out my cmake files, the cmake output and wxWidgets building output in order to reproducing it: https://gist.github.com/jjalvarezl/b70accae269ef56c56010bedf157c27f
You can see line 1543 of wxWidgets building output file that jpeg library is buildin, and, 1564 of same file, the make install command that installs all libwx_<lib_name>.so libraries into final /usr/lib path. Anyway, no one contains the needed library.
Please show the exact error message, as it's not clear what the actual problem is. What I can say, is that the different built-in versions of 3rd party libraries, such as libjpeg, are always static libraries, even when wxWidgets themselves are shared. I.e. you're never going to have libwx_gtk2u_jpeg-3.1.so, only .a.
I'd also strongly recommend using system versions of the 3rd party libraries under Unix systems. This means that your wxWidgets applications will get security updates from your OS vendor and you don't risk running into any incompatibilities due to using 2 different versions of the same library in your application.

Can't find libopecv_core.so.2.3, file actually not there

So I have a question concerning a .so file in Ubuntu. I'm trying to run a program in QT creator, but I get the error
/home/sean/Desktop/iStrabGUI_140321/iStrabGUI: error while loading
shared libraries: libopencv_core.so.2.3:
cannot open shared object file: No such file or directory
My opencv and opencv2 directories are located at /usr/include, and I did add them to my LD_LIBRARY_PATH variable. However, after checking inside the opencv and opencv2 directories, it doesn't seem like the file is there at all. My question is, how do I go about getting this file? I've already installed libopencv-dev on my computer, so where does this come from?
If you really can not find the shared library, it seems to me that you have not installed openCV properly. You might have downloaded openCV but not built the libraries, I assume?
Since you are using Ubuntu you can install openCV from the Ubuntu repository
sudo apt-get install libopencv-dev python-opencv

How to install LAPACK for MSVS 2010 on windows?

I am using the ITPP library (IT++ library) for one of my projects. For using the eigen_sym() function of this library, it asks for installing the LAPACK. I tried the direct prebuilt libraries for Windows but still get the error. Finally on the following site:
http://icl.cs.utk.edu/lapack-for-windows/lapack/#libraries
I found a solution under "Build Instructions to create LAPACK and LAPACKE 3.5.0 dlls for Windows with MinGW" that might work. I did steps 1 to 5 but got stuck 6 onwards.
My destination of the cmake build is E:/LAPACK
I got an error while in the cmd prompt while entering:
cd E:/LAPACK 3.5.0 >Enter
C:/MinGW/bin/mingw32-make.exe >Enter
i'm getting
mingw32-make.exe> No targets specified and no make file found. Stop.
Can someone explain the step 6 onwards in detail and tell me where i'm going wrong?
I finally want to get the .dll and .lib files.
I was able to build LAPACK 3.5 for windows using mingw and pretty much the build guide from the LAPACK page. Using the following steps
Download lapack.tgz from here http://netlib.org/lapack/lapack.tgz
Extract to a folder. I used 7zip file manager to extract the tarball to x:/Other/test
Install mingw32. I used this: http://www.mingw.org/download/installer and I selected and installed mingw32-developer-toolkit + mingw32-base + mingw32-gfortran + mingw32-gcc-g++ + msys-base
Open a command prompt
Append mingw to your path
path=C:/Mingw/bin;%PATH%
change directory to the location you extracted lapack: For me this was X:\Other\Test\lapack-3.5.0 so the command I typed was the following (your path will be different):
C:\Users\jdrescher>x:
X:>cd Other\Test\lapack-3.5.0
X:\Other\Test\lapack-3.5.0>
make a folder for your build. I used build
X:\Other\Test\lapack-3.5.0>mkdir build
then change directory to the build folder
X:\Other\Test\lapack-3.5.0>cd build
X:\Other\Test\lapack-3.5.0\build>
Now configure with CMake
X:\Other\Test\lapack-3.5.0\build>cmake -G "MinGW Makefiles" -D BUILD_SHARED_LIBS=ON -D CMAKE_GNUtoMS=ON ..
Now use gnu make to build LAPACK
X:\Other\Test\lapack-3.5.0\build>c:\MinGW\bin\mingw32-make.exe
Note: This step will take several minutes.
After the above steps completed 100% with no errors, I have the following dlls in the build\bin folder: libblas.dll, liblapack.dll, libtmglib.dll
Also the following libraries, and exp files in the build\lib folder: libblas.exp, libblas.lib, liblapack.exp, liblapack.lib, libtmglib.exp and libtmglib.lib.

Building and installing MongoDB C++ driver in OS X

I have downloaded the latest version of MongoDB C++ driver for my os x from http://dl.mongodb.org/dl/cxx-driver. Then I extracted using tar xvf command in os x terminal. After that I run scons to build the driver. It build successfully by giving following messages
-- some messages --
ranlib build/libmongoclient.a
ranlib: file: build/libmongoclient.a(backtrace.o) has no symbols
ranlib: file: build/libmongoclient.a(posix_fadvise.o) has no symbols
ranlib: file: build/libmongoclient.a(ssl_manager.o) has no symbols
Install file: "build/libmongoclient.a" as "libmongoclient.a"
scons: done building targets.
So, then I run the command "scons install" to install the library into my machine.
--some messages --
scons: done reading SConscript files.
scons: Building targets ...
scons: `install' is up to date.
scons: done building targets.
But when I check into the /usr/local directory for the libmongoclient libs, It's not there.
But inside my extracted mongoDB driver folder, there is a file with the name of "libmongoclient.a". But there is no file with the extension of ".dylib". Then How do I use mongoDB Xcode & gcc C++ ?
Somebody help me to link with "libmongoclient" library from Xcode.
It took me a while to get this working.
Hopefully you can get yours working from the following steps:
Create a new C++ project in Xcode
I copied the code from <mongo_driver_install>/src/mongo/client/examples/tutorial.cpp as a test
In Build Settings/Search Paths:
Add the following to your Header Search Paths:
/path/to/mongo-cxx-driver-nightly/src
and your equivalent path for the boost library header files (the folder should contain a boost folder):
/usr/local/Cellar/boost/1.54.0/include
Add the following to your Library Search Paths:
/usr/local/lib (in my case holds all of the boost libraries)
/path/to/mongo-cxx-driver-nightly
Link Binaries
In the Build Phases/Link Binary with Libraries settings:
Add the following binaries:
/path/to/mongo-cxx-driver-nightly/libmongoclient.a
/usr/local/lib/libboost_thread-mt.dylib
/usr/local/lib/libboost_system-mt.dylib
/usr/local/lib/libboost_filesystem-mt.dylib
/usr/local/lib/libboost_program_options-mt.dylib

Including and using libraries with autotools

I am an autotools newbie; I'm doing an application that needs to parse xml files, using xerces-c 3.1.
My code works fine when I install the xerces-c library with the apt-get utility (then xerces-c libraries and include files are installed in /usr/lib and /usr/include/xercesc, respectively). In my configure.ac file I have the following macro:
AC_CHECK_LIB([xerces-c],[main],[],[AC_MSG_ERROR([*** xerces-c lib not found])])
OK, as I said, this works as expected. However, I want to have the libraries inside the project directory (to be included in the distribution package), and here my problems begin.
I uninstall the xerces-c libraries, and I copy the xerces-c libraries (downloaded from the xerces-c webpage) to my project directory. Then, I add the to my confgure.ac the macro:
LDFLAGS="$LDFLAGS -L/home/xxxx/workspace/P3/src/lib"
Finally, I generate the makefiles and compile, just executing the following commands in the project root directory:
autoconf
automake
./configure
make
The compilation looks good, and the linking looks fine too:
g++ -g -O2 -L/home/xxxx/workspace/P3/src/lib -o app app-P3.o -lxerces-c
But when I execute the application I got an error like:
./src/app: error while loading shared libraries: libxerces-c-3.1.so: cannot open shared object file: No such file or directory
What I'm doing wrong?
Thanks in advance.
Since you are using a shared library libxerces-c-3.1.so needs to be somewhere where it can be found by ld. In the previous case where you installed the xerces-c package, libxerces was installed in /usr/lib or somewhere where it could be found. You can probably get it working for now by:
LD_LIBRARY_PATH=$PATH:/home/xxxx/workspace/P3/src/lib ./src/app
but this is something that you'll have to figure out eventually for your package install.