Unable to Compile my uWebsockets code #1814
-
Im trying to learn uWebSockets. Please forgive me for simple questions. after cloning, I did below commands.
I tried to compile my code using below compilation command. I am getting errors. Errors shown below. g++ -o server.o Server.C -I/usr/local/include/uWebSockets -I./uWebSockets/uSockets/src -L./uWebSockets/uSockets/ -lssl -lcrypto -lz Here is my simple server code(Server,C): _#include "uWebSockets/src/App.h" int main() Im getting below errors. Please help me how to resolve these errors. $g++ -o server.o Server.C -I/usr/local/include/uWebSockets -I./uWebSockets/uSockets/src -L./uWebSockets/uSockets/ -lssl -lcrypto -lz If Im missing any steps or need to include any directory or library while compiling, please help me with exact compilation command. |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 3 replies
-
uSockets is a git submodule and you need to pull it before you can compule |
Beta Was this translation helpful? Give feedback.
-
Sorry, you already said you have installed it, so it is not the submodule
causing the problem
…On Mon, 25 Nov 2024, 20:16 rangpec, ***@***.***> wrote:
Using below command I cloned.
*git clone --recurse-submodules
https://github.com/uNetworking/uWebSockets.git
<https://github.com/uNetworking/uWebSockets.git>*
I could see the uSockets directory.
$ ls -lrt
total 1780
drwxr-xr-x 2 rp rp 4096 Nov 25 16:55 misc
drwxr-xr-x 2 rp rp 4096 Nov 25 16:55 libEpollBenchmarker
drwxr-xr-x 4 rp rp 4096 Nov 25 16:55 fuzzing
drwxr-xr-x 2 rp rp 4096 Nov 25 16:55 cluster
-rw-r--r-- 1 rp rp 552 Nov 25 16:55 build.h
-rw-r--r-- 1 rp rp 3678 Nov 25 16:55 build.c
drwxr-xr-x 2 rp rp 4096 Nov 25 16:55 benchmarks
drwxr-xr-x 2 rp rp 4096 Nov 25 16:55 autobahn
-rw-r--r-- 1 rp rp 6101 Nov 25 16:55 README.md
-rw-r--r-- 1 rp rp 640 Nov 25 16:55 Makefile
-rw-r--r-- 1 rp rp 11357 Nov 25 16:55 LICENSE
-rw-r--r-- 1 rp rp 377 Nov 25 16:55 GNUmakefile
drwxr-xr-x 2 rp rp 4096 Nov 25 16:55 tests
drwxr-xr-x 2 rp rp 4096 Nov 25 16:55 src
drwxr-xr-x 2 rp rp 4096 Nov 25 16:55 h1spec
-rwxr-xr-x 1 rp rp 16448 Nov 25 16:58 build
-rwxr-xr-x 1 rp rp 111120 Nov 25 16:58 EchoBody
-rwxr-xr-x 1 rp rp 128424 Nov 25 16:58 HelloWorldThreaded
-rwxr-xr-x 1 rp rp 16032 Nov 25 16:58 Http3Server
-rwxr-xr-x 1 rp rp 192512 Nov 25 16:58 Broadcast
-rwxr-xr-x 1 rp rp 121440 Nov 25 16:58 HelloWorld
-rwxr-xr-x 1 rp rp 134208 Nov 25 16:58 Crc32
-rwxr-xr-x 1 rp rp 127624 Nov 25 16:59 ServerName
-rwxr-xr-x 1 rp rp 167624 Nov 25 16:59 EchoServer
-rwxr-xr-x 1 rp rp 196976 Nov 25 16:59 BroadcastingEchoServer
-rwxr-xr-x 1 rp rp 187744 Nov 25 16:59 UpgradeSync
-rwxr-xr-x 1 rp rp 189192 Nov 25 16:59 UpgradeAsync
-rwxr-xr-x 1 rp rp 125784 Nov 25 16:59 ParameterRoutes
drwxr-xr-x 3 rp rp 4096 Nov 25 17:08 examples
drwxr-xr-x 9 rp rp 4096 Nov 25 17:24 uSockets
$
$
$ cd uSockets/
$ ls -lrt
total 576
drwxr-xr-x 2 rp rp 4096 Nov 25 16:55 tests
drwxr-xr-x 6 rp rp 4096 Nov 25 16:55 src
-rw-r--r-- 1 rp rp 58 Nov 25 16:55 module.modulemap
drwxr-xr-x 2 rp rp 4096 Nov 25 16:55 misc
drwxr-xr-x 3 rp rp 4096 Nov 25 16:55 examples
-rw-r--r-- 1 rp rp 1509 Nov 25 16:55 README.md
-rw-r--r-- 1 rp rp 3454 Nov 25 16:55 Makefile
-rw-r--r-- 1 rp rp 11357 Nov 25 16:55 LICENSE
drwxr-xr-x 12 rp rp 4096 Nov 25 16:56 boringssl
drwxr-xr-x 9 rp rp 4096 Nov 25 16:56 lsquic
-rw-r--r-- 1 rp rp 51392 Nov 25 17:24 bsd.o
-rw-r--r-- 1 rp rp 37504 Nov 25 17:24 context.o
-rw-r--r-- 1 rp rp 30328 Nov 25 17:24 loop.o
-rw-r--r-- 1 rp rp 2712 Nov 25 17:24 quic.o
-rw-r--r-- 1 rp rp 28664 Nov 25 17:24 socket.o
-rw-r--r-- 1 rp rp 17896 Nov 25 17:24 udp.o
-rw-r--r-- 1 rp rp 31824 Nov 25 17:24 epoll_kqueue.o
-rw-r--r-- 1 rp rp 2712 Nov 25 17:24 gcd.o
-rw-r--r-- 1 rp rp 2712 Nov 25 17:24 libuv.o
-rw-r--r-- 1 rp rp 2712 Nov 25 17:24 openssl.o
-rw-r--r-- 1 rp rp 2720 Nov 25 17:24 io_context.o
-rw-r--r-- 1 rp rp 2720 Nov 25 17:24 io_socket.o
-rw-r--r-- 1 rp rp 2712 Nov 25 17:24 io_loop.o
-rw-r--r-- 1 rp rp 302144 Nov 25 17:24 uSockets.a
$
—
Reply to this email directly, view it on GitHub
<#1814 (reply in thread)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AGIN3H7PPZQCK3JIEGGQOW32CNSPHAVCNFSM6AAAAABSOSK3RGVHI2DSMVQWIX3LMV43URDJONRXK43TNFXW4Q3PNVWWK3TUHMYTCMZXGU3TSMI>
.
You are receiving this because you commented.Message ID:
***@***.***
com>
|
Beta Was this translation helpful? Give feedback.
-
If you simply hit "make", you will see exactly how the examples are compiled:
|
Beta Was this translation helpful? Give feedback.
If you simply hit "make", you will see exactly how the examples are compiled:
g++ -march=native -O3 -Wpedantic -Wall -Wextra -Wsign-conversion -Wconversion -std=c++20 -Isrc -IuSockets/src -flto examples/EchoBody.cpp uSockets/*.o -lz -o EchoBody