Giter VIP home page Giter VIP logo

Comments (11)

wpeckham avatar wpeckham commented on September 4, 2024 2

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.

medvednikov avatar medvednikov commented on September 4, 2024 1

should also be caught by ci

from v.

JalonSolov avatar JalonSolov commented on September 4, 2024 1

Yes, with that option, it works.

from v.

wpeckham avatar wpeckham commented on September 4, 2024

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.

JalonSolov avatar JalonSolov commented on September 4, 2024

sdl and c2v don't have anything to do with each other. I have confirmed this failure.

from v.

JalonSolov avatar JalonSolov commented on September 4, 2024
$ sdl2-config --version
2.30.6
$

from v.

larpon avatar larpon commented on September 4, 2024

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.

JalonSolov avatar JalonSolov commented on September 4, 2024

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.

larpon avatar larpon commented on September 4, 2024

@JalonSolov try with -d sdl_memory_no_gc it is a know bug as I describe above.

from v.

larpon avatar larpon commented on September 4, 2024

We have an issue tracking it here vlang/sdl#744 (comment)

from v.

wpeckham avatar wpeckham commented on September 4, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.