SyntaxBomb - Indie Coders

Languages & Coding => SmallBASIC => Topic started by: guest7581 on April 18, 2020, 03:51:31 PM

Title: Compiling SDL version on Linux
Post by: guest7581 on April 18, 2020, 03:51:31 PM
I've finally managed to compile console version, but have a problem with SDL version.

Code: [Select]
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
Title: Re: Compiling SDL version on Linux
Post by: chrisws on April 19, 2020, 06:30:58 AM
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
Title: Re: Compiling SDL version on Linux
Post by: guest7581 on April 19, 2020, 12:29:30 PM
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! :)
Title: Re: Compiling SDL version on Linux
Post by: guest7581 on April 19, 2020, 12:30:00 PM
Well, no wonder it didn't work. I grabbed an arm version of xxd!  :)) With a correct xxd it worked without problems. Thanx! :)
SimplePortal 2.3.6 © 2008-2014, SimplePortal