GNU C++ error
-
Hi,
When I compile my program on ARM64, I have no problems. However I switched to ARM 32-bit, and the MOC compilation fails with this:g++ -pipe -O2 -Wall -W -dM -E -o moc_predefs.h /usr/lib/arm-linux-gnueabihf/qt5/mkspecs/features/data/dummy.cpp /usr/lib/qt5/bin/moc -DQT_DEPRECATED_WARNINGS -DQT_NO_DEBUG -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_CORE_LIB --include /home/me/Desktop/myApp/moc_predefs.h -I/usr/lib/arm-linux-gnueabihf/qt5/mkspecs/linux-g++ -I/home/me/Desktop/myApp -I/home/me/Desktop/myApp -I/usr/include/arm-linux-gnueabihf/qt5 -I/usr/include/arm-linux-gnueabihf/qt5/QtWidgets -I/usr/include/arm-linux-gnueabihf/qt5/QtGui -I/usr/include/arm-linux-gnueabihf/qt5/QtCore -I/usr/include/c++/8 -I/usr/include/aarch64-linux-gnu/c++/8 -I/usr/include/c++/8/backward -I/usr/lib/gcc/aarch64-linux-gnu/8/include -I/usr/local/include -I/usr/lib/gcc/aarch64-linux-gnu/8/include-fixed -I/usr/include/aarch64-linux-gnu -I/usr/include MainWindow.h -o moc_MainWindow.cpp usr/include/c++/8/bits/functexcept.:42: Parse error at "std"
I'm using G++:
$ c++ --version c++ (Raspbian 8.3.0-6+rpi1) 8.3.0 Copyright (C) 2018 Free Software Foundation, Inc.
Am I supposed to be using a non-GNU C++ compiler?
-
Hi,
Are you natively building for arm32 or cross-compiling ?
As for non-gnu C++ compiler, no, no need for that.
-
Just to be sure, you run a 32bit distribution to build your application in 32bit and that fails ?
-
@SGaist Yes, that's correct.
Previously I was running 64-bit Raspberry pi OS to build a 64-bit executable and that built just fine.
Update: The 64-bit OS is really Debian whereas the 32-bit Rpi OS is their own creation. -
Since it's your code, where exactly does it fail ?
-
@SGaist It fails in the MOC code, which is not my code.
But it gives very little by way of clues, just the one line:usr/include/c++/8/bits/functexcept.:42: Parse error at "std"
That is in a .h file and here is the line:
namespace std _GLIBCXX_VISIBILITY(default)
Update: If you look closely, it is actually /usr/lib/qt5/bin/moc that produces the error.
-
That part is clear, but moc is running on one of your class so it would be good to know what you are using for it.
-
@SGaist I'm doing threading (main GUI thread and worker thread) and signals and slots.
Update: I think see the issue. Even though I ran qmake, the Makefile still has references to aarch64.
I type:
rm Makefile qmake grep aarch64 Makefile
... and it still makes reference to aarch64.
-
@Publicnamer said in GNU C++ error:
usr/include/c++/8/bits/functexcept.:42: Parse error at "std"
-
You should completely nuke the build folder to ensure you do a clean build.
-
That's why nuking the build folder and not just deleting its content is usually a good idea :-)
Glad you have it working and thanks for the feedback.
Please mark the thread as solved using the "Topic Tools" button or the three doted menu beside the answer you deem correct so that other forum members may know a solution has been found :-)