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

Encountering error on using godot sqlite: No nativescript_init in "res://addons/godot-sqlite/bin/osx/libgdsqlite.dylib" found #122

Open
nafey opened this issue Jan 12, 2023 · 6 comments
Labels
bug Something isn't working

Comments

@nafey
Copy link

nafey commented Jan 12, 2023

Environment:

  • OS: MacOS 10.12.5
  • Godot version: 3.5.1
  • godot-sqlite version: 3.5

Issue description:
Unable to run Godot SQLite. The SQLite.new() function fails.

Steps to reproduce:

  1. Create a new project
  2. Install Godot sqlite addon
  3. Run the following code:
extends Node2D

const SQLite = preload("res://addons/godot-sqlite/godot-sqlite-wrapper.gd")
var db
var db_name := "res://data/test.db"

func _ready():
	db = SQLite.new()

  1. The following error message in seen in the debugger window:
    res://addons/godot-sqlite/godot-sqlite-wrapper.gd:119 - at function: get_last_insert_rowid

In the error tab:
E 0:00:00.364 open_dynamic_library: Can't open dynamic library: /Users/nafey/sqlite/addons/godot-sqlite/bin/osx/libgdsqlite.dylib, error: dlopen(/Users/nafey/sqlite/addons/godot-sqlite/bin/osx/libgdsqlite.dylib, 2): Symbol not found: ____chkstk_darwin
Referenced from: /Users/nafey/sqlite/addons/godot-sqlite/bin/osx/libgdsqlite.dylib
Expected in: /usr/lib/libSystem.B.dylib
in /Users/nafey/sqlite/addons/godot-sqlite/bin/osx/libgdsqlite.dylib.
<C++ Error> Condition "!p_library_handle" is true. Returned: ERR_CANT_OPEN
<C++ Source> platform/osx/os_osx.mm:1956 @ open_dynamic_library()

E 0:00:00.364 get_symbol: No valid library handle, can't get symbol from GDNative object
<C++ Source> modules/gdnative/gdnative.cpp:510 @ get_symbol()

E 0:00:00.364 init_library: No nativescript_init in "res://addons/godot-sqlite/bin/osx/libgdsqlite.dylib" found
<C++ Source> modules/gdnative/nativescript/nativescript.cpp:1503 @ init_library()

Minimal reproduction project:
Same as above

Additional context
Screen Shot 2023-01-12 at 1 54 20 AM
Screen Shot 2023-01-12 at 1 54 11 AM

@nafey nafey added the bug Something isn't working label Jan 12, 2023
@nafey
Copy link
Author

nafey commented Jan 14, 2023

I just wanted to add that i am using a pretty old Mac Book air laptop. Will that make any difference?

@2shady4u
Copy link
Owner

Hi @nafey !

The fact that you are using an older version of a OSX might be the cause of this issue. As it is an older device, I imagine that it is an Intel-based computer (instead of a newer device which uses Apple silicon).
However, since I am exporting the GDSQLite binary as a "universal" build target this should not be an issue.
https://developer.apple.com/documentation/apple-silicon/building-a-universal-macos-binary

In the following weeks, I'll try to find some time to set up some unit testing such that I can determine the cause.

@nafey
Copy link
Author

nafey commented Jan 20, 2023

@2shady4u Thank you for your comment.

You are correct it is an older intel based mac (Intel Core i5). I will eagerly await updates on this issue.

@feefladder
Copy link
Contributor

also, in my project I do this:

const SQLite := preload("res://addons/godot-sqlite/bin/gdsqlite.gdns")

whereas you do godot-sqlite-wrapper.gd
maybe that solves it?

@feefladder
Copy link
Contributor

I can make a pr for unit testing?

@2shady4u
Copy link
Owner

2shady4u commented Feb 2, 2023

I can make a pr for unit testing?

Hi @feefladder !

You are of course free to do this 😄
My recommendation would be to use GUT:
https://github.com/bitwes/Gut

And it should be integrated into Github Actions. An example can be found here:
https://github.com/utopia-rise/fmod-gdnative/blob/39f5652c353254770d71a8886e429014eea8f4a9/.github/workflows/all_builds.yml#L361

For now it would be sufficient to only have a single unit test, which just calls the open_db()-method and solely runs on OSX.

Unfortunately, at the time of writing, I don't have sufficient free time to do this myself 😢

@2shady4u 2shady4u mentioned this issue Feb 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants