Aniseto / NosoWalletCPP

Noso Wallet implementation in C++
https://www.nosocoin.com
MIT License
2 stars 1 forks source link

Unable to compile under Ubuntu Linux due to dependency on `WSA` #3

Closed gcarreno closed 1 year ago

gcarreno commented 1 year ago

Hey @Aniseto,

Here's the error output from the compiler:

#####
# Building NosoWalletCPP
#####
[ 25%] Building CXX object CMakeFiles/NosoWalletCPP.dir/NosoWalletCPP.cpp.o
In file included from /home/gcarreno/Programming/Noso/gcarreno-NosoWalletCPP/NosoWalletCPP.cpp:6:
/home/gcarreno/Programming/Noso/gcarreno-NosoWalletCPP/Communication.h: In function ‘std::string SendStringToNode(const std::string&, int, const std::string&)’:
/home/gcarreno/Programming/Noso/gcarreno-NosoWalletCPP/Communication.h:10:5: error: ‘WSADATA’ was not declared in this scope
   10 |     WSADATA wsaData; // Wsdata Variable
      |     ^~~~~~~
/home/gcarreno/Programming/Noso/gcarreno-NosoWalletCPP/Communication.h:11:20: error: ‘MAKEWORD’ was not declared in this scope
   11 |     if (WSAStartup(MAKEWORD(2, 2), &wsaData) != 0) {
      |                    ^~~~~~~~
/home/gcarreno/Programming/Noso/gcarreno-NosoWalletCPP/Communication.h:11:37: error: ‘wsaData’ was not declared in this scope
   11 |     if (WSAStartup(MAKEWORD(2, 2), &wsaData) != 0) {
      |                                     ^~~~~~~
/home/gcarreno/Programming/Noso/gcarreno-NosoWalletCPP/Communication.h:11:9: error: ‘WSAStartup’ was not declared in this scope
   11 |     if (WSAStartup(MAKEWORD(2, 2), &wsaData) != 0) {
      |         ^~~~~~~~~~
/home/gcarreno/Programming/Noso/gcarreno-NosoWalletCPP/Communication.h:17:5: error: ‘SOCKET’ was not declared in this scope
   17 |     SOCKET socketCliente = socket(AF_INET, SOCK_STREAM, 0);
      |     ^~~~~~
/home/gcarreno/Programming/Noso/gcarreno-NosoWalletCPP/Communication.h:18:9: error: ‘socketCliente’ was not declared in this scope
   18 |     if (socketCliente == INVALID_SOCKET) {
      |         ^~~~~~~~~~~~~
/home/gcarreno/Programming/Noso/gcarreno-NosoWalletCPP/Communication.h:18:26: error: ‘INVALID_SOCKET’ was not declared in this scope
   18 |     if (socketCliente == INVALID_SOCKET) {
      |                          ^~~~~~~~~~~~~~
/home/gcarreno/Programming/Noso/gcarreno-NosoWalletCPP/Communication.h:20:9: error: ‘WSACleanup’ was not declared in this scope
   20 |         WSACleanup();
      |         ^~~~~~~~~~
/home/gcarreno/Programming/Noso/gcarreno-NosoWalletCPP/Communication.h:30:21: error: ‘socketCliente’ was not declared in this scope
   30 |         closesocket(socketCliente);
      |                     ^~~~~~~~~~~~~
/home/gcarreno/Programming/Noso/gcarreno-NosoWalletCPP/Communication.h:30:9: error: ‘closesocket’ was not declared in this scope
   30 |         closesocket(socketCliente);
      |         ^~~~~~~~~~~
/home/gcarreno/Programming/Noso/gcarreno-NosoWalletCPP/Communication.h:31:9: error: ‘WSACleanup’ was not declared in this scope
   31 |         WSACleanup();
      |         ^~~~~~~~~~
/home/gcarreno/Programming/Noso/gcarreno-NosoWalletCPP/Communication.h:36:17: error: ‘socketCliente’ was not declared in this scope
   36 |     if (connect(socketCliente, reinterpret_cast<struct sockaddr*>(&direccionServidor), sizeof(direccionServidor)) == SOCKET_ERROR) {
      |                 ^~~~~~~~~~~~~
/home/gcarreno/Programming/Noso/gcarreno-NosoWalletCPP/Communication.h:36:118: error: ‘SOCKET_ERROR’ was not declared in this scope; did you mean ‘SO_ERROR’?
   36 |     if (connect(socketCliente, reinterpret_cast<struct sockaddr*>(&direccionServidor), sizeof(direccionServidor)) == SOCKET_ERROR) {
      |                                                                                                                      ^~~~~~~~~~~~
      |                                                                                                                      SO_ERROR
/home/gcarreno/Programming/Noso/gcarreno-NosoWalletCPP/Communication.h:38:9: error: ‘closesocket’ was not declared in this scope
   38 |         closesocket(socketCliente);
      |         ^~~~~~~~~~~
/home/gcarreno/Programming/Noso/gcarreno-NosoWalletCPP/Communication.h:39:9: error: ‘WSACleanup’ was not declared in this scope
   39 |         WSACleanup();
      |         ^~~~~~~~~~
/home/gcarreno/Programming/Noso/gcarreno-NosoWalletCPP/Communication.h:44:14: error: ‘socketCliente’ was not declared in this scope
   44 |     if (send(socketCliente, message.c_str(), message.size(), 0) == SOCKET_ERROR) {
      |              ^~~~~~~~~~~~~
/home/gcarreno/Programming/Noso/gcarreno-NosoWalletCPP/Communication.h:44:68: error: ‘SOCKET_ERROR’ was not declared in this scope; did you mean ‘SO_ERROR’?
   44 |     if (send(socketCliente, message.c_str(), message.size(), 0) == SOCKET_ERROR) {
      |                                                                    ^~~~~~~~~~~~
      |                                                                    SO_ERROR
/home/gcarreno/Programming/Noso/gcarreno-NosoWalletCPP/Communication.h:46:9: error: ‘closesocket’ was not declared in this scope
   46 |         closesocket(socketCliente);
      |         ^~~~~~~~~~~
/home/gcarreno/Programming/Noso/gcarreno-NosoWalletCPP/Communication.h:47:9: error: ‘WSACleanup’ was not declared in this scope
   47 |         WSACleanup();
      |         ^~~~~~~~~~
/home/gcarreno/Programming/Noso/gcarreno-NosoWalletCPP/Communication.h:60:39: error: ‘socketCliente’ was not declared in this scope
   60 |         while ((bytesRecibidos = recv(socketCliente, buffer, sizeof(buffer) - 1, 0)) > 0)
      |                                       ^~~~~~~~~~~~~
/home/gcarreno/Programming/Noso/gcarreno-NosoWalletCPP/Communication.h:74:35: error: ‘socketCliente’ was not declared in this scope
   74 |     while ((bytesRecibidos = recv(socketCliente, buffer, sizeof(buffer) - 1, 0)) > 0) {
      |                                   ^~~~~~~~~~~~~
/home/gcarreno/Programming/Noso/gcarreno-NosoWalletCPP/Communication.h:80:17: error: ‘socketCliente’ was not declared in this scope
   80 |     closesocket(socketCliente);
      |                 ^~~~~~~~~~~~~
/home/gcarreno/Programming/Noso/gcarreno-NosoWalletCPP/Communication.h:80:5: error: ‘closesocket’ was not declared in this scope
   80 |     closesocket(socketCliente);
      |     ^~~~~~~~~~~
/home/gcarreno/Programming/Noso/gcarreno-NosoWalletCPP/Communication.h:81:5: error: ‘WSACleanup’ was not declared in this scope
   81 |     WSACleanup();
      |     ^~~~~~~~~~
gmake[2]: *** [CMakeFiles/NosoWalletCPP.dir/build.make:104: CMakeFiles/NosoWalletCPP.dir/NosoWalletCPP.cpp.o] Error 1
gmake[1]: *** [CMakeFiles/Makefile2:83: CMakeFiles/NosoWalletCPP.dir/all] Error 2
gmake: *** [Makefile:91: all] Error 2

Hope this helps!!

Cheers, Gus