Emacs - LSP compile_command.json file? - c++

I m in Arcolinux guyz, I am using clang-lsp in my Emacs.
I m new to programming but I need to prepare a project about Opencv(C++). Whenever I try a script , there is always warning like #include <opencv2/opencv.hpp> file not found ? I have found some things in the internet like command_compile.json but they all uses cmake, when I try to do that, I got following error:
cmake -DCMAKE_EXPORT_COMPILE_COMMDANS=ON /usr/include/opencv4/opencv2/
CMake Error: The source directory "/usr/include/opencv4/opencv2" does not appear to contain CMakeLists.txt.
Can anyone help me ? it is really annoying.
One more question:
My opencv folder is in /usr/include/opencv4/opencv2/ , but my project folder is in ~/Projects/opencv++/
Thanks for attention.
Regards.

Related

Linking between two workspaces in ROS 2

I know I should ask in RosAnswers - I did actually but nobody ever answered and I still struggle with this so I thought I should try asking here.
To keep everything neat and clean I have a dev_ws with my packages and a tools_ws with all other packages (vision_opencv, perception_pcl etc.).
Now I´m not sure why but when I try to include header files from packages in tools_ws in my own dev_ws packages colcon is unable to find those headers. So if I try to add #include <pcl_conversions pcl_conversions.h> in my header file the error message will read
/home/test_ws/src/test_pkg/include/CameraAdapter.h:8:10: fatal error:
pcl_conversions/pcl_conversions.h: No such file or directory #include
<pcl_conversions/pcl_conversions.h>
I usually just add <depend>pcl_conversions</depend> in my package.xml and find_package(pcl_conversions REQUIRED) in my CMakeList.txt
The tools_ws is sourced and ros2 is able to find launchfiles etc in there and my python nodes are able to use packages from tools_ws, just using include files in Cpp isn´t working. I´m quite sure the answer is really simple, probably just a line in my CMakeList but I didn´t manage to find anything in the Ros2 Documentation or via googling.
Do you have any idea what I´m doing wrong?

QT missing binary operator before token "(" Error

I am using QT 5.7.1 and trying to build this experimental project.
But when i try to build, i get this error in qchar.h file:
D:/QT2/5.7/mingw53_32/include/QtCore/qchar.h:333:24: error: missing binary operator before token "("
#if QT_DEPRECATED_SINCE(5, 3)
There is only one version of QT is installed right now, and i controlled the file path of qchar.h. It is in QTCore folder. I tried google search based solutions but i could not build.
I have been googling for 2 days now, no solutions yet. I appreciate if anyone helps.
I found that file "signal.h" hides a file in QT include directory. I renamed the "signal.h" file to "QRPsignal.h" and solved the problem.
Also, when you rename "signal.h" file (of QRadioPredict) using QT, QT renames original include file in its own directory too. You should rename again the original file (of QT) to "signal.h".
In case anyone trying to build QRadioPredict on Windows, should keep this in mind.
Thank you for your suggestions.

Compiling C++ file with CMAKE (Unrecognized '-rdynamic')

I am trying to add a single C++ file to a working CMAKE project.
The project is building fine when I only have C files in the project. However, as soon as I add a cpp file to the ADD_EXECUTABLE section of CMakeLists.txt I get the following error: arm-none-eabi-gcc: error: unrecognized command line option '-rdynamic'.
Does anyone have any idea what might be going on here? Or what I could do to fix it?
Thanks so much for the help!
PS - I have a section at the top of the CMakeLists.txt that says SET(CMAKE_SHARED_LIBRARY_LINK_C_FLAGS) # get rid of -rdynamic, but it doesn't seem to be doing that.
Check the armgcc.cmake (or equivalent). I found a field there named CMAKE_SYSTEM_NAME and CMAKE_SYSTEM. These need to be renamed to 'Generic'. This took care of the problem for me.

using CUTE in Eclipse: fatal error: boost/type_traits/is_integral.hpp: No such file or directory

I'm a absolute newbie in Eclipse at least when it comes to using C++. Now I've found this Plugin for testing and followed the "instructions" (yeah well i created a cute project). When i try to build the sample Project i get the following error:
fatal error: boost/type_traits/is_integral.hpp: No such file or directory
the faliure is in file cute_determine_traits.h in the Project/cute directory where all of CUTE's includes are. The line it the program crashe is this one:
#include <boost/type_traits/is_integral.hpp>
Actually i don't have any idea what I'm supposed to do.. I'd be very very happy for some easy instructions how to fix this! I'm using Eclipse c++.
UPDATE:
Okay, I found the issue. I installed boost the wrong way. It worked as soon as i ran the bootstrap.bat using mingw. I followed this Video http://www.youtube.com/watch?v=qDVRrSzsqco and then my includes worked.
Thanks everybody! :)
Geetings.
I had the same problem minutes ago. I realized I haven't install boost library when I was installing cute plug-in (boost can be found when you go to Help->Install New Software... and once you write the address http://www.cute-test.com/updatesite in "Work with" then choose CUTE Optional Features->Boost For CUTE).
Or maybe i haven't choosen the "Copy Boost headers into project" option... Anyways, I think both can solved your issue too.
Farewell!

"fatal error U1087: cannot have : and :: dependents for same target"

Using the Microsoft Driver Development Kit (DDK), this error plagued me as I attempted even to build the default drivers included with the DDK.
I had a some difficulty in tracking down the cause and solution through Google. In an effort to aid others who may experience this same problem, I am documenting it here.
Error:
"fatal error U1087: cannot have : and :: dependents for same target"
Solution:
Make sure that the directory you are building in contains no spaces.
There may be other causes and solutions to this error, so please post below if you have others. This is the solution that worked immediately for me.
Tthe solution to this problem is to ensure that there are no spaces in the build directory.
It's not just the build directory itself, e.g 'My Project'. I had the problem when the build directory was placed in the 'My Documents' directory.
Using the short version of the path works fine, no need to move your files.
This fails:
cd "D:\My Documents\My Projects\Project 1"
build
This works:
cd D:\MyDocu~1\MyProj~1\Projec~1
build
Driver source code directory should have no white spaces.
This can also occur if the build state becomes excessively out-of-date, in which case it is fixed by a clean (-c).