vlang / sdl

Official SDL2 bindings for V
https://vlang.io
MIT License
77 stars 13 forks source link

Basic window example returns C error #741

Closed MedLabs closed 8 months ago

MedLabs commented 8 months ago

V version: v 0.4.4 aeadc0a

OS: Arcolinux 24.04.02 on KDE Plasma 6.0.1

What did you do? v new try_sdl then copied the basic window main.v then v install sdl and v run .

What did you expect to see? a basic window

What did you see instead?

 las@lapsus  /backup/dev/v/scratchpad/try_sdl  v run .
==================
/tmp/v_1000/try_sdl.01HRWH9GNEA7V1BBTFE30QR0SK.tmp.c:1993: error: ';' expected (got "sdl__OSEvent")
...
==================
(Use `v -cg` to print the entire error message)

builder error: 
==================
C error. This should never happen.

This is a compiler bug, please report it using `v bug file.v`.

https://github.com/vlang/v/issues/new/choose

You can also use #help on Discord: https://discord.gg/vlang
larpon commented 8 months ago

You need to make sure the version of SDL2 installed on your system matches the major and minor version branch from this repository. v install sdl defaults to a v wrap of SDL2 2.0.8 which might not be compatible with the version installed on your system.

What is the SDL2 version installed on your system?

MedLabs commented 8 months ago

sdl2-2.30.1-1

larpon commented 8 months ago

In that case you'll need to follow the install instructions below the line containing v install sdl.

It is basically:

git clone https://github.com/vlang/sdl.git ~/.vmodules/sdl
v ~/.vmodules/sdl/setup.vsh

... or, if that fails:

git clone https://github.com/vlang/sdl.git ~/.vmodules/sdl
cd ~/.vmodules/sdl
git checkout 2.30.0

Make sure to remove ~/.vmodules/sdl beforehand since that is were v install sdl also installs to

MedLabs commented 8 months ago

there is no branch for 2.31.0 ?

JalonSolov commented 8 months ago

You said you have 2.30.1, so... why?

At any rate, no, there is no branch for 2.31, yet. Each new branch has to be manually created, taking into account the differences in the new version of sdl, etc. It doesn't happen automatically.

larpon commented 8 months ago

The latest release of SDL2 is 2.30.1 which is compatible with the matching major and minor branch of this repository. Please understand that SDL2 patch releases does not have API changes and thus 2.30.1 works fine with the 2.30.0 branch in this repository.

Also latest release is version 2.30.1 and NOT 2.31.0.

Use the 2.30.0 branch of this repository.