godot-sqlite
godot-sqlite copied to clipboard
Encountering error on using godot sqlite: No nativescript_init in "res://addons/godot-sqlite/bin/osx/libgdsqlite.dylib" found
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:
- Create a new project
- Install Godot sqlite addon
- 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()
- 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
I just wanted to add that i am using a pretty old Mac Book air laptop. Will that make any difference?
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.
@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.
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?
I can make a pr for unit testing?
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 😢