6

Recently I've been trying to learn the Raku language, and I tried to make a simple Snake Game. The code starts with this :

use SDL2::Raw;
use Cairo;

But when I compile using rakudo raku.raku, I get this error :

Cannot locate native library 'SDL2.dll': error 0x7e
  in method setup at C:\Program Files\Rakudo\share\perl6\core\sources\60460C9F1B4C4D337A9E1B809E754542AE8E6474 (NativeCall) line 319
  in method setup at C:\Program Files\Rakudo\share\perl6\core\sources\60460C9F1B4C4D337A9E1B809E754542AE8E6474 (NativeCall) line 366
  in sub raku-nativecall at C:\Program Files\Rakudo\share\perl6\core\sources\24CEF9BE56A579865C79D79E9E44D51012C345EA (NativeCall::Dispatcher) line 46
  in block <unit> at raku.raku line 10

I succesfully installed SDL2::Raw and Cairo with zef install SDL2::Raw and zef install cairo and when I type zef list, it lists the modules as installed :

===> Found via Zef::Repository::LocalCache
Cairo:ver<0.3.2>
SDL2::Raw:ver<0.3>

Random information : line 10 of raku.raku is SDL_Init(VIDEO); and line 319 of 60460C9F1B4C4D337A9E1B809E754542AE8E6474 is nqp::buildnativecall(self,

Thanks for any answer !

8nt
  • 61
  • 2

1 Answers1

5

I would check the documentation for SDL2::Raw which gives instructions on making sure you have the SDL2 libraries installed.

As it looks like you're on windows you want https://libsdl.org/download-2.0.php

Scimon Proctor
  • 4,558
  • 23
  • 22
  • Thanks ! A few weeks ago I spent hours trying to install it with no success (before installing with zef) but I'll try to find a YT tutorial so I can finally install it (sadly I'm a beginner) – 8nt Aug 03 '22 at 14:54
  • Installing with zef won't install native library dependencies; looking at SDL2::Raw, it doesn't indicate a dependency on an external lib, and has only a single test which may not error out if the native library isn't available. – Coke Aug 04 '22 at 14:53