dbanay/Smalltalk

Unable to compile under Fedora 28

brickviking opened this issue · 2 comments

I checked I had SDL2-devel installed, I do.

bash$ rpm -qa | grep SDL
...
SDL2-devel-2.0.9-1.fc28.x86_64 <<< I think I done something bad....>>>
...
I suspect I missed something in the Readme.txt (I did).

I grabbed the most recent revision I could find of Smalltalk here: 8fc5c39
bash:/home/viking/src/smalltalk/ST80 $ git clone https://github.com/dbanay/Smalltalk
...

I tried retrieving the current revision from git:
bash:/home/viking/src/smalltalk/ST80/Smalltalk $ git describe
fatal: no names found, cannot describe anything

I then tried to make the project:
bash:/home/viking/src/smalltalk/ST80/Smalltalk/linux $ make
g++ -std=c++17 -O3 -c ../src/objmemory.cpp -o objmemory.o
g++ -std=c++17 -O3 -c ../src/bitblt.cpp -o bitblt.o
g++ -std=c++17 -O3 -c ../src/main.cpp
../src/main.cpp:58:14: error: 'SDL_PixelFormatEnum' does not name a type; did you mean 'SDL_PixelFormat'?
static const SDL_PixelFormatEnum TextureFormat = SDL_PIXELFORMAT_RGB565;
                                 ^~~~~~~~~~~~~~~~~~~
                                 SDL_PixelFormat
../src/main.cpp: In member function 'virtual bool VirtualMachine::set_display_size(int, int)':
../src/main.cpp:374:51: error: 'TextureFormat' was not declared in this scope
         texture = SDL_CreateTexture(renderer, TextureFormat, SDL_TEXTUREACCESS_STREAMING, display_width, display_height);
                                               ^~~~~~~~~~~~~
../src/main.cpp:374:51: note: suggested alternative: 'SDL_FreeFormat'
         texture = SDL_CreateTexture(renderer, TextureFormat, SDL_TEXTUREACCESS_STREAMING, display_width, display_height);
                                               ^~~~~~~~~~~~~
                                               SDL_FreeFormat
make: *** [Makefile:11: main.o] Error 1
bash$

So, where do I go from here? I don't really have the ability to upgrade my Fedora to the latest version at the moment.

Regards, brickviking

In main.cpp, try changing the line:

static const SDL_PixelFormatEnum TextureFormat = SDL_PIXELFORMAT_RGB565;

to:

static auto TextureFormat = SDL_PIXELFORMAT_RGB565;

and see if you can get it to compile. Let me know.

Thanks!
Dan

Yup, got it to work with that change, also had to remove the -lSDL2main from the Makefile too for my setup. Now I have to figure out how to make the interpreter wait. I right-click, and it thinks I'm selecting what's directly below the menu because it's still seeing button-down from bluebutton. No doubt if I look through the source I could find that timer, and perhaps extend it. A lot. 50ms is a bit short to expect someone to be able to react to the menu popping up.

EDIT: Ahh, there's a -delay switch. That's that problem ameliorated, at least.