PerBothner / DomTerm

DOM/JavaScript-based terminal-emulator/console

Home Page:https://domterm.org

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Headers and such

SolarAquarion opened this issue · comments

So libwebsockets isn't building with the latest update and is json.h json-c/json.h?

/usr/bin/ld: ldomterm-server.o:(.data.rel.ro+0x8): undefined reference to lws_extension_callback_pm_deflate' /usr/bin/ld: ldomterm-server.o:(.data.rel.ro+0x20): undefined reference to lws_extension_callback_pm_deflate'

I did a fresh clone of libwebsockets, and rebuild it, and then rebuilt DomTerm. It works fine for me.

What platform are you on, and where are you getting libwebsockets from?

Arch Linux.

cd lws-term && make ../bin/domterm
make[2]: Entering directory '/home/solaraquarion/pkgbuild/domterm-git/src/DomTerm/lws-term'
gcc -DPACKAGE_NAME=\"DomTerm\" -DPACKAGE_TARNAME=\"domterm\" -DPACKAGE_VERSION=\"2.1.0\" -DPACKAGE_STRING=\"DomTerm\ 2.1.0\" -DPACKAGE_BUGREPORT=\"\" -DPACKAGE_URL=\"\" -DPACKAGE=\"domterm\" -DVERSION=\"2.1.0\" -I.   -D_FORTIFY_SOURCE=2  -I/usr/include/json-c  -I./lws-term   -DRESOURCE_DIR='"../share/domterm"' -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -c -o ldomterm-server.o `test -f 'server.c' || echo './'`server.c
gcc -DPACKAGE_NAME=\"DomTerm\" -DPACKAGE_TARNAME=\"domterm\" -DPACKAGE_VERSION=\"2.1.0\" -DPACKAGE_STRING=\"DomTerm\ 2.1.0\" -DPACKAGE_BUGREPORT=\"\" -DPACKAGE_URL=\"\" -DPACKAGE=\"domterm\" -DVERSION=\"2.1.0\" -I.   -D_FORTIFY_SOURCE=2  -I/usr/include/json-c  -I./lws-term   -DRESOURCE_DIR='"../share/domterm"' -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -c -o ldomterm-utils.o `test -f 'utils.c' || echo './'`utils.c
utils.c: In function ‘printf_error’:
utils.c:633:5: warning: ignoring return value of ‘write’, declared with attribute warn_unused_result [-Wunused-result]
  633 |     write(opts->fd_err, buf->buffer, buf->len);
      |     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
gcc -DPACKAGE_NAME=\"DomTerm\" -DPACKAGE_TARNAME=\"domterm\" -DPACKAGE_VERSION=\"2.1.0\" -DPACKAGE_STRING=\"DomTerm\ 2.1.0\" -DPACKAGE_BUGREPORT=\"\" -DPACKAGE_URL=\"\" -DPACKAGE=\"domterm\" -DVERSION=\"2.1.0\" -I.   -D_FORTIFY_SOURCE=2  -I/usr/include/json-c  -I./lws-term   -DRESOURCE_DIR='"../share/domterm"' -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -c -o ldomterm-protocol.o `test -f 'protocol.c' || echo './'`protocol.c
gcc -DPACKAGE_NAME=\"DomTerm\" -DPACKAGE_TARNAME=\"domterm\" -DPACKAGE_VERSION=\"2.1.0\" -DPACKAGE_STRING=\"DomTerm\ 2.1.0\" -DPACKAGE_BUGREPORT=\"\" -DPACKAGE_URL=\"\" -DPACKAGE=\"domterm\" -DVERSION=\"2.1.0\" -I.   -D_FORTIFY_SOURCE=2  -I/usr/include/json-c  -I./lws-term   -DRESOURCE_DIR='"../share/domterm"' -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -c -o ldomterm-http.o `test -f 'http.c' || echo './'`http.c
gcc -DPACKAGE_NAME=\"DomTerm\" -DPACKAGE_TARNAME=\"domterm\" -DPACKAGE_VERSION=\"2.1.0\" -DPACKAGE_STRING=\"DomTerm\ 2.1.0\" -DPACKAGE_BUGREPORT=\"\" -DPACKAGE_URL=\"\" -DPACKAGE=\"domterm\" -DVERSION=\"2.1.0\" -I.   -D_FORTIFY_SOURCE=2  -I/usr/include/json-c  -I./lws-term   -DRESOURCE_DIR='"../share/domterm"' -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -c -o ldomterm-whereami.o `test -f 'whereami.c' || echo './'`whereami.c
gcc -DPACKAGE_NAME=\"DomTerm\" -DPACKAGE_TARNAME=\"domterm\" -DPACKAGE_VERSION=\"2.1.0\" -DPACKAGE_STRING=\"DomTerm\ 2.1.0\" -DPACKAGE_BUGREPORT=\"\" -DPACKAGE_URL=\"\" -DPACKAGE=\"domterm\" -DVERSION=\"2.1.0\" -I.   -D_FORTIFY_SOURCE=2  -I/usr/include/json-c  -I./lws-term   -DRESOURCE_DIR='"../share/domterm"' -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -c -o ldomterm-commands.o `test -f 'commands.c' || echo './'`commands.c
gcc -DPACKAGE_NAME=\"DomTerm\" -DPACKAGE_TARNAME=\"domterm\" -DPACKAGE_VERSION=\"2.1.0\" -DPACKAGE_STRING=\"DomTerm\ 2.1.0\" -DPACKAGE_BUGREPORT=\"\" -DPACKAGE_URL=\"\" -DPACKAGE=\"domterm\" -DVERSION=\"2.1.0\" -I.   -D_FORTIFY_SOURCE=2  -I/usr/include/json-c  -I./lws-term   -DRESOURCE_DIR='"../share/domterm"' -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -c -o ldomterm-command-connect.o `test -f 'command-connect.c' || echo './'`command-connect.c
command-connect.c: In function ‘client_send_command’:
command-connect.c:176:5: warning: ignoring return value of ‘writev’, declared with attribute warn_unused_result [-Wunused-result]
  176 |     writev(socket, iov, 2);
      |     ^~~~~~~~~~~~~~~~~~~~~~
command-connect.c:200:25: warning: ignoring return value of ‘write’, declared with attribute warn_unused_result [-Wunused-result]
  200 |                         write(cur_out, rbuf+start, i-start);
      |                         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
gcc -DPACKAGE_NAME=\"DomTerm\" -DPACKAGE_TARNAME=\"domterm\" -DPACKAGE_VERSION=\"2.1.0\" -DPACKAGE_STRING=\"DomTerm\ 2.1.0\" -DPACKAGE_BUGREPORT=\"\" -DPACKAGE_URL=\"\" -DPACKAGE=\"domterm\" -DVERSION=\"2.1.0\" -I.   -D_FORTIFY_SOURCE=2  -I/usr/include/json-c  -I./lws-term   -DRESOURCE_DIR='"../share/domterm"' -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -c -o ldomterm-help.o `test -f 'help.c' || echo './'`help.c
gcc -DPACKAGE_NAME=\"DomTerm\" -DPACKAGE_TARNAME=\"domterm\" -DPACKAGE_VERSION=\"2.1.0\" -DPACKAGE_STRING=\"DomTerm\ 2.1.0\" -DPACKAGE_BUGREPORT=\"\" -DPACKAGE_URL=\"\" -DPACKAGE=\"domterm\" -DVERSION=\"2.1.0\" -I.   -D_FORTIFY_SOURCE=2  -I/usr/include/json-c  -I./lws-term   -DRESOURCE_DIR='"../share/domterm"' -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -c -o ldomterm-junzip.o `test -f 'junzip.c' || echo './'`junzip.c
gcc -DPACKAGE_NAME=\"DomTerm\" -DPACKAGE_TARNAME=\"domterm\" -DPACKAGE_VERSION=\"2.1.0\" -DPACKAGE_STRING=\"DomTerm\ 2.1.0\" -DPACKAGE_BUGREPORT=\"\" -DPACKAGE_URL=\"\" -DPACKAGE=\"domterm\" -DVERSION=\"2.1.0\" -I.   -D_FORTIFY_SOURCE=2  -I/usr/include/json-c  -I./lws-term   -DRESOURCE_DIR='"../share/domterm"' -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -c -o ldomterm-settings.o `test -f 'settings.c' || echo './'`settings.c
test -d ../.git \
&& GIT_REVISION=`cd .. && git describe --always --dirty --long --tags 2>/dev/null`; \
echo 'char git_describe[] = "'${GIT_REVISION}'";' > git-describe.c
gcc -DPACKAGE_NAME=\"DomTerm\" -DPACKAGE_TARNAME=\"domterm\" -DPACKAGE_VERSION=\"2.1.0\" -DPACKAGE_STRING=\"DomTerm\ 2.1.0\" -DPACKAGE_BUGREPORT=\"\" -DPACKAGE_URL=\"\" -DPACKAGE=\"domterm\" -DVERSION=\"2.1.0\" -I.   -D_FORTIFY_SOURCE=2  -I/usr/include/json-c  -I./lws-term   -DRESOURCE_DIR='"../share/domterm"' -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -c -o ldomterm-git-describe.o `test -f 'git-describe.c' || echo './'`git-describe.c
gcc  -I/usr/include/json-c  -I./lws-term   -DRESOURCE_DIR='"../share/domterm"' -march=x86-64 -mtune=generic -O2 -pipe -fno-plt  -Wl,-O1,--sort-common,--as-needed,-z,relro,-z,now -o ldomterm ldomterm-server.o ldomterm-utils.o ldomterm-protocol.o ldomterm-http.o ldomterm-whereami.o ldomterm-commands.o ldomterm-command-connect.o ldomterm-help.o ldomterm-junzip.o ldomterm-settings.o ldomterm-git-describe.o  -lwebsockets  -lssl -lcrypto  -ljson-c  -lcap  -lpthread -lutil -lz -lmagic 
/usr/bin/ld: ldomterm-server.o:(.data.rel.ro+0x8): undefined reference to `lws_extension_callback_pm_deflate'
/usr/bin/ld: ldomterm-server.o:(.data.rel.ro+0x20): undefined reference to `lws_extension_callback_pm_deflate'

Looks like you're using the system (installed) version of libwebsockets. It is possible that is buggy or too old. You should be able to get the lws version number thus:

grep LWS_LIBRARY_VERSION /usr/include/lws_config.h

It might be better to clone libwebsockets and build it from source, as described in the instructions.

Hm. 4.0.1 is pretty new (Fedora has 3.2.0). There could be some bug in it, though I didn't see anything mentioned on the mailing list.

I'd trying cloning https://libwebsockets.org/repo/libwebsockets and building that (as in the instructions). Hopefully that will work better.

It continued to fail.

You mean after cloning libwebsockets, building (as in the instructions), then in DomTerm re-running configure with the flag --with-libwebsockets=/path/to/libwebsockets/build, then make clean && make?

oh, libwebsockets locally.

I did it and it builds it.