Closed SimoneAncona closed 1 year ago
@SimoneAncona thanks for trying this out. SDL support is somewhat of a work-in-progress, so I appreciate the feedback. Could you let me know the steps you did before this, that is, the specific commands you executed to build and run the code? Also, this looks like Windows, could you let me know what shell / terminal program you're running these commands in?
@SimoneAncona thanks for trying this out. SDL support is somewhat of a work-in-progress, so I appreciate the feedback. Could you let me know the steps you did before this, that is, the specific commands you executed to build and run the code? Also, this looks like Windows, could you let me know what shell / terminal program you're running these commands in?
First of all i downloaded the latest SDL2 (2.26.5) library from GitHub and unzipped the tar.gz file into C:\
Then I installed raster and passed the locate_sdl.js check
To build I used npm run build
that build my TypeScript project
But when i run the project it crashes.
I use PowerShell as shell but I also tried with WSL Ubuntu bash
Thank you, this is very helpful info. I'm able to reproduce this problem and will work on a fix, I hope to have one ready soon. Also it looks like SDL changed their download page and raster.js needs to update its docs.
Could you please try out a workaround? From the SDL releases page download SDL2-2.26.5-win32-x64.zip
(the first link), unzip it and place the file SDL2.dll
in the same directory that you're running npm
/ node
commands in.
This step shouldn't be necessary in the long-term, I would just like to have you try it out and see if it fixes this immediate error that you're reporting.
Could you please try out a workaround? From the SDL releases page download
SDL2-2.26.5-win32-x64.zip
(the first link), unzip it and place the fileSDL2.dll
in the same directory that you're runningnpm
/node
commands in.This step shouldn't be necessary in the long-term, I would just like to have you try it out and see if it fixes this immediate error that you're reporting.
I moved the SDL2.dll and it works
Glad to hear it! I think I know the proper fix, I'll get it in soon and then close this issue.
I published a new version of raster.js, it's version 0.7.9. It fixes this issue by using a postinstall hook to copy the SDL2.dll into the proper location in node_modules after the native addon gets built. If you uninstall raster and delete the SDL2.dll file you copied into your project folder, then installing this new version should work. Just make sure that the zip you've dowloaded from SDL's releases is the "devel" version. The full installation instructions have been updated: https://github.com/dustmop/rasterjs#nodejs
After building and running the project i recive the following error:
I noticed that, in the file node_env.js, in the first line there is a require to a file that does not exists.
../build/Release/native
is the relative path used to import a C++ module