Closed ghost closed 6 years ago
What if you add #include <sys/stat.h>
at the top of server.hpp?
$ make
make -C lib/uWebSockets -f ../uWebSockets.mk
make[1]: Entering directory '/home/mpp/multiplayerpiano-server/lib/uWebSockets'
g++ -std=c++11 -O3 -I src -lssl -lz -lcrypto -c src/Networking.cpp src/Epoll.cpp src/HTTPSocket.cpp src/WebSocket.cpp src/Socket.cpp src/Group.cpp src/Node.cpp src/Extensions.cpp src/Hub.cpp -s
ar rcs libuWS.a Networking.o Epoll.o HTTPSocket.o WebSocket.o Socket.o Group.o Node.o Extensions.o Hub.o
rm -f Networking.o Epoll.o HTTPSocket.o WebSocket.o Socket.o Group.o Node.o Extensions.o Hub.o
make[1]: Leaving directory '/home/mpp/multiplayerpiano-server/lib/uWebSockets'
g++ server.cpp limiter.cpp database.cpp msg.cpp -Wall -std=c++17 -O2 -I ./ -I ./lib/json/include/ -I ./lib/uWebSockets/src/ -L ./lib/uWebSockets/ -s -static -luWS -lssl -lz -lcrypto -o out
./lib/uWebSockets//libuWS.a(Hub.o): In function `uWS::Hub::listen(char const*, int, uS::TLS::Context, int, uWS::Group<true>*)':
Hub.cpp:(.text+0x1282): warning: Using 'getaddrinfo' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking
./lib/uWebSockets//libuWS.a(Node.o): In function `uS::Node::Node(int, int, int, bool)':
Node.cpp:(.text+0x51d): undefined reference to `pthread_self'
./lib/uWebSockets//libuWS.a(Node.o): In function `uS::Node::run()':
Node.cpp:(.text+0x655): undefined reference to `pthread_self'
/usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/libcrypto.a(dso_dlfcn.o): In function `dlfcn_globallookup':
(.text+0x11): undefined reference to `dlopen'
/usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/libcrypto.a(dso_dlfcn.o): In function `dlfcn_globallookup':
(.text+0x24): undefined reference to `dlsym'
/usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/libcrypto.a(dso_dlfcn.o): In function `dlfcn_globallookup':
(.text+0x2f): undefined reference to `dlclose'
/usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/libcrypto.a(dso_dlfcn.o): In function `dlfcn_bind_func':
(.text+0x334): undefined reference to `dlsym'
/usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/libcrypto.a(dso_dlfcn.o): In function `dlfcn_bind_func':
(.text+0x3db): undefined reference to `dlerror'
/usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/libcrypto.a(dso_dlfcn.o): In function `dlfcn_bind_var':
(.text+0x454): undefined reference to `dlsym'
/usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/libcrypto.a(dso_dlfcn.o): In function `dlfcn_bind_var':
(.text+0x4fb): undefined reference to `dlerror'
/usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/libcrypto.a(dso_dlfcn.o): In function `dlfcn_load':
(.text+0x569): undefined reference to `dlopen'
/usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/libcrypto.a(dso_dlfcn.o): In function `dlfcn_load':
(.text+0x5cb): undefined reference to `dlclose'
/usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/libcrypto.a(dso_dlfcn.o): In function `dlfcn_load':
(.text+0x603): undefined reference to `dlerror'
/usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/libcrypto.a(dso_dlfcn.o): In function `dlfcn_pathbyaddr':
(.text+0x69f): undefined reference to `dladdr'
/usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/libcrypto.a(dso_dlfcn.o): In function `dlfcn_pathbyaddr':
(.text+0x709): undefined reference to `dlerror'
/usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/libcrypto.a(dso_dlfcn.o): In function `dlfcn_unload':
(.text+0x762): undefined reference to `dlclose'
collect2: error: ld returned 1 exit status
Makefile:16: recipe for target 'all' failed
make: *** [all] Error 1
Uhh try to change the LIBS line on the makefile to this:
LIBS = -I ./ -I ./lib/json/include/ -I ./lib/uWebSockets/src/ -L ./lib/uWebSockets/ -l:libuWS.a -lssl -lz -lcrypto -ldl -lpthread
Now it works 😄
I tried compiling on Ubuntu 16.04 but encountered what looks like a problem with the code.