Open pipiche38 opened 4 years ago
I'm sorry i have no experience in embedding python
in c
or c++
, but I tried lua
and c++
for a quick test, as lua
uses the default *.so
provided by OS, and the c++
uses this static sqlite-amalgamation with no problem.
This repo has a different include/lib path than system-wide sqlite, so your c/c++ will never get confused. I guess that you need to explicitly wrap these static functions into lua
(or perhaps python
) to use them there.
BTW you may want to trace/debug the sqlite functions to find out which version is being called.
I try to trace what is happening with @pipiche38 issue.
I got this trace: We can see that Plugins.cpp asks for python code execution, which leads to pysqlite and the libsqlite3.so before the embedded sqlite-almagamation. On my tests, it only appears after the database creation on a 'SELECT * FROM '. There is a segmentation fault because some parameters are not correctly initialized when running sqlite-almagamation, probably done in libsqlite3.so.
This is more a question than an issue.
Python3 can be embedded in a C/C++ code and so forth can execute python3 code which use sqlite3.
In case we have a C/C++ code using SQLite3-almagamation and at the same time we have python3 calling SQLite via the shared library is the code safe ?
In other words don't we have a risk of conflict between the 2 same code ?