QT missing binary operator before token "(" Error - c++

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.

Related

QT moc class can not find the original file, despite it being in correct directory

I'm trying to build qt project but I keep getting error about no existing header in moc object moc_SerialPortManager.cpp. I moved with bash to that directory and used cd cmd with the path written in mock object and it leads to the correct directory. Does anybody have a slightest idea how to resolve it? At this point it's quite big project so just please tell me what could I publish to make this easier for you?
I have it all on git https://github.com/Orpiczy/AcornScanner/compare/fronAndBackJoin if you wish to check it out
I'm using Mingw compiler 8.1.0 64-bit for c++ and Qt 6.2.0, I'm working on windows10
moc_SerialPortManager.cpp
#include <memory>
#include "../../../../../../source/controllers/LowLevelFunctionality/DeviceController/ProfilometerManager/SerialPortManager.hpp"
#include <QtCore/qbytearray.h> ...
logs
E:\Dokumenty\AiR_rok_4\S7\EngineeringThesis\AcornScanner\cm\cm-lib\build\windows\gcc\x64\debug.moc\moc_SerialPortManager.cpp:10: error: ../../../../../../source/controllers/LowLevelFunctionality/DeviceController/ProfilometerManager/SerialPortManager.hpp: No such file or directory
........\AcornScanner\cm\cm-lib\build\windows\gcc\x64\debug.moc\moc_SerialPortManager.cpp:10:10: fatal error: ../../../../../../source/controllers/LowLevelFunctionality/DeviceController/ProfilometerManager/SerialPortManager.hpp: No such file or directory
#include "../../../../../../source/controllers/LowLevelFunctionality/DeviceController/ProfilometerManager/SerialPortManager.hpp"
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Note that the layout of your repository differs from your local filesystem:
.../debug/.moc/
vs.
.../debug.moc/
Therefore the relative path steps up one level too much and results in a non-existing path.
It is generally considered bad practice to put automatically generated files (i.e. moc files) under version control. I would assume if you remove the whole build directory and build again you will be fine.

Emacs - LSP compile_command.json file?

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.

"No such file or directory" error for hashlib++ library in CodeBlocks

I am coding a project in C++ in CodeBlocks, and I am trying to use the hashlib++ library, and I have it in my code as such:
#include <hashlibpp.h>
When I click "build and run", on that line of code I get the following error:
fatal error: hashlibpp.h: No such file or directory
I have the entire hashlib++ library in the same directory as my main.cpp file.
I was following the instructions on the documentation at http://hashlib2plus.sourceforge.net/doc/README.TXT.html
but either the instructions in sections 3.1 and 3.2 did not work or I did not follow them properly.
I would appreciate any insight as to why I am getting this error.
Ok, so I figured out what the issue was. By section 3.1,
Go to your project in the "Management" tab, and right-click the project you are working on. If you cannot see that section go to View > Manager, or press Shift + F2.
After right-clicking, select "add files..." and simply find and add the .h file you will be using. After it should show up in the "Management" section in a folder called "Headers".
Type in appropriate #include line in your code. I downloaded the entire hashlib2plus folder and put it in my project folder, so mine looked like
#include "hashlib2plus/trunk/src/hashlibpp.h"
Hope this resolves any issues in the future!

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!

Qt - qstring.h include string error

I am an admitted noob when it comes to Qt and compiling on linux, so forgive me if this is a simple mistake.
I am attempting to compile a program on Ubuntu 14.04 LTS using:
qmake myprogram.pro && make
This application uses Qt4. I am getting a strange error that appears to originate in Qt itself.
In file included from /usr/include/qt4/QtCore/qobject.h:48:0,
from /usr/include/qt4/QtCore/qiodevice.h:46,
from /usr/include/qt4/QtCore/QIODevice:1,
from src/qt/fervor/quazip/zip.c:22:
/usr/include/qt4/QtCore/qstring.h:54:20: fatal error: string: No such file or directory
# include <string>
^
I am guessing this is an environment issue rather than an issue with my program. I have poked around the web and some people have suggested c++ build essentials aren't installed. I have verified the Ubuntu build-essentials package is installed.
Thanks in advance!
EDIT
So I went into the core qt header file, qstring.h, and found a constant that needed to be defined for my environment (QT_NO_STL). When I define that, I get a new error:
In file included from /usr/include/qt4/QtCore/qlist.h:45:0,
from /usr/include/qt4/QtCore/qobject.h:50,
from /usr/include/qt4/QtCore/qiodevice.h:46,
from /usr/include/qt4/QtCore/QIODevice:1,
from src/qt/fervor/quazip/zip.c:14:
/usr/include/qt4/QtCore/qiterator.h:50:79: fatal error: new: No such file or directory
# include <new>
The credit really belongs to #KubaOber, but in the interest of helping others I am posting the answer that solved my problem.
Turns out that I added a dependency (library) and didn't re-create the .pro file with qmake -project.
Thanks!
In my case it worked by just adding the following in the <project>.pro file:
CONFIG += qt
OR add instead:
CONFIG += qt
QT += svg