PerBothner / DomTerm

DOM/JavaScript-based terminal-emulator/console

Home Page:https://domterm.org

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Compile error: http.cc:349:56: error: invalid conversion from ‘unsigned char*’ to ‘char*’

mcarans opened this issue · comments

commented

I successfully got DomTerm working on my old machine a while back, but now am having trouble building it on my new one. I get the following error -> http.cc:349:56: error: invalid conversion from ‘unsigned char*’ to ‘char*’. My guess is that the switch from C to C++ has revealed this error because the C++ compiler is stricter.

make[1]: Entering directory '/home/mcarans/Programming/DomTerm/lws-term'
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 -DCOMPILED_IN_RESOURCES  -g -O2 -c -o ldomterm-http.o `test -f 'http.cc' || echo './'`http.cc
http.cc: In function ‘int callback_http(lws*, lws_callback_reasons, void*, void*, size_t)’:
http.cc:349:56: error: invalid conversion from ‘unsigned char*’ to ‘char*’ [-fpermissive]
  349 |                                              resource->data, resource->length,
      |                                              ~~~~~~~~~~^~~~
      |                                                        |
      |                                                        unsigned char*
http.cc:167:29: note:   initializing argument 4 of ‘int write_simple_response(lws*, http_client*, const char*, char*, unsigned int, bool, unsigned char*)’
  167 |                       char *content_data, unsigned int content_length,
      |                       ~~~~~~^~~~~~~~~~~~
make[1]: *** [Makefile:526: ldomterm-http.o] Error 1
make[1]: Leaving directory '/home/mcarans/Programming/DomTerm/lws-term'
make: *** [Makefile:651: all-recursive] Error 1

commented

Going back 13 commits to before the C++ changes worked ok

Yep. I didn't test the --enable-compiled-in-resources option when I switched to using C++. Oops.
I checked in a fix - should work now.

commented

Great thx. BTW does DomTerm support using the mouse to click to position the cursor in bash or only in fish?

It should work in Bash if you do as instructed.

commented

The good news is that in Ubuntu 20.04 based distros like Mint, it's pretty straightforward to set up DomTerm. No more having to compile lots of dependencies. :-)

commented

Tested and compiles ok now. Closing