uNetworking / uWebSockets

Simple, secure & standards compliant web server for the most demanding of applications
Apache License 2.0
17.24k stars 1.75k forks source link

no libuWS.so file found after `sudo make install` #1216

Closed Roma004 closed 3 years ago

Roma004 commented 3 years ago

So, the topic is my problem itself. After "building" the latest release of the library (from master), there was no libuWS.so file (or another file I'm able to use for dynamical linking) anywhere. I didn't found any instructions to compile this lib into a .so file. According to your Makefile, to install the library I only need to copy .h files to the uWebSocket directory in /usr/local/include. However, when I try to compile my project:

g++ main.cpp -o main -std=c++17 -lz -lssl -luv -lcrypto

I have a lot of error messges like:

/usr/bin/ld: main.cpp:(.text._ZN3uWS9WebSocketILb0ELb1E8UserDataE3endEiSt17basic_string_viewIcSt11char_traitsIcEE[_ZN3uWS9WebSocketILb0ELb1E8UserDataE3endEiSt17basic_string_viewIcSt11char_traitsIcEE]+0x18f): undefined reference to `us_socket_context_ext'

To my mind, that means I do need the dynamical linking files to make it works.

If this information will help, I use Manjaro Linux x86_64 and I tried to run the code example from the main page.

ghost commented 3 years ago

libuWS.so hasn't been built since v0.14 some three years ago.

You need to link to uSockets.a

Roma004 commented 3 years ago

Oh, thank you very much! That is the solution of my problem! But may you provide some info about building and linking the project in your main page, or somewhere else? This thing isn't obvious, to my mind.

ghost commented 3 years ago

The readmore page says this https://github.com/uNetworking/uWebSockets/blob/master/misc/READMORE.md#compiling

Roma004 commented 3 years ago

Then, I've read this inattentive! Thank you very much for you response!