PDA

View Full Version : boost issue when compiling a qt project



luke9511
23rd May 2018, 16:54
hey everyone i am trying to compile a qt project on os x 10.13.4 and have tried boost 1.57, 1.59, 1.60 and 1.66, here is the error i need help with

In file included from src/txdb-leveldb.cpp:9:
In file included from /usr/local/opt/boost@1.60/include/boost/filesystem.hpp:16:
/usr/local/opt/boost@1.60/include/boost/filesystem/path.hpp:153:55: error: no member named 'move' in namespace 'std'
path(path&& p) BOOST_NOEXCEPT { m_pathname = std::move(p.m_pathname); }
~~~~~^
/usr/local/opt/boost@1.60/include/boost/filesystem/path.hpp:155:27: error: no member named 'move' in namespace 'std'
{ m_pathname = std::move(p.m_pathname); return *this; }
~~~~~^
In file included from src/txdb-leveldb.cpp:9:
In file included from /usr/local/opt/boost@1.60/include/boost/filesystem.hpp:17:
/usr/local/opt/boost@1.60/include/boost/filesystem/operations.hpp:281:22: error: no member named 'move' in namespace 'std'
m_value = std::move(rhs.m_value);
~~~~~^
/usr/local/opt/boost@1.60/include/boost/filesystem/operations.hpp:282:22: error: no member named 'move' in namespace 'std'
m_perms = std::move(rhs.m_perms);
~~~~~^
/usr/local/opt/boost@1.60/include/boost/filesystem/operations.hpp:286:22: error: no member named 'move' in namespace 'std'
m_value = std::move(rhs.m_value);
~~~~~^
/usr/local/opt/boost@1.60/include/boost/filesystem/operations.hpp:287:22: error: no member named 'move' in namespace 'std'
m_perms = std::move(rhs.m_perms);
~~~~~^
/usr/local/opt/boost@1.60/include/boost/filesystem/operations.hpp:775:19: error: no member named 'move' in namespace 'std'
m_path = std::move(rhs.m_path);
~~~~~^
/usr/local/opt/boost@1.60/include/boost/filesystem/operations.hpp:776:21: error: no member named 'move' in namespace 'std'
m_status = std::move(rhs.m_status);
~~~~~^
/usr/local/opt/boost@1.60/include/boost/filesystem/operations.hpp:777:29: error: no member named 'move' in namespace 'std'
m_symlink_status = std::move(rhs.m_symlink_status);
~~~~~^
/usr/local/opt/boost@1.60/include/boost/filesystem/operations.hpp:781:19: error: no member named 'move' in namespace 'std'
m_path = std::move(rhs.m_path);
~~~~~^
/usr/local/opt/boost@1.60/include/boost/filesystem/operations.hpp:782:21: error: no member named 'move' in namespace 'std'
m_status = std::move(rhs.m_status);
~~~~~^
/usr/local/opt/boost@1.60/include/boost/filesystem/operations.hpp:783:29: error: no member named 'move' in namespace 'std'
m_symlink_status = std::move(rhs.m_symlink_status);
~~~~~^
In file included from src/txdb-leveldb.cpp:17:
In file included from src/kernel.h:7:
In file included from src/main.h:14:
In file included from src/core.h:9:
In file included from src/serialize.h:23:
In file included from src/allocators.h:11:
In file included from /usr/local/opt/boost@1.60/include/boost/thread/mutex.hpp:16:
In file included from /usr/local/opt/boost@1.60/include/boost/thread/pthread/mutex.hpp:16:
In file included from /usr/local/opt/boost@1.60/include/boost/thread/lock_types.hpp:11:
/usr/local/opt/boost@1.60/include/boost/thread/detail/move.hpp:31:10: fatal error: 'type_traits' file not found
#include <type_traits>
^~~~~~~~~~~~~
13 errors generated.
make[1]: *** [build/txdb-leveldb.o] Error 1
make: *** [release] Error 2
09:02:34: The process "/usr/bin/make" exited with code 2.
Error while building/deploying project flapx-qt (kit: QT 5.11)
When executing step "Make"

i have been told that my gcc is out of date but i do not know how to update it, if i do gcc --version i see 4.2.1 and if i do clang --version i see 9.1.0, i tried installing a updated version through homebrew but i cant get qt to use it and i still get the above error, i also tried switching it to clang for both c and c++ and got the same error above.

if anyone has any more advice please let me know thanks

d_stranz
23rd May 2018, 21:33
The move() template method didn't appear in the STL until C++-11. If your compiler isn't fully C++-11 compliant, then code using this won't compile. Your only solution is to try to find a C++-11 compiler -and- a C++-11 version of the STL.

Note that you also need to set the C++ compiler flags -std=c++11, -stdlib=libc++, and -mmacosx-version-min=10.7

luke9511
24th May 2018, 19:19
The move() template method didn't appear in the STL until C++-11. If your compiler isn't fully C++-11 compliant, then code using this won't compile. Your only solution is to try to find a C++-11 compiler -and- a C++-11 version of the STL.

Note that you also need to set the C++ compiler flags -std=c++11, -stdlib=libc++, and -mmacosx-version-min=10.7

is it possible to update the compiler?

d_stranz
25th May 2018, 16:39
I do Mac builds with gcc 4.2.1 and the compiler options I showed above. It is possible I don't exercise the same parts of boost or STL as your code (since templates aren't instantiated unless used), but I don't see errors related to boost or STL. You probably need to update your C++ Standard Library, not your compiler.

luke9511
25th May 2018, 18:16
well i managed to get past all the errors and get the project compiled, i have now moved on to a new one and am getting the following errors, also thank you very much for all your help!

src/qt/multisenddialog.cpp:76:25: error: member access into incomplete type 'QStyle'
ui->message->style()->polish(ui->message);
^
/usr/local/Qt-5.11.0/lib/QtWidgets.framework/Headers/qwidget.h:67:7: note: forward declaration of 'QStyle'
class QStyle;
^
src/qt/multisenddialog.cpp:90:29: error: member access into incomplete type 'QStyle'
ui->message->style()->polish(ui->message);
^
/usr/local/Qt-5.11.0/lib/QtWidgets.framework/Headers/qwidget.h:67:7: note: forward declaration of 'QStyle'
class QStyle;
^
src/qt/multisenddialog.cpp:105:29: error: member access into incomplete type 'QStyle'
ui->message->style()->polish(ui->message);
^
/usr/local/Qt-5.11.0/lib/QtWidgets.framework/Headers/qwidget.h:67:7: note: forward declaration of 'QStyle'
class QStyle;
^
src/qt/multisenddialog.cpp:113:29: error: member access into incomplete type 'QStyle'
ui->message->style()->polish(ui->message);
^
/usr/local/Qt-5.11.0/lib/QtWidgets.framework/Headers/qwidget.h:67:7: note: forward declaration of 'QStyle'
class QStyle;
^
src/qt/multisenddialog.cpp:125:25: error: member access into incomplete type 'QStyle'
ui->message->style()->polish(ui->message);
^
/usr/local/Qt-5.11.0/lib/QtWidgets.framework/Headers/qwidget.h:67:7: note: forward declaration of 'QStyle'
class QStyle;
^
src/qt/multisenddialog.cpp:188:25: error: member access into incomplete type 'QStyle'
ui->message->style()->polish(ui->message);
^
/usr/local/Qt-5.11.0/lib/QtWidgets.framework/Headers/qwidget.h:67:7: note: forward declaration of 'QStyle'
class QStyle;
^
src/qt/multisenddialog.cpp:204:25: error: member access into incomplete type 'QStyle'
ui->message->style()->polish(ui->message);
^
/usr/local/Qt-5.11.0/lib/QtWidgets.framework/Headers/qwidget.h:67:7: note: forward declaration of 'QStyle'
class QStyle;
^
7 errors generated.
make: *** [build/multisenddialog.o] Error 1
12:10:45: The process "/usr/bin/make" exited with code 2.
Error while building/deploying project 1337-qt (kit: QT 5.11)
When executing step "Make"
12:10:45: Elapsed time: 00:09.

d_stranz
26th May 2018, 16:55
You haven't #include-d the QStyle header file into whatever file it is you are trying to compile. Your "multisenddialog.h" or "ui_*.h" file forward-references the class with a statement like "class QStyle;", which tells the compiler that a class by that name exists, but until you include the actual QStyle header file, it has no idea what that class looks like.

You need to spend a little time learning to use the toolchain you are trying to build your projects with.

luke9511
27th May 2018, 06:16
You haven't #include-d the QStyle header file into whatever file it is you are trying to compile. Your "multisenddialog.h" or "ui_*.h" file forward-references the class with a statement like "class QStyle;", which tells the compiler that a class by that name exists, but until you include the actual QStyle header file, it has no idea what that class looks like.

You need to spend a little time learning to use the toolchain you are trying to build your projects with.

i dont code i only compile thats as far as my talents in this area go, i did not make this project i only compile it, it should be known i can compile this just fine on windows but not on mac

luke9511
29th May 2018, 16:41
i managed to get three different projects compiled however the version of openssl i used will cause issues down the road, so i tried using a different version and go this error

https://pastebin.com/WF4KavFM