Vulkan SDK Version 1.1.85.0 linking on Kubuntu 18.10 - c++

I'm currently working on a game engine with vulkan.
I just wanted to try whether it compiles on linux, but I don't know how to link my Vulkan SDK libraries. I downloaded the "vulkansdk-linux-x86_64-1.1.85.0.tar.gz" from the LunarG homepage, but now I dont know what I should link under "target_link_libraries".
I tried to link the "libvulkan.so" from the lib folder, but it does not work.
Some help from you would be great, because I never worked with CMAKE on linux.
/usr/bin/ld: cannot find -lvulkan
collect2: error: ld returned 1 exit status
make[3]: *** [CMakeFiles/Untitled.dir/build.make:669: ../output_linux /Untitled] Error 1
make[2]: *** [CMakeFiles/Makefile2:73: CMakeFiles/Untitled.dir/all] Error 2
make[1]: *** [CMakeFiles/Makefile2:85: CMakeFiles/Untitled.dir/rule] Error 2
make: *** [Makefile:118: Untitled] Error 2
Thanks for help,
Marlon

The SDK's Linux Getting Started Guide found in your SDK tarball and at this link explains much of this. In fact, there's even a section called "Using Vulkan in CMake Projects" that shows how to use the FindVulkan CMake module. The SDK also contains numerous example programs, also built with CMake.

Related

linking error cxx: cannot find -lvulkan

When I tried to compile example from Anvil framework for Vulkan I get following errors:
[ 97%] Linking CXX executable OutOfOrderRasterization
/usr/bin/ld: cannot find -lvulkan
collect2: error: ld returned 1 exit status
CMakeFiles/OutOfOrderRasterization.dir/build.make:126: recipe for target 'OutOfOrderRasterization' failed
make[2]: *** [OutOfOrderRasterization] Error 1
CMakeFiles/Makefile2:72: recipe for target 'CMakeFiles/OutOfOrderRasterization.dir/all' failed
make[1]: *** [CMakeFiles/OutOfOrderRasterization.dir/all] Error 2
Makefile:83: recipe for target 'all' failed
make: *** [all] Error 2
How i need to configure Vulkan to resolve it? (Ubuntu)
Check you LIBRARY paths. You might need to download and install vulkan. There should a .so file in one your library paths(/usr/lib{,64},/lib{,64}, /usr/share/lib{,64}) named to the effect of libvulkan.numbers.so.
See this ask ubuntu question: https://askubuntu.com/questions/796442/ld-cannot-find-lvulkan
CMake versions 3.7 and later ship with a FindVulkan.cmake module that finds the Vulkan includes and library for you if you have a Vulkan SDK installed and the VULKAN_SDK environment variable set. The CMake module also finds the includes and library if you have installed a Vulkan package to your system directories. The Getting Started guide on the LunarXchange website has some additional detail.

opencv installation error ubuntu

I'm trying to install opencv to my Ubuntu 14.04 machine using the documentation provided in
http://docs.opencv.org/doc/tutorials/introduction/linux_install/linux_install.html#linux-installation
However, during the compilation process I get the following error.
Linking CXX shared library ../../lib/libopencv_videoio.so
/usr/bin/ld: /usr/local/lib/libavcodec.a(avpacket.o): relocation R_X86_64_32 against `.rodata.str1.1' can not be used when making a shared object; recompile with -fPIC
/usr/local/lib/libavcodec.a: error adding symbols: Bad value
collect2: error: ld returned 1 exit status
make[2]: *** [lib/libopencv_videoio.so.3.0.0] Error 1
make[1]: *** [modules/videoio/CMakeFiles/opencv_videoio.dir/all] Error 2
make: *** [all] Error 2
I noticed a few posts mentioning similar errors and some solutions suggest removing the libavcodec.a from /usr/local/lib/. I'd like not to do that as I need ffmpeg libraries in the machine as well.
Could someone please help me to resolve this issue?.
Thanks
I got it to work (for installing ffmpeg) by simply reinstalling the whole thing from the beginning with all instances of $ ./configure replaced by $ ./configure --enable-shared (first make sure to delete all the folders and files including the .so files from the previous attempt).
Apparently this works because https://stackoverflow.com/a/13812368/10593190.
And this matches with #camino's comment on https://stackoverflow.com/a/19365454/10593190 and XavierStuvw's answer.
Just run these 2 lines in your terminal/environment:
pip install opencv-python==3.4.5.20
pip install opencv-contrib-python==3.4.5.20

Compiling opencv for ARM platform

I want to put C++ opencv algorithm on ARM-Linux based camera.
I am able to do Configure and Generate steps for opencv build using CMake.
Then when I try to do “make” operation on terminal I am facing some issue.
->>>>>>>>>>>>>>>>>Issue->>>
Linking CXX shared library ../../lib/libopencv_core.so
/opt/montavista_pro_arm_v5t_le/bin/../lib/gcc/armv5tl-montavista-linux-gnueabi/4.2.0/../../../../armv5tl-montavista-linux-gnueabi/bin/ld: cannot find -lz
collect2: ld returned 1 exit status
make[2]: *** [lib/libopencv_core.so.3.0.0] Error 1
make[1]: *** [modules/core/CMakeFiles/opencv_core.dir/all] Error 2
make: *** [all] Error 2
->>>>>>>>>>>>>>>>
I searched online. I tried to do some stuff from link http://answers.opencv.org/question/33564/opencv-master-branch-compilation-issue/ . I removed ${ZLIB_LIBRARIES} option in modules/core/CMakeLists.txt.
But still I am facing same issue.
Can you please help me with that.

Compiling ROS on RPI fails at opencv with undefined reference to 'header'

I'm trying to compile ROS (Robot Operating System) on a Raspberry Pi (Raspbian) following these instructions and got to the point to compile ROS, which fails at compiling opencv with undefined reference to 'header':
[ 97%] Built target opencv_videostab
[ 98%] Built target opencv_haartraining_engine
Linking CXX executable ../../bin/opencv_createsamples
../../lib/libopencv_highgui.so.2.4.6: undefined reference to `header'
collect2: ld returned 1 exit status
make[2]: *** [bin/opencv_createsamples] Error 1
make[1]: *** [apps/haartraining/CMakeFiles/opencv_createsamples.dir/all] Error 2
make: *** [all] Error 2
<== Failed to process package 'opencv2':
Command '/home/ilagi/ros_catkin_ws/install_isolated/env.sh make -j1 -l1' returned non-zero exit status 2
I googled to try to figure out what header file might be missing, but unfortunately didn't get anywhere.
I hope somebody will have an idea about at least the directions to go from here.
Thanks
I guess I'm going to answer my own question. I don't exactly know which dependency caused this particular error, but I had recompiled ffmpeg based on the instructions provided at http://ariandy1.wordpress.com/2013/02/13/raspberry-pi-rasbian-opencv/ and now I managed to get ROS to compile opencv.

Project Compilation Error - cannot find -lwxmsw28

While compiling a project i get the following error as
c:/mingw/bin/../lib/gcc/mingw32/4.6.2/../../../../mingw32/bin/ld.exe: cannot find lwxmsw28
collect2: ld returned 1 exit status
make[2]: *** [dist/Debug/MinGW-Windows/libRegistration.dll] Error 1
make[1]: *** [.build-conf] Error 2
make: *** [.build-impl] Error 2
I am using wxwidgets libraries however when i ran a command in cmd as
wx-config --libs
i could not see lwxmsw28 either let me know if it is downloadable from somewhere or any workaround to resolve this issue.
Thanks
This is a linker error, rather than a compilation error.
"lwxmsw28" looks to me like a wxwidgets v2.8 microsoft windows library. Should the linker be looking for this? Since you are using mingw, I would think you should NOT be linking to msw libraries. However, I am not familiar with mingw, so maybe this is the name used for mingw libraries.
If this is the correct library, then the next question is: have you built the wxWidgets libraries? The libraries are NOT "downloadable from somewhere" - you must download the source and build the libraries yourself.
A simple test to find out if you have built the libraries - try to build one of the sample projects.