Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support OpenBSD? #71

Closed
refacto opened this issue Feb 4, 2019 · 7 comments
Closed

Support OpenBSD? #71

refacto opened this issue Feb 4, 2019 · 7 comments

Comments

@refacto
Copy link

refacto commented Feb 4, 2019

Hi, it doesn't seem that OpenBSD is supported. (Note that in core.c, it notes that OpenBSD is supported by raylib)
Running

go get -v -u github.com/gen2brain/raylib-go/raylib

on OpenBSD -current (as of today) returns:

github.com/gen2brain/raylib-go (download)
github.com/gen2brain/raylib-go/raylib
# github.com/gen2brain/raylib-go/raylib
core.c:736:1: warning: control reaches end of non-void function [-Wreturn-type]
core.c:1360:1: warning: control reaches end of non-void function [-Wreturn-type]
core.c:1917:37: error: use of undeclared identifier 'gamepadReady'
core.c:1931:9: error: use of undeclared identifier 'gamepadReady'; did you mean 'gamepadName'?
core.c:1929:17: note: 'gamepadName' declared here
core.c:1970:37: error: use of undeclared identifier 'gamepadReady'
core.c:1970:97: error: use of undeclared identifier 'gamepadAxisState'
core.c:1982:37: error: use of undeclared identifier 'gamepadReady'
core.c:1983:10: error: use of undeclared identifier 'currentGamepadState'
core.c:1983:50: error: use of undeclared identifier 'previousGamepadState'
core.c:1984:10: error: use of undeclared identifier 'currentGamepadState'
core.c:1996:37: error: use of undeclared identifier 'gamepadReady'
core.c:1997:10: error: use of undeclared identifier 'currentGamepadState'
core.c:2009:37: error: use of undeclared identifier 'gamepadReady'
core.c:2010:10: error: use of undeclared identifier 'currentGamepadState'
core.c:2010:50: error: use of undeclared identifier 'previousGamepadState'
core.c:2011:10: error: use of undeclared identifier 'currentGamepadState'
core.c:2023:37: error: use of undeclared identifier 'gamepadReady'
core.c:2024:10: error: use of undeclared identifier 'currentGamepadState'
core.c:2045:10: error: use of undeclared identifier 'currentMouseState'; did you mean 'currentKeyState'?
core.c:320:13: note: 'currentKeyState' declared here
core.c:2045:39: error: use of undeclared identifier 'previousMouseState'; did you mean 'previousKeyState'?
core.c:319:13: note: 'previousKeyState' declared here
core.c:2045:71: error: use of undeclared identifier 'currentMouseState'; did you mean 'currentKeyState'?
core.c:320:13: note: 'currentKeyState' declared here
fatal error: too many errors emitted, stopping now [-ferror-limit=]

Is there anything I'm missing? Most of the requirements (Xlib and such) are in the base system.

Thanks for looking into this.

@refacto
Copy link
Author

refacto commented Feb 5, 2019

Here's also the output of cc core.c (which resembles the above but with more info):

core.c:736:1: warning: control reaches end of non-void function [-Wreturn-type]
}
^
core.c:1360:1: warning: control reaches end of non-void function [-Wreturn-type]
}
^

core.c:1917:37: error: use of undeclared identifier 'gamepadReady'
    if ((gamepad < MAX_GAMEPADS) && gamepadReady[gamepad]) result = true;
                                    ^
core.c:1931:9: error: use of undeclared identifier 'gamepadReady'; did you mean 'gamepadName'?
    if (gamepadReady[gamepad]) gamepadName = GetGamepadName(gamepad);
        ^~~~~~~~~~~~
        gamepadName
core.c:1929:17: note: 'gamepadName' declared here
    const char *gamepadName = NULL;
                ^
core.c:1970:37: error: use of undeclared identifier 'gamepadReady'
    if ((gamepad < MAX_GAMEPADS) && gamepadReady[gamepad] && (axis < MAX_GAMEPAD_AXIS)) value = gamepadAxisState[gamepad][axis];
                                    ^
core.c:1970:97: error: use of undeclared identifier 'gamepadAxisState'
    if ((gamepad < MAX_GAMEPADS) && gamepadReady[gamepad] && (axis < MAX_GAMEPAD_AXIS)) value = gamepadAxisState[gamepad][axis];
                                                                                                ^
core.c:1982:37: error: use of undeclared identifier 'gamepadReady'
    if ((gamepad < MAX_GAMEPADS) && gamepadReady[gamepad] && (button < MAX_GAMEPAD_BUTTONS) &&
                                    ^
core.c:1983:10: error: use of undeclared identifier 'currentGamepadState'
        (currentGamepadState[gamepad][button] != previousGamepadState[gamepad][button]) &&
         ^
core.c:1983:50: error: use of undeclared identifier 'previousGamepadState'
        (currentGamepadState[gamepad][button] != previousGamepadState[gamepad][button]) &&
                                                 ^
core.c:1984:10: error: use of undeclared identifier 'currentGamepadState'
        (currentGamepadState[gamepad][button] == 1)) pressed = true;
         ^
core.c:1996:37: error: use of undeclared identifier 'gamepadReady'
    if ((gamepad < MAX_GAMEPADS) && gamepadReady[gamepad] && (button < MAX_GAMEPAD_BUTTONS) &&
                                    ^
core.c:1997:10: error: use of undeclared identifier 'currentGamepadState'
        (currentGamepadState[gamepad][button] == 1)) result = true;
         ^
core.c:2009:37: error: use of undeclared identifier 'gamepadReady'
    if ((gamepad < MAX_GAMEPADS) && gamepadReady[gamepad] && (button < MAX_GAMEPAD_BUTTONS) &&
                                    ^
core.c:2010:10: error: use of undeclared identifier 'currentGamepadState'
        (currentGamepadState[gamepad][button] != previousGamepadState[gamepad][button]) &&
         ^
core.c:2010:50: error: use of undeclared identifier 'previousGamepadState'
        (currentGamepadState[gamepad][button] != previousGamepadState[gamepad][button]) &&
                                                 ^
core.c:2011:10: error: use of undeclared identifier 'currentGamepadState'
        (currentGamepadState[gamepad][button] == 0)) released = true;
         ^
core.c:2023:37: error: use of undeclared identifier 'gamepadReady'
    if ((gamepad < MAX_GAMEPADS) && gamepadReady[gamepad] && (button < MAX_GAMEPAD_BUTTONS) &&
                                    ^
core.c:2024:10: error: use of undeclared identifier 'currentGamepadState'
        (currentGamepadState[gamepad][button] == 0)) result = true;
         ^
core.c:2045:10: error: use of undeclared identifier 'currentMouseState'; did you mean 'currentKeyState'?
    if ((currentMouseState[button] != previousMouseState[button]) && (currentMouseState[button] == 1)) pressed = true;
         ^~~~~~~~~~~~~~~~~
         currentKeyState
core.c:320:13: note: 'currentKeyState' declared here
static char currentKeyState[512] = { 0 };       // Registers current frame key state
            ^
core.c:2045:39: error: use of undeclared identifier 'previousMouseState'; did you mean 'previousKeyState'?
    if ((currentMouseState[button] != previousMouseState[button]) && (currentMouseState[button] == 1)) pressed = true;
                                      ^~~~~~~~~~~~~~~~~~
                                      previousKeyState
core.c:319:13: note: 'previousKeyState' declared here
static char previousKeyState[512] = { 0 };      // Registers previous frame key state
            ^
core.c:2045:71: error: use of undeclared identifier 'currentMouseState'; did you mean 'currentKeyState'?
    if ((currentMouseState[button] != previousMouseState[button]) && (currentMouseState[button] == 1)) pressed = true;
                                                                      ^~~~~~~~~~~~~~~~~
                                                                      currentKeyState
core.c:320:13: note: 'currentKeyState' declared here
static char currentKeyState[512] = { 0 };       // Registers current frame key state
            ^
fatal error: too many errors emitted, stopping now [-ferror-limit=]
2 warnings and 20 errors generated.

@refacto
Copy link
Author

refacto commented Feb 5, 2019

Aha! Found out, that running cc -lm -DPLATFORM_DESKTOP -I/home/<name>/go/src/github.com/gen2brain/raylib-go/raylib/external/glfw/include core.c, compiles, but gives me linker errors: https://ptpb.pw/0oKf

@refacto
Copy link
Author

refacto commented Feb 5, 2019

Got core.c to compile with the following: cc -lm -fPIC -shared -DPLATFORM_DESKTOP -I/home/<name>/go/src/github.com/gen2brain/raylib-go/raylib/external/glfw/include core.c, for what it's worth.

@raysan5
Copy link

raysan5 commented Feb 5, 2019

@refacto what linker errors you have? maybe some missing library on linkage?

@refacto
Copy link
Author

refacto commented Feb 5, 2019

@raysan5 Hi, thanks for taking a look. I'm currently cooking up a cgo_openbsd.go file so I can properly make it work on OpenBSD

@refacto
Copy link
Author

refacto commented Feb 5, 2019

@raysan5 Okay, got it to build! Crashes upon startup though... Here if you want to take a look:
c1b6308

@gen2brain
Copy link
Owner

Support is added.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants