Comments (11)
I could find none of that in my README files here, but using those two commands does allow it to compile and run.
Thank you!
from v.
should also be caught by ci
from v.
Yes, with that option, it works.
from v.
Note that this was the tvintris.v I found after "v install sdl".
The only outdated module is c2v.
Am I missing something?
from v.
sdl and c2v don't have anything to do with each other. I have confirmed this failure.
from v.
$ sdl2-config --version
2.30.6
$
from v.
v install sdl
will install a V wrapper compatible with SDL2 v2.0.8. To use vlang/sdl
you need to checkout the corresponding branch that matches the SDL2 version installed on your system.
This is all documented in the README.md. We currently can not automate this process due to how v install
/vpm currently works - we cannot run code/scripts after install to e.g. determine the user's setup.
If you are on a Unix based system you can run v ~/.vmodules/sdl/setup.vsh
that will try to determine your system install of SDL2 and checkout the corresponding branch in vlang/sdl
@wpeckham please also note that you will highly likely need to pass -d sdl_memory_no_gc
when building/running SDL2 based applications due to problems with V's garbage collector and SDL's memory allocations. (Also documented in the README.md)
Maybe vpm
could support showing a user facing message from the module upon install or update that hints what to do since we cannot automate such things with vpm currently.
from v.
If I run the setup.vsh
script to get the correct branch, it fails in a different way...
[jalon@7950x sdl]$ v run setup.vsh
Your version is 2.30.6
The SDL module officially supports these versions of SDL:
['2.0.8', '2.0.10', '2.0.12', '2.0.14', '2.0.16', '2.0.18', '2.0.20', '2.0.22', '2.0.9', '2.24.0', '2.26.0', '2.28.0', '2.30.0']
Setting up the repository to branch 2.30.0, that best matches the system SDL version: 2.30.6 ...
branch '2.30.0' set up to track 'origin/2.30.0'.
Switched to a new branch '2.30.0'
[jalon@7950x sdl]$ v -g run examples/tvintris/
INFO: compile with `v -live examples/tvintris/ `, if you want to use the @[live] function draw_begin .
tVintris -- tribute to venerable Twintris
76c551aec987 : at ???: RUNTIME ERROR: invalid memory access
76c551bb0daf : by ???
76c551bf3c60 : by ???
76c551bf901e : by ???
76c551b1a2d9 : by ???
76c551c11883 : by ???
76c551af0dd8 : by ???
/tmp/v_1000/../../../../../../home/jalon/git/sdl/sdl.c.v:82: by sdl__init
/tmp/v_1000/../../../../../../home/jalon/git/sdl/examples/tvintris/tvintris.v:231: by main__SdlContext_set_sdl_context
/tmp/v_1000/../../../../../../home/jalon/git/sdl/examples/tvintris/tvintris.v:294: by main__main
/tmp/v_1000/../../../../../../tmp/v_1000/tvintris.01J6F3JB7YZKMGN5XTPX0STVJ1.tmp.c:65417: by main
[jalon@7950x sdl]$
from v.
@JalonSolov try with -d sdl_memory_no_gc
it is a know bug as I describe above.
from v.
We have an issue tracking it here vlang/sdl#744 (comment)
from v.
This should be documented in the distributed files, but that might be considered a different issue. We can close this.
To resolve ran "v ~/.vmodules/sdl/setup.vsh"
Then compiled with the option "-d sdl_memory_no_gc"
from v.
Related Issues (20)
- can not use generic lambda expression as parameter to generic function over 2 generic types
- Failed to compile C2V HOT 7
- Support splitting Strings into Unicode Grapheme Cluster
- Regex module ignores ^ and $
- mac: Checking for existence of a key in a map using the 'in' keyword causes a segfault HOT 7
- Test failed on OpenBSD for vlib/os/os_stat_test.v HOT 1
- Test failed on OpenBSD for vlib/net/http/server_test.v
- Build fails on OpenBSD with clang and cstrict compilation HOT 3
- Map of fixed array initialisations HOT 4
- veb: parallel event loop HOT 5
- struct embedding must be declared at the beginning of the struct body HOT 2
- `coroutines` stuck whole program
- Can't add same element to cleared map HOT 2
- veb: memory leak HOT 1
- After clear(), a map allows double entries
- After calling clear() on a map several times, duplicate keys are allowed
- calling map.clear() fails to change the receiver map, in such a way that it has the exact same observable behaviour as doing `m = {}` for some maps HOT 4
- flag.FlagParser bug with certain combination of flags
- Binary crashes when compiled with tcc on OpenBSD HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from v.