node-raylib icon indicating copy to clipboard operation
node-raylib copied to clipboard

WARNING: Failed to get monitor

Open acklavidian opened this issue 6 years ago • 8 comments

I'm on OSX:10.14.6. brew install raylib lets me install raylib and run the C examples without fail. However, after installing via npm and running the example in the Readme I get:

$ node main.js
INFO: Initializing raylib 2.5
WARNING: Failed to get monitor
INFO: Target time per frame: 16.667 milliseconds
[1]    55919 segmentation fault  node main.js

acklavidian avatar Dec 06 '19 15:12 acklavidian

Interesting... Perhaps it needs an update to the latest Raylib.

RobLoach avatar Dec 06 '19 16:12 RobLoach

I think Raylib is still at 2.5.0. However, I can get the C equivalent to the example program in the README to run with:

clang -framework CoreVideo -framework IOKit -framework Cocoa -framework GLUT -framework OpenGL -I./node_modules/raylib/build/_deps/raylib-src/src node_modules/raylib/build/_deps/raylib-build/src/libraylib.a main.c -o my_app

I assume this means the raylib built by npm is working.

On another note npm install node-raylib fails if you already have raylib installed via brew...

acklavidian avatar Dec 06 '19 23:12 acklavidian

@RobLoach any ideas on where to start trying to fix this?

acklavidian avatar Dec 10 '19 17:12 acklavidian

Possibly something like this? https://github.com/RobLoach/node-raylib/pull/43

RobLoach avatar Dec 11 '19 19:12 RobLoach

~Nice!!! Thanks that branch works!!!~ Sorry got this confused with another raylib binding library that is also giving me trouble Vraylib. Unfortunately, there is no change when using the update branch from that PR. Same error message except it reports that it is using raylib2.6-dev in the beginning. What environment/system are you developing/running this on? Thanks for helping me on this!

acklavidian avatar Dec 12 '19 04:12 acklavidian

@RobLoach I am thinking the error is generated here: https://github.com/raysan5/raylib/blob/b8246d8592dba4d1f0ee49831f86d99ce0c7dff1/src/core.c#L869

acklavidian avatar Dec 12 '19 16:12 acklavidian

Alright... Went through and updated raylib. Hopefully it's working now. Mind testing again?

Also, mind sharing part of your main.js so I could test on my machine? THANKS!

RobLoach avatar Apr 01 '20 04:04 RobLoach

Unfortunately not. I've moved on to your quickjs based lib. Hoping I can get it to work on OSX and build for a rasberrypi

acklavidian avatar Apr 11 '20 20:04 acklavidian