khairul169 / gdsqlite-native

SQLite module for Godot 3.x
MIT License
219 stars 41 forks source link

"Invalid call. Nonexistent function 'new' in base 'GDNativeLibrary'." Error #25

Open burakyucel07 opened 6 years ago

burakyucel07 commented 6 years ago

I'm writing the code like this:

const SQLite = preload("res://lib/gdsqlite/gdsqlite.gdnlib") var db = SQLite.new()

But it says, "Invalid call. Nonexistent function 'new' in base 'GDNativeLibrary'.".

Any suggestions?

TGRCdev commented 6 years ago

Sounds like something failed while loading the GDNative library. Read the EDIT

  1. Can you specify your operating system and your version of Godot? (If you're building from master, name the commit)
  2. Can you run your project from command line and copy any errors and post them here?

EDIT: Actually, replace "res://lib/gdsqlite/gdsqlte.gdnlib" with "res://lib/gdsqlite.gdns". The new method is within the NativeScript resource, not the GDNativeLibrary resource.

burakyucel07 commented 6 years ago

Now it says: Invalid call. Nonexistent function 'open' in base 'Reference (gdsqlite.gdns)'. I'm using Godot 3.0.1 and Windows 8.1 or OSX High Sierra. How can I run my project from command line?

On Mac, it says "Attempt to call function 'new' in base 'NativeScript' on a null instance."

burakyucel07 commented 6 years ago

I fixed the function as "open_db" and it works! But it still doesn't work in OSX. I wonder if it works in Linux, because my server will be on Linux, if it doesn't work on Linux, I can't use it.

TGRCdev commented 6 years ago

OSX is not supported yet (#22), but I can confirm that the current build works on Windows 10 64-bit and Ubuntu 18.04. If your server is on Linux, the plugin will work fine.

burakyucel07 commented 6 years ago

Thank you so much.