Compiling SDL version on Linux

Started by guest7581, April 18, 2020, 15:51:31

Previous topic - Next topic

guest7581

I've finally managed to compile console version, but have a problem with SDL version.


runtime.cpp: In member function 'virtual char* Runtime::loadResource(const char*)':
runtime.cpp:353:29: error: 'main_bas_len' was not declared in this scope
  353 |     buffer = (char *)malloc(main_bas_len + 1);
      |                             ^~~~~~~~~~~~
runtime.cpp:354:20: error: 'main_bas' was not declared in this scope
  354 |     memcpy(buffer, main_bas, main_bas_len);
      |                    ^~~~~~~~
In file included from ../../../src/platform/sdl/runtime.h:15,
                 from runtime.cpp:21:
runtime.cpp: In member function 'bool System::getPen3()':
/usr/include/SDL2/SDL_mouse.h:281:32: warning: '<<' in boolean context, did you mean '<' ? [-Wint-in-bool-context]
  281 | #define SDL_BUTTON(X)       (1 << ((X)-1))
      |                             ~~~^~~~~~~~~~~
runtime.cpp:813:11: note: in expansion of macro 'SDL_BUTTON'
  813 |   return (SDL_BUTTON(SDL_BUTTON_LEFT) && SDL_GetMouseState(&_touchCurX, &_touchCurY));
      |           ^~~~~~~~~~
make[2]: *** [Makefile:539: runtime.o] Error 1
make[2]: Leaving directory '/home/tom/Downloads/SmallBASIC/src/platform/sdl'
make[1]: *** [Makefile:398: all-recursive] Error 1
make[1]: Leaving directory '/home/tom/Downloads/SmallBASIC'
make: *** [Makefile:339: all] Error 2

chrisws

The configure script runs xxd to generate main_bas.h from main.bas

Probably best to re-run:

$ sh autogen.sh
$ ./configure --enable-sdl
$ make

guest7581

Of course, you're right. :) There is a problem with xxd. Solus doesn't have it in its repo. I had to get it from a different source and it seems to be be not working properly. Thanx! :)

guest7581

Well, no wonder it didn't work. I grabbed an arm version of xxd!  :)) With a correct xxd it worked without problems. Thanx! :)