Open crosswick opened 1 year ago
asking GPT4 about these errors, it says:
_The errors you're seeing are due to the use of C++17 features in the Qt library, but your compiler is not set to use C++17. The features in question are the std::is_trivially_copyable_v, std::is_trivially_destructible_v, std::is_scalar_v, std::is_member_object_pointer_v, std::is_pointer_v, std::is_integral_v, and std::is_trivialv type traits, which are variable templates introduced in C++17.
To fix this, you need to set your C++ standard to C++17 in your CMakeLists.txt file. You can do this by adding the following line:
set(CMAKE_CXX_STANDARD 17)
This line should be added before the project(myApplication) line in your CMakeLists.txt file. This will set the C++ standard to C++17 for all targets in your project.
Adding this, deleting the build folder and running cmake .. and make again gives these errors:
In file included from /Users/steven/cmake-Qt5-example/build/myApplication_autogen/mocs_compilation.cpp:2:
/Users/steven/cmake-Qt5-example/build/myApplication_autogen/2TYNM7PALD/moc_MainWindow.cpp:16:2: error: "This file was generated using the moc from 5.15.10. It"
#error "This file was generated using the moc from 5.15.10. It"
^
/Users/steven/cmake-Qt5-example/build/myApplication_autogen/2TYNM7PALD/moc_MainWindow.cpp:17:2: error: "cannot be used with the include files from this version of Qt."
#error "cannot be used with the include files from this version of Qt."
^
/Users/steven/cmake-Qt5-example/build/myApplication_autogen/2TYNM7PALD/moc_MainWindow.cpp:18:2: error: "(The moc has changed too much.)"
#error "(The moc has changed too much.)"
^
/Users/steven/cmake-Qt5-example/build/myApplication_autogen/2TYNM7PALD/moc_MainWindow.cpp:35:1: error: use of undeclared identifier 'Q_STATIC_BYTE_ARRAY_DATA_HEADER_INITIALIZER_WITH_OFFSET'
QT_MOC_LITERAL(0, 0, 10) // "MainWindow"
^
/Users/steven/cmake-Qt5-example/build/myApplication_autogen/2TYNM7PALD/moc_MainWindow.cpp:29:5: note: expanded from macro 'QT_MOC_LITERAL'
Q_STATIC_BYTE_ARRAY_DATA_HEADER_INITIALIZER_WITH_OFFSET(len, \
^
/Users/steven/cmake-Qt5-example/build/myApplication_autogen/2TYNM7PALD/moc_MainWindow.cpp:66:1: error: unknown type name 'QT_INIT_METAOBJECT'
QT_INIT_METAOBJECT const QMetaObject MainWindow::staticMetaObject = { {
^
/Users/steven/cmake-Qt5-example/build/myApplication_autogen/2TYNM7PALD/moc_MainWindow.cpp:66:37: error: expected ';' after top level declarator
QT_INIT_METAOBJECT const QMetaObject MainWindow::staticMetaObject = { {
^
;
6 errors generated.
Asking GPT4 about these errors yields:
The errors you're seeing are due to a mismatch between the version of Qt used to generate the Meta-Object Compiler (moc) files and the version of Qt you're currently using to compile your project.
_The moc tool reads a C++ header file and generates additional C++ code that should be compiled and linked with the rest of the program. This generated code contains the QMetaObject code for the classes in your project that use the QOBJECT macro.
The error messages indicate that the moc files were generated using Qt version 5.15.10, but the Qt version you're currently using to compile your project is different and incompatible with these moc files.
To resolve this issue, you should:
1. Ensure that you're using the same version of Qt to generate the moc files and to compile your project. You can check your Qt version by running qmake --version in your terminal.
2. Delete the build directory and re-run CMake and make to regenerate the moc files and recompile your project. This ensures that all generated files are compatible with your current Qt version.
Here are the commands to do this:
rm -rf build
cmake .
make
Remember to replace build with your actual build directory if it's different.
running qmake --version
yields:
QMake version 3.1
Using Qt version 5.15.10 in /usr/local/Cellar/qt@5/5.15.10/lib
So that's not the issue. Please help - I have looked at the solution put forward in https://github.com/isl-org/Open3D/issues/2286 but in my Open3D CMakeLists.txt, GLIBCXX_USE_CXX11_ABI is already set to ON.
Hi @crosswick we recommend most users to download the prebuilt C++ binaries from GitHub releases for a consistent experience. Please follow these steps:
PS: GLIBCXX_USE_CXX11_ABI is only relevant for Linux.
@ssheorey thank you for your reply - which binary should I download though?
In the list of downloads for the 0.17 release, for macosx x86_64 I can only find open3d-app-macosx-0.17_x86_64.zip, which is only the Open3D app, not the library.
Ah, it must be open3d-devel-darwin-x86_64-0.17.0.tar.xz - right? Is there also a version for arm64, Apple Silicon? I may need that in the future.
That's correct - these are open3d-devel packages. We don't have one for Apple Silicon since GitHub doesn't provide test machines for Apple Silicon, but we will try to add it in the future. Please open a new issue for it so that it is easier to track.
This will help: https://github.com/github/roadmap/issues/528
Alright, I will open an issue requesting Apple Silicon devel support.
I would still be interested to learn how I can build from source myself in a way that the library works the same as the downloadable binary; I presume the goal is that there should be parity between the two methods, right?
Alright, I will open an issue requesting Apple Silicon devel support.
I would still be interested to learn how I can build from source myself in a way that the library works the same as the downloadable binary; I presume the goal is that there should be parity between the two methods, right?
Check the CI for that - it's pretty straightforward, but we sometimes have trouble due to incompatible dependency versions.
Thanks - how do I check the CI though? The macOS CI link on the main github page seems broken.
https://github.com/isl-org/Open3D/actions/workflows/macos.yml
The commands to run the CI are in the file: .github/workflows/macos.yml
Checklist
master
branch).Steps to reproduce the issue
I first cloned Open3D by:
Then, I built Open3D (on macOS 12.6.7) with:
This gave errors, leading me to comment out a bunch of unused variables in Feature.cpp, see https://github.com/isl-org/Open3D/issues/6268
then
make install
then build this simple cmake Qt5 example:
which succesfully runs this simple app.
Then, adding Open3D to this the CMakeLists.txt of this app:
Error message
Open3D, Python and System information
Additional information
No response