Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compilation error on QT example #2111

Closed
khuck opened this issue Apr 22, 2016 · 3 comments
Closed

Compilation error on QT example #2111

khuck opened this issue Apr 22, 2016 · 3 comments

Comments

@khuck
Copy link
Contributor

khuck commented Apr 22, 2016

When building on my local system (which apparently has QT installed), the QT example is configured to build but the example fails to compile. The error message is:

Scanning dependencies of target qt_exe
[ 85%] Building CXX object examples/qt/CMakeFiles/qt_exe.dir/qt.cpp.o
/var/lib/buildbot/slaves/apex/master-hpx3/build/examples/qt/qt.cpp: In function ‘void qt_main(int, char**)’:
/var/lib/buildbot/slaves/apex/master-hpx3/build/examples/qt/qt.cpp:47:38: error: reference to ‘_1’ is ambiguous
     widget main(hpx::util::bind(run, _1, _2));
                                      ^
In file included from /var/lib/buildbot/slaves/apex/master-hpx3/build/hpx/lcos/detail/future_data.hpp:19:0,
                 from /var/lib/buildbot/slaves/apex/master-hpx3/build/hpx/lcos/future.hpp:22,
                 from /var/lib/buildbot/slaves/apex/master-hpx3/build/hpx/runtime/actions/action_support.hpp:14,
                 from /var/lib/buildbot/slaves/apex/master-hpx3/build/hpx/runtime/actions/transfer_action.hpp:15,
                 from /var/lib/buildbot/slaves/apex/master-hpx3/build/hpx/runtime/parcelset/parcel.hpp:14,
                 from /var/lib/buildbot/slaves/apex/master-hpx3/build/hpx/runtime/applier/applier.hpp:18,
                 from /var/lib/buildbot/slaves/apex/master-hpx3/build/hpx/runtime/components/server/create_component.hpp:13,
                 from /var/lib/buildbot/slaves/apex/master-hpx3/build/hpx/runtime/components/component_factory.hpp:46,
                 from /var/lib/buildbot/slaves/apex/master-hpx3/build/hpx/include/components.hpp:13,
                 from /var/lib/buildbot/slaves/apex/master-hpx3/build/hpx/include/runtime.hpp:10,
                 from /var/lib/buildbot/slaves/apex/master-hpx3/build/hpx/hpx.hpp:10,
                 from /var/lib/buildbot/slaves/apex/master-hpx3/build/examples/qt/qt.cpp:6:
/var/lib/buildbot/slaves/apex/master-hpx3/build/hpx/util/bind.hpp:47:53: note: candidates are: constexpr const hpx::util::detail::placeholder<1ul> hpx::util::placeholders::_1
         HPX_STATIC_CONSTEXPR detail::placeholder<1> _1 = {};
                                                     ^
In file included from /usr/include/boost/bind/bind.hpp:2030:0,
                 from /usr/include/boost/bind.hpp:22,
                 from /usr/include/boost/thread/pthread/once_atomic.hpp:19,
                 from /usr/include/boost/thread/once.hpp:20,
                 from /var/lib/buildbot/slaves/apex/master-hpx3/build/hpx/util/plugin/detail/dll_dlopen.hpp:20,
                 from /var/lib/buildbot/slaves/apex/master-hpx3/build/hpx/util/plugin/dll.hpp:20,
                 from /var/lib/buildbot/slaves/apex/master-hpx3/build/hpx/util/plugin/plugin_factory.hpp:15,
                 from /var/lib/buildbot/slaves/apex/master-hpx3/build/hpx/util/plugin.hpp:11,
                 from /var/lib/buildbot/slaves/apex/master-hpx3/build/hpx/runtime/components/component_registry_base.hpp:11,
                 from /var/lib/buildbot/slaves/apex/master-hpx3/build/hpx/runtime/components/component_registry.hpp:12,
                 from /var/lib/buildbot/slaves/apex/master-hpx3/build/hpx/include/components.hpp:11,
                 from /var/lib/buildbot/slaves/apex/master-hpx3/build/hpx/include/runtime.hpp:10,
                 from /var/lib/buildbot/slaves/apex/master-hpx3/build/hpx/hpx.hpp:10,
                 from /var/lib/buildbot/slaves/apex/master-hpx3/build/examples/qt/qt.cpp:6:
/usr/include/boost/bind/placeholders.hpp:55:15: note:                 boost::arg<1> {anonymous}::_1
 boost::arg<1> _1;
               ^
/var/lib/buildbot/slaves/apex/master-hpx3/build/examples/qt/qt.cpp:47:42: error: reference to ‘_2’ is ambiguous
     widget main(hpx::util::bind(run, _1, _2));
                                          ^
In file included from /var/lib/buildbot/slaves/apex/master-hpx3/build/hpx/lcos/detail/future_data.hpp:19:0,
                 from /var/lib/buildbot/slaves/apex/master-hpx3/build/hpx/lcos/future.hpp:22,
                 from /var/lib/buildbot/slaves/apex/master-hpx3/build/hpx/runtime/actions/action_support.hpp:14,
                 from /var/lib/buildbot/slaves/apex/master-hpx3/build/hpx/runtime/actions/transfer_action.hpp:15,
                 from /var/lib/buildbot/slaves/apex/master-hpx3/build/hpx/runtime/parcelset/parcel.hpp:14,
                 from /var/lib/buildbot/slaves/apex/master-hpx3/build/hpx/runtime/applier/applier.hpp:18,
                 from /var/lib/buildbot/slaves/apex/master-hpx3/build/hpx/runtime/components/server/create_component.hpp:13,
                 from /var/lib/buildbot/slaves/apex/master-hpx3/build/hpx/runtime/components/component_factory.hpp:46,
                 from /var/lib/buildbot/slaves/apex/master-hpx3/build/hpx/include/components.hpp:13,
                 from /var/lib/buildbot/slaves/apex/master-hpx3/build/hpx/include/runtime.hpp:10,
                 from /var/lib/buildbot/slaves/apex/master-hpx3/build/hpx/hpx.hpp:10,
                 from /var/lib/buildbot/slaves/apex/master-hpx3/build/examples/qt/qt.cpp:6:
/var/lib/buildbot/slaves/apex/master-hpx3/build/hpx/util/bind.hpp:48:53: note: candidates are: constexpr const hpx::util::detail::placeholder<2ul> hpx::util::placeholders::_2
         HPX_STATIC_CONSTEXPR detail::placeholder<2> _2 = {};
                                                     ^
In file included from /usr/include/boost/bind/bind.hpp:2030:0,
                 from /usr/include/boost/bind.hpp:22,
                 from /usr/include/boost/thread/pthread/once_atomic.hpp:19,
                 from /usr/include/boost/thread/once.hpp:20,
                 from /var/lib/buildbot/slaves/apex/master-hpx3/build/hpx/util/plugin/detail/dll_dlopen.hpp:20,
                 from /var/lib/buildbot/slaves/apex/master-hpx3/build/hpx/util/plugin/dll.hpp:20,
                 from /var/lib/buildbot/slaves/apex/master-hpx3/build/hpx/util/plugin/plugin_factory.hpp:15,
                 from /var/lib/buildbot/slaves/apex/master-hpx3/build/hpx/util/plugin.hpp:11,
                 from /var/lib/buildbot/slaves/apex/master-hpx3/build/hpx/runtime/components/component_registry_base.hpp:11,
                 from /var/lib/buildbot/slaves/apex/master-hpx3/build/hpx/runtime/components/component_registry.hpp:12,
                 from /var/lib/buildbot/slaves/apex/master-hpx3/build/hpx/include/components.hpp:11,
                 from /var/lib/buildbot/slaves/apex/master-hpx3/build/hpx/include/runtime.hpp:10,
                 from /var/lib/buildbot/slaves/apex/master-hpx3/build/hpx/hpx.hpp:10,
                 from /var/lib/buildbot/slaves/apex/master-hpx3/build/examples/qt/qt.cpp:6:
/usr/include/boost/bind/placeholders.hpp:56:15: note:                 boost::arg<2> {anonymous}::_2
 boost::arg<2> _2;
               ^
examples/qt/CMakeFiles/qt_exe.dir/build.make:60: recipe for target 'examples/qt/CMakeFiles/qt_exe.dir/qt.cpp.o' failed
make[3]: *** [examples/qt/CMakeFiles/qt_exe.dir/qt.cpp.o] Error 1
CMakeFiles/Makefile2:9183: recipe for target 'examples/qt/CMakeFiles/qt_exe.dir/all' failed
make[2]: *** [examples/qt/CMakeFiles/qt_exe.dir/all] Error 2
make[2]: *** Waiting for unfinished jobs....
Linking CXX executable ../../bin/vector_counting_dotproduct
[ 85%] Built target vector_counting_dotproduct_exe
CMakeFiles/Makefile2:998: recipe for target 'CMakeFiles/examples.dir/rule' failed
make[1]: *** [CMakeFiles/examples.dir/rule] Error 2
Makefile:537: recipe for target 'examples' failed
make: *** [examples] Error 2
@K-ballo
Copy link
Member

K-ballo commented Apr 22, 2016

It seems boost::bind is finding its way into the code, indirectly via some other #include. Boost.Bind defines placeholders in the global namespace (bad), which results in this kind of ambiguity. We'll need to avoid using namespace hpx::util::placeholders here and everywhere else.

@K-ballo
Copy link
Member

K-ballo commented Apr 22, 2016

Should be fixed by 7b957b2. Would you try it out and report back?

@gentryx
Copy link
Member

gentryx commented Apr 22, 2016

Fixes it for me, thanks!

@hkaiser hkaiser closed this as completed May 1, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants