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

Error when compiling on Arch Linux #405

Closed
Knezzen opened this issue Aug 15, 2021 · 3 comments
Closed

Error when compiling on Arch Linux #405

Knezzen opened this issue Aug 15, 2021 · 3 comments
Labels

Comments

@Knezzen
Copy link
Contributor

Knezzen commented Aug 15, 2021

Hi! Getting this error when trying to compile on Arch since some time. I think a later version of boot broke it somewhat.

   36 | BOOST_PRAGMA_MESSAGE(
      | ^~~~~~~~~~~~~~~~~~~~
[  7%] Building CXX object libtransport/CMakeFiles/transport.dir/Conversation.cpp.o
In file included from /home/knez/spectrum2/libtransport/Conversation.cpp:22:
/home/knez/spectrum2/include/transport/Conversation.h:187:22: error: ‘map’ in namespace ‘std’ does not name a template type
  187 |                 std::map<std::string, Participant> m_participants;
      |                      ^~~
In file included from /home/knez/spectrum2/libtransport/Conversation.cpp:22:
/home/knez/spectrum2/include/transport/Conversation.h:28:1: note: ‘std::map’ is defined in header ‘<map>’; did you forget to ‘#include <map>’?
   27 | #include "Swiften/Elements/Presence.h"
  +++ |+#include <map>
   28 | 
In file included from /usr/include/boost/smart_ptr/detail/sp_thread_sleep.hpp:22,
                 from /usr/include/boost/smart_ptr/detail/yield_k.hpp:23,
                 from /usr/include/boost/smart_ptr/detail/spinlock_gcc_atomic.hpp:14,
                 from /usr/include/boost/smart_ptr/detail/spinlock.hpp:42,
                 from /usr/include/boost/smart_ptr/detail/spinlock_pool.hpp:25,
                 from /usr/include/boost/smart_ptr/shared_ptr.hpp:29,
                 from /usr/include/boost/shared_ptr.hpp:17,
                 from /usr/include/boost/signals2/deconstruct.hpp:28,
                 from /usr/include/boost/signals2.hpp:15,
                 from /home/knez/spectrum2/include/transport/User.h:25,
                 from /home/knez/spectrum2/libtransport/Conversation.cpp:24:
/usr/include/boost/bind.hpp:36:1: note: ‘#pragma message: The practice of declaring the Bind placeholders (_1, _2, ...) in the global namespace is deprecated. Please use <boost/bind/bind.hpp> + using namespace boost::placeholders, or define BOOST_BIND_GLOBAL_PLACEHOLDERS to retain the current behavior.’
   36 | BOOST_PRAGMA_MESSAGE(
      | ^~~~~~~~~~~~~~~~~~~~
/home/knez/spectrum2/libtransport/Conversation.cpp: In member function ‘void Transport::Conversation::handleMessage(std::shared_ptr<Swift::Message>&, const string&, bool)’:
/home/knez/spectrum2/libtransport/Conversation.cpp:223:67: error: ‘m_participants’ was not declared in this scope; did you mean ‘getParticipants’?
  223 |                 std::map<std::string, Participant>::iterator it = m_participants.find(n);
      |                                                                   ^~~~~~~~~~~~~~
      |                                                                   getParticipants
/home/knez/spectrum2/libtransport/Conversation.cpp: In member function ‘std::string Transport::Conversation::getParticipants()’:
/home/knez/spectrum2/libtransport/Conversation.cpp:328:64: error: ‘m_participants’ was not declared in this scope; did you mean ‘getParticipants’?
  328 |         for (std::map<std::string, Participant>::iterator it = m_participants.begin(); it != m_participants.end(); it++) {
      |                                                                ^~~~~~~~~~~~~~
      |                                                                getParticipants
/home/knez/spectrum2/libtransport/Conversation.cpp: In member function ‘void Transport::Conversation::sendParticipants(const Swift::JID&, const string&)’:
/home/knez/spectrum2/libtransport/Conversation.cpp:362:64: error: ‘m_participants’ was not declared in this scope; did you mean ‘getParticipants’?
  362 |         for (std::map<std::string, Participant>::iterator it = m_participants.begin(); it != m_participants.end(); it++) {
      |                                                                ^~~~~~~~~~~~~~
      |                                                                getParticipants
/home/knez/spectrum2/libtransport/Conversation.cpp: In member function ‘void Transport::Conversation::handleRawPresence(Swift::Presence::ref)’:
/home/knez/spectrum2/libtransport/Conversation.cpp:495:9: error: ‘m_participants’ was not declared in this scope; did you mean ‘getParticipants’?
  495 |         m_participants[presence->getFrom().getResource()].presence = presence;
      |         ^~~~~~~~~~~~~~
      |         getParticipants
/home/knez/spectrum2/libtransport/Conversation.cpp: In member function ‘void Transport::Conversation::handleParticipantChanged(const string&, Transport::Conversation::ParticipantFlag, int, const string&, const string&, const string&, const string&)’:
/home/knez/spectrum2/libtransport/Conversation.cpp:511:17: error: ‘m_participants’ was not declared in this scope; did you mean ‘getParticipants’?
  511 |                 m_participants.erase(nick);
      |                 ^~~~~~~~~~~~~~
      |                 getParticipants
/home/knez/spectrum2/libtransport/Conversation.cpp:514:17: error: ‘m_participants’ was not declared in this scope; did you mean ‘getParticipants’?
  514 |                 m_participants[nick].presence = presence;
      |                 ^~~~~~~~~~~~~~
      |                 getParticipants
make[2]: *** [libtransport/CMakeFiles/transport.dir/build.make:132: libtransport/CMakeFiles/transport.dir/Conversation.cpp.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:492: libtransport/CMakeFiles/transport.dir/all] Error 2
make: *** [Makefile:156: all] Error 2
@vitalyster
Copy link
Collaborator

Can you follow a compiler suggestion and add #include <map> to Conversation.h file?

@Knezzen
Copy link
Contributor Author

Knezzen commented Aug 15, 2021

Thank you, that worked!

Knezzen added a commit to Knezzen/spectrum2 that referenced this issue Aug 15, 2021
Added the include needed for Spectrum2 to compile mentioned in SpectrumIM#405
@vitalyster vitalyster added the Bug label Aug 18, 2021
@vitalyster
Copy link
Collaborator

Fixed with #406

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants