PerBothner / DomTerm

DOM/JavaScript-based terminal-emulator/console

Home Page:https://domterm.org

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Build errors in server.cc, utils.cc and protocol.cc

mcarans opened this issue · comments

commented

I built libwebsockets as per instructions. When compiling DomTerm, I get errors:

server.cc: In function ‘char* qtwebengine_command(options*)’:
server.cc:561:53: warning: format ‘%s’ expects a matching ‘char*’ argument [-Wformat=]
  561 |         sbuf_printf(&sb, " --remote-debugging-port=%s");
      |                                                    ~^
      |                                                     |
      |                                                     char*
g++ -DPACKAGE_NAME=\"DomTerm\" -DPACKAGE_TARNAME=\"domterm\" -DPACKAGE_VERSION=\"2.9.0\" -DPACKAGE_STRING=\"DomTerm\ 2.9.0\" -DPACKAGE_BUGREPORT=\"\" -DPACKAGE_URL=\"\" -DPACKAGE=\"domterm\" -DVERSION=\"2.9.0\" -DHAVE_QT=1 -I.     -I/usr/include/json-c -I./lws-term -I../libwebsockets/build/include  -DRESOURCE_DIR='"../share/domterm"' -g -O2 -c -o ldomterm-utils.o `test -f 'utils.cc' || echo './'`utils.cc
utils.cc: In function ‘void generate_random_string(char*, int)’:
utils.cc:619:14: warning: ignoring return value of ‘ssize_t getrandom(void*, size_t, unsigned int)’, declared with attribute warn_unused_result [-Wunused-result]
  619 |     getrandom(buf, nchars, 0);
      |     ~~~~~~~~~^~~~~~~~~~~~~~~~
utils.cc: In function ‘void printf_error(options*, const char*, ...)’:
utils.cc:866:10: warning: ignoring return value of ‘ssize_t write(int, const void*, size_t)’, declared with attribute warn_unused_result [-Wunused-result]
  866 |     write(opts->fd_err, buf->buffer, buf->len);
      |     ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
g++ -DPACKAGE_NAME=\"DomTerm\" -DPACKAGE_TARNAME=\"domterm\" -DPACKAGE_VERSION=\"2.9.0\" -DPACKAGE_STRING=\"DomTerm\ 2.9.0\" -DPACKAGE_BUGREPORT=\"\" -DPACKAGE_URL=\"\" -DPACKAGE=\"domterm\" -DVERSION=\"2.9.0\" -DHAVE_QT=1 -I.     -I/usr/include/json-c -I./lws-term -I../libwebsockets/build/include  -DRESOURCE_DIR='"../share/domterm"' -g -O2 -c -o ldomterm-protocol.o `test -f 'protocol.cc' || echo './'`protocol.cc
In file included from /usr/include/libwebsockets.h:307,
                 from server.h:34,
                 from protocol.cc:1:
protocol.cc: In function ‘int callback_tty(lws*, lws_callback_reasons, void*, void*, size_t)’:
protocol.cc:1742:21: warning: format ‘%s’ expects argument of type ‘char*’, but argument 3 has type ‘void*’ [-Wformat=]
 1742 |         lwsl_notice("tty/CALLBACK_ESTABLISHED %s client:%p\n", in, client);
      |                     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~  ~~
      |                                                                |
      |                                                                void*
protocol.cc:1742:48: note: format string is defined here
 1742 |         lwsl_notice("tty/CALLBACK_ESTABLISHED %s client:%p\n", in, client);
      |                                               ~^
      |                                                |
      |                                                char*
      |                                               %p
In file included from /usr/include/libwebsockets.h:307,
                 from server.h:34,
                 from protocol.cc:1:
protocol.cc:1813:27: warning: format ‘%ld’ expects argument of type ‘long int’, but argument 3 has type ‘int’ [-Wformat=]
 1813 |                 lwsl_info("connection to existing session %ld established\n", pclient->session_number);
      |                           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~  ~~~~~~~~~~~~~~~~~~~~~~~
      |                                                                                        |
      |                                                                                        int
protocol.cc:1813:61: note: format string is defined here
 1813 |                 lwsl_info("connection to existing session %ld established\n", pclient->session_number);
      |                                                           ~~^
      |                                                             |
      |                                                             long int
      |                                                           %d
In file included from /usr/include/libwebsockets.h:307,
                 from server.h:34,
                 from protocol.cc:1:
protocol.cc: In function ‘int attach_action(int, arglist_t, lws*, options*)’:
protocol.cc:2180:17: warning: format ‘%ld’ expects argument of type ‘long int’, but argument 3 has type ‘int’ [-Wformat=]
 2180 |     lwsl_notice("reattach sess:%ld rcoud:%ld\n", pclient->session_number, rcount);
      |                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~  ~~~~~~~~~~~~~~~~~~~~~~~
      |                                                           |
      |                                                           int
protocol.cc:2180:34: note: format string is defined here
 2180 |     lwsl_notice("reattach sess:%ld rcoud:%ld\n", pclient->session_number, rcount);
      |                                ~~^
      |                                  |
      |                                  long int
      |                                %d
g++ -DPACKAGE_NAME=\"DomTerm\" -DPACKAGE_TARNAME=\"domterm\" -DPACKAGE_VERSION=\"2.9.0\" -DPACKAGE_STRING=\"DomTerm\ 2.9.0\" -DPACKAGE_BUGREPORT=\"\" -DPACKAGE_URL=\"\" -DPACKAGE=\"domterm\" -DVERSION=\"2.9.0\" -DHAVE_QT=1 -I.     -I/usr/include/json-c -I./lws-term -I../libwebsockets/build/include  -DRESOURCE_DIR='"../share/domterm"' -g -O2 -c -o ldomterm-http.o `test -f 'http.cc' || echo './'`http.cc
http.cc:9:2: error: #error Must configure --enable-compiled-in-resources since zip support missing in libwebsockets
    9 | #error Must configure --enable-compiled-in-resources since zip support missing in libwebsockets
      |  ^~~~~

Hm. I don't like warnings, so I should look into why you're getting them

However, assuming you passed -DLWS_WITH_ZIP_FOPS=1 to cmake when building libwebsockets, as in the instructions, then I'm guessing the error is because the -I../libwebsockets/build/include isn't finding the built version of libwebsockets. Try configure --with-libwebsockets with an absolute path.

commented

Absolute path fixed it thx