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

SpatialiteOnQt : "Unable to execute statement" "no such function : load_extension" #2

Open
am2222 opened this issue Dec 2, 2017 · 5 comments

Comments

@am2222
Copy link

am2222 commented Dec 2, 2017

Hi,
I tried to use your provided example in stackoverflow but I faced this error.

"Unable to execute statement" "no such function : load_extension"
Is there any solutions for that?
thanks

@eyllanesc
Copy link
Owner

eyllanesc commented Dec 2, 2017 via email

@am2222
Copy link
Author

am2222 commented Dec 2, 2017

@eyllanesc I am on Linux unbuntu and QT 5.9.1 and SQLite version 3.16.2 2017-01-06 16:32:41
This is output of your application

Error: cannot load the Spatialite extension ( "no such function: load_extension Unable to execute statement" )
0
true
false
0 false
1 false
2 false
3 false
4 false
5 false
6 false
7 false
8 false
9 false
false

@eyllanesc
Copy link
Owner

eyllanesc commented Dec 2, 2017

You have installed the spatialite development package: libspatialite-dev and libsqlite3-mod-spatialite?

@am2222
Copy link
Author

am2222 commented Dec 2, 2017

@eyllanesc yes I can call SELECT load_extension('mod_spatialite') directly from any sqlite db manager and it works. Do I need recompile QT's sqlplugin?

@eyllanesc
Copy link
Owner

I did not have the need to do so, reviewing several forums I have seen several suggest recompiling the sqlplugin adding the following: sqlite.pri:

DEFINES += SQLITE_ENABLE_LOAD_EXTENSION SQLITE_ENABLE_RTREE SQLITE_OMIT_COMPLETE

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

2 participants