essej / aooserver

AoO console server
76 stars 26 forks source link

make: *** [Makefile:109: build/intermediate/Release/client_305e502e.o] Error 1 #9

Closed chigkim closed 10 months ago

chigkim commented 10 months ago

I get the error below when I try to build on Ubuntu. I'd appreciate any help! Thanks!

$ CONFIG=Release make
Compiling client.cpp
In file included from ../../deps/aoo/lib/src/client.hpp:10,
                 from ../../deps/aoo/lib/src/client.cpp:5:
../../deps/aoo/lib/src/sync.hpp:98:26: error: ‘unique_lock’ in namespace ‘std’ does not name a template type
   98 | using unique_lock = std::unique_lock<shared_mutex>;
      |                          ^~~~~~~~~~~
../../deps/aoo/lib/src/sync.hpp:12:1: note: ‘std::unique_lock’ is defined in header ‘<mutex>’; did you forget to ‘#include <mutex>’?
   11 | #include <shared_mutex>
  +++ |+#include <mutex>
   12 |
../../deps/aoo/lib/src/client.cpp: In member function ‘void aoo::net::client::do_disconnect(aoo::net::command_reason, int)’:
../../deps/aoo/lib/src/client.cpp:573:9: error: ‘unique_lock’ was not declared in this scope
  573 |         unique_lock lock(peerlock_);
      |         ^~~~~~~~~~~
../../deps/aoo/lib/src/client.cpp: In member function ‘void aoo::net::client::handle_group_leave(const osc::ReceivedMessage&)’:
../../deps/aoo/lib/src/client.cpp:1077:9: error: ‘unique_lock’ was not declared in this scope
 1077 |         unique_lock lock(peerlock_); // writer lock!
      |         ^~~~~~~~~~~
../../deps/aoo/lib/src/client.cpp: In member function ‘void aoo::net::client::handle_peer_add(const osc::ReceivedMessage&)’:
../../deps/aoo/lib/src/client.cpp:1136:5: error: ‘unique_lock’ was not declared in this scope
 1136 |     unique_lock lock(peerlock_); // writer lock!
      |     ^~~~~~~~~~~
../../deps/aoo/lib/src/client.cpp: In member function ‘void aoo::net::client::handle_peer_remove(const osc::ReceivedMessage&)’:
../../deps/aoo/lib/src/client.cpp:1165:5: error: ‘unique_lock’ was not declared in this scope
 1165 |     unique_lock lock(peerlock_); // writer lock!
      |     ^~~~~~~~~~~
../../deps/aoo/lib/src/client.cpp: In member function ‘void aoo::net::client::wait_for_event(float)’:
../../deps/aoo/lib/src/client.cpp:790:13: warning: ignoring return value of ‘ssize_t read(int, void*, size_t)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
  790 |         read(waitpipe_[0], &c, 1);
      |         ~~~~^~~~~~~~~~~~~~~~~~~~~
../../deps/aoo/lib/src/client.cpp: In member function ‘void aoo::net::client::signal()’:
../../deps/aoo/lib/src/client.cpp:1221:10: warning: ignoring return value of ‘ssize_t write(int, const void*, size_t)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
 1221 |     write(waitpipe_[1], "\0", 1);
      |     ~~~~~^~~~~~~~~~~~~~~~~~~~~~~
make: *** [Makefile:109: build/intermediate/Release/client_305e502e.o] Error 1
essej commented 10 months ago

What version of gcc is that?

chigkim commented 10 months ago

gcc (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0

essej commented 10 months ago

Go ahead and do what the compiler suggests and insert a #include <mutex> near the top of deps/aoo/lib/src/sync.hpp and then try the build again... let me know!

chigkim commented 10 months ago

That worked! Thanks!

tcconway commented 10 months ago

Can confirm this worked for me as well. Thanks!!

essej commented 10 months ago

I’ll make the fix in the repo shortly

essej commented 10 months ago

This fix has been made in the latest master...