Skip to content

Issue with Foreign Function Interface (FFI) and Graphics in Version 12.27 Console (Win_64) #280

@luizmoura1

Description

@luizmoura1

Hello SmallBASIC Team,

I am experiencing persistent issues with SmallBASIC version 12.27 (Console Win_64, Apr 26 2024) on Windows 10/11. I am trying to use the Raylib plugin, but I've encountered several roadblocks that seem related to the interpreter's core handling of external libraries and internal modules.

Technical Environment:

OS: Windows (AMD64)

Version: SmallBASIC 12.27 Console Win_64

Library: libraylib.dll (confirmed to be in the path/folder)

The Issues encountered:

FFI Syntax Errors: When attempting to use export or dlopen within a unit, the interpreter frequently returns Variable is NOT an array or Undefined SUB/FUNC code: EXTERN, even when following standard documentation for plugin headers.

Case Sensitivity/Symbol Lookup: Even after confirming via binary inspection that a symbol exists (e.g., INITWINDOW), the interpreter fails to link it, returning Export symbol 'INITWINDOW' not found.

Core Modules Missing: Surprisingly, the native graphics command returns Undefined SUB/FUNC code: GRAPHICS in this specific Console Win_64 build, preventing even basic non-plugin drawing.

Process Hang: Some attempts to load external DLLs results in a hanging cursor (infinite loop) without any error output or window initialization.

Could you clarify if the 12.27 Win_64 Console build has known limitations regarding the Graphics module or if there is a specific requirement for the libraylib.dll architecture (32 vs 64 bit) and naming convention (StdCall/Cdecl) to work with this version?

Best regards,
Luiz

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions