Closed Sarang0218 closed 1 year ago
Hi @Sarang0218, How are you compiling? are you able to build the examples with CMake?, like:
$ git clone https://github.com/Theldus/wsServer.git
$ cd wsServer/
$ mkdir build
$ cd build
$ cmake ..
$ make
if not, what is the full output?
Although the library builds successfully, it fails to generate the example executables. When I try to compile the examples manually with the following command:
clang echo.c -I/Users/Mark/Documents/UnivProject/src/wsServer/include
When manually compiling a project, you must specify not only the includes directory, but also the static library and its dependencies. If you want to build echo.c
present in this project (in examples/echo), you could do:
$ cd wsServer
$ make
$ cd examples/echo
$ gcc echo.c -I ../../include ../../libws.a -pthread
Maybe your macOS is compiling your library to x86_64 and trying to use it in an arm64 project, please check the architecture the generated object files are too...
Oh it seems like I forgot to specify the static library, haha. It seems to work great now. Thanks for the quick reply!
I am trying to use the wsServer library in my project, but I am encountering the following linker error every time I try to compile my code:
Although the library builds successfully, it fails to generate the example executables. When I try to compile the examples manually with the following command:
clang echo.c -I/Users/Mark/Documents/UnivProject/src/wsServer/include
I receive the same linker error. I would appreciate any help or guidance on how to resolve this issue and use the library successfully in my project. Thank you!