SQLCipher error: sqlite3_key is undefined - encryption

Using:
sqlite3_key(db, "test123", 7);
throws an ||sqlite3_key is undefined|| error, but I already added sqlite3.h file and it has that method.
I realize that there is a comment whit this hint above.
** Specify the key for an encrypted database. This routine should be
** called right after sqlite3_open().
**
** The code to implement this API is not available in the public release
** of SQLite.
What could be wrong?

Your application is likely not including the CFLAG -DSQLITE_HAS_CODEC to make sqlite3_key available at compile time, please check that. For more information on the SQLCipher build process, please see this page.

Related

Error installing xml2 in R (Unable to load shared object)

Let's start with, i am pretty new to both linux (CentOS) and R.
I was given a task to install xml2 package, for that i ran
install.packages("xml2")
and error occured
** R
** inst
** byte-compile and prepare package for lazy loading'
** help
Error : unable to load shared object '/home/<username>/R/x86_64-redaht-linux-gnu-library/3.6/00LOCK-xml2/00new/xml2/libs.so':
libicui18n.so.58: cannot open shared obejct file: No such file or directory
Error: installaing RD objects failed for package 'xml2'
* removing '/home/<username>/R/x86_64-redaht-linux-gnu-library/3.6/xml2'
Then i went ahead and did some research on this issue and found much (maybe to resolve it), but couldn't really understand because of lack of knowledge.
So first thing i did was to search if i even have libicui18n.so.58 by doing locate libicui18n and could find something but not 58.
So I started by downloading ICU 58 source and compiling it manually.
It was successfully done.
Still, there was a same error. Although i could find libicui18n.so.58 by doing locate libicui18n this time.
Now i'm lost because there are so many locations where it shows all the versions of libicui18n.so.58.
Also, when i do $LD_LOCATION_PATH, there's nothing for the output.
Please, if you could, explain it to me what i need to do to resolve it now.
Also, the output of locate command is:
/home/Zach/.local/lib/python3.7/site-packages/PyQt5/Qt5/lib/libicui18n.so.56
/home/Zach/Downloads/test/icu-release-58-3/icu4c/source/lib/libicui18n.so
/home/Zach/Downloads/test/icu-release-58-3/icu4c/source/lib/libicui18n.so.58
/home/Zach/Downloads/test/icu-release-58-3/icu4c/source/lib/libicui18n.so.58.3
/opt/anaconda3/lib/libicui18n.so
/opt/anaconda3/lib/libicui18n.so.58
/opt/anaconda3/lib/libicui18n.so.58.2
/opt/anaconda3/pkgs/icu-58.2-h9c2bf20_1/lib/libicui18n.so
/opt/anaconda3/pkgs/icu-58.2-h9c2bf20_1/lib/libicui18n.so.58
/opt/anaconda3/pkgs/icu-58.2-h9c2bf20_1/lib/libicui18n.so.58.2
/opt/anaconda3/pkgs/icu-58.2-he6710b0_3/lib/libicui18n.so
/opt/anaconda3/pkgs/icu-58.2-he6710b0_3/lib/libicui18n.so.58
/opt/anaconda3/pkgs/icu-58.2-he6710b0_3/lib/libicui18n.so.58.2
/root/opt/lib/libicui18n.so
/root/opt/lib/libicui18n.so.58
/root/opt/lib/libicui18n.so.58.2
/root/opt/pkgs/icu-58.2-h9c2bf20_1/lib/libicui18n.so
/root/opt/pkgs/icu-58.2-h9c2bf20_1/lib/libicui18n.so.58
/root/opt/pkgs/icu-58.2-h9c2bf20_1/lib/libicui18n.so.58.2
/usr/lib/rstudio/lib/libicui18n.so.56
/usr/lib64/libicui18n.so
/usr/lib64/libicui18n.so.50
/usr/lib64/libicui18n.so.50.2
/usr/lib64/webkit2gtk-4.0/libicui18n.so.57
/usr/lib64/webkit2gtk-4.0/libicui18n.so.57.1
/usr/local/lib/libicui18n.so
/usr/local/lib/libicui18n.so.58
/usr/local/lib/libicui18n.so.58.3
/var/lib/docker/overlay2/8aab92bb1b0ffb1addfc835da5c31c169d7af7cc5c825a93f529ab8d4c9cdead/diff/usr/lib/x86_64-linux-gnu/libicui18n.so.66
/var/lib/docker/overlay2/8aab92bb1b0ffb1addfc835da5c31c169d7af7cc5c825a93f529ab8d4c9cdead/diff/usr/lib/x86_64-linux-gnu/libicui18n.so.66.1
/var/lib/docker/overlay2/d445cc4c7c11f7e66bcd0f198287e6b6830b33099fcfe884bc3d0e57d0116c16/diff/usr/lib/x86_64-linux-gnu/libicui18n.so.67
/var/lib/docker/overlay2/d445cc4c7c11f7e66bcd0f198287e6b6830b33099fcfe884bc3d0e57d0116c16/diff/usr/lib/x86_64-linux-gnu/libicui18n.so.67.1
/var/lib/flatpak/runtime/org.kde.Platform/x86_64/5.11/02ede84d3591a5ea8028204d86059bffaccb778159ec53c859bbc60d9e7025e8/files/lib/libicui18n.so.57
/var/lib/flatpak/runtime/org.kde.Platform/x86_64/5.11/02ede84d3591a5ea8028204d86059bffaccb778159ec53c859bbc60d9e7025e8/files/lib/libicui18n.so.57.1
/volumes/user/home/Zach/.local/lib/python3.7/site-packages/PyQt5/Qt5/lib/libicui18n.so.56
/volumes/user/home/Zach/Downloads/test/icu-release-58-3/icu4c/source/lib/libicui18n.so
/volumes/user/home/Zach/Downloads/test/icu-release-58-3/icu4c/source/lib/libicui18n.so.58
/volumes/user/home/Zach/Downloads/test/icu-release-58-3/icu4c/source/lib/libicui18n.so.58.3```

R: Suppressing renv project startup message

Typically, when starting up an renv project, one gets a message that looks something like this:
* Project '~/path/to/project' loaded. [renv 0.10.0]
I am trying to suppress this message, particularly when non-interactively running a script from this project.
Checking the package help, I noted ?config i.e. User-Level Configuration of renv. Specifically, I found synchronized.check, of which the document states is for controlling how renv lockfile synchronization is checked (this is also outputted to the console). However, I couldn't find how to control the main startup message. I also checked the ?settings but found nothing relevant either.
I've tried fiddling with options and Sys.setenv without luck so far.
So, is it possible to suppress the message, seeing that the renv script activate.R controls how the package itself is loaded?
You are correct that there isn't a specific documented way to configure this in renv. For now, you can set:
options(renv.verbose = FALSE)
before renv is loaded. (You may want to turn it back to TRUE if you want renv to display other messages as part of its normal work.)
You can suppress library startup messages with suppressPackageStartupMessages, e.g.
suppressPackageStartupMessages(library(igraph))
There is also suppressMessages for arbitrary function calls.

System.AccessViolationException with Sqlite.Connection.LoadExtension()

I have an old 2005 VB.NET application that requires a Sqlite update for JSON functions.
I have downloaded and installed "sqlite-netFx20-setup-bundle-x86-2005-1.0.109.0.exe". I removed the Reference to the older version, and re-referenced to this new version. I compiled a run the program - all seemed to be okay.
Using an online example for JSON, put the following code behind a TestButton:-
jsondb.SQL = "CREATE TABLE user (name, phone)"
ExecuteSQLiteCommand(jsondb)
jsondb.SQL = "INSERT INTO user (name, phone) values('oz', json('{""""cell"""":""""+491765"""", """"home"""":""""+498973""""}'))"
ExecuteSQLiteCommand(jsondb)
When the "INSERT" is executed, I get "json function not found".
After more research, I found that I had to enable the json extensions with:-
mySQLdb.Connection.Open()
mySQLdb.Connection.EnableExtensions(True)
mySQLdb.Connection.LoadExtension("SQLite.Interop.dll", "sqlite3_json_init")
Initially, the .LoadExtension failed because the "SQLite.Interop.dll" module was not found.
I found a copy of this module in "sqlite-netFx20-binary-Win32-2005-1.0.109.0.zip" and copied it into the Sqlite install directory, and changed the .LoadExension method to:-
mySQLdb.Connection.LoadExtension("C:\Program Files\System.Data.SQLite\2005\bin\SQLite.Interop.dll", "sqlite3_json_init")
Now the .LoadExension method raises an exception "System.AccessViolationException".
Does anyone know how I can resolve this issue?
Thanks in advance.
It seems that because I have the Sqlite Reference attribute CopyLocal=true, then the folder location for System.Data.SQLite.dll and SQLite.Interop.dll need to be the same.
Changing the .LoadExtension to:-
mySQLdb.Connection.LoadExtension(My.Application.Info.DirectoryPath & "\SQLite.Interop.dll", "sqlite3_json_init")
Fixed this.

About ROS_RMPT_SLAM package compiling issue

While doing catkin_make ROS_MRPT_SLAM, I got following error
In file included from /usr/include/mrpt/base/include/mrpt/utils/CFileGZInputStream.h:12:0,
from /home/ian/catkin_ws/src/mrpt_slam/mrpt_ekf_slam_2d/include/mrpt_ekf_slam_2d/mrpt_ekf_slam_2d.h:11,
from /home/ian/catkin_ws/src/mrpt_slam/mrpt_ekf_slam_2d/src/mrpt_ekf_slam_2d.cpp:7:
/usr/include/mrpt/base/include/mrpt/utils/CStream.h: In member function ‘void mrpt::utils::CStream::WriteVariant(T)’:
/usr/include/mrpt/base/include/mrpt/utils/CStream.h:313:15: error: use of ‘auto’ in lambda parameter declaration only available with -std=c++14 or -std=gnu++14
t.match([&](auto& o) { this->WriteObject(o); });
^
/usr/include/mrpt/base/include/mrpt/utils/CStream.h: In lambda function:
/usr/include/mrpt/base/include/mrpt/utils/CStream.h:313:45: error: no matching function for call to ‘mrpt::utils::CStream::WriteObject(int&)’
t.match([&](auto& o) { this->WriteObject(o); });
I guess it's compatibility matter or something because there were missing header files and so on.
This is the ROS_PACKAGE wiki: http://wiki.ros.org/mrpt_slam
And I just followed instruction from official MRPT website.
If the developer or anyone who is familiar with mrpt toolkit sees this question, may I get some advice about these errors?
By the way, I installed mrpt toolkit using the following website's instruction: http://www.mrpt.org/MRPT_in_GNU/Linux_repositories.
I'm the main author of MRPT and of part of the ROS packages.
Sorry for the mess, but you found us in the transition between the mrpt series 1.5.* and a new mayor rewrite based on C++14 which currently is published in git as mrpt 1.9.9 and eventually will be released as 2.0.0.
This transition must be propagated to the ros nodes, but so far we have upgraded mrpt_navigation only, mrpt_slam is in the to-do list.
So: a solution is to install an mrpt version of the 1.5.* series, and to build the ros packages from sources, paying attention to checking out the branches named compat-mrpt-1.5.
Hope this helps!

Use qjson in my Qt symbain app

I'm using Qt to develop a Symbian app.
I downloaded qjson from the link. I followed the instructions in that link and yes, I have the qjson.sis file. Now I need to use it in my app. When I tried, I got this error.
Launch failed: Command answer [command error], 1 values(s) to request: 'C|101|Processes|start|""|"MyProject.exe"|[""]|[]|true'
{"Code":-46,Format="Failed to create the process (verify that the executable and all required DLLs have been transferred) (permission denied)"}
Error: 'Failed to create the process (verify that the executable and all required DLLs have been transferred) (permission denied)' Code: -46
And when I press the launch icon, it shows, "Unable to execute file for security reasons".
Then I install the qjson.sis in my mobile and then tried to install my app, I got this error.
:-1: error: Installation failed: 'Failed to overwrite file owned by another package: c:\sys\bin\qjson.dll in ' Code: 131073; see http://wiki.forum.nokia.com/index.php/Symbian_OS_Error_Codes for descriptions of the error codes
In my .pro file I have this.
symbian: {
addFiles.sources = qjson.dll
addFiles.path = /sys/bin
DEPLOYMENT += addFiles
}
symbian: {
LIBS += -lqjson
}
Any ideas...?
Ok, I've just resolved a similar issue: it seems that your current build of QJson's library has different UID3 than the previous one that you installed on the phone.
Each .SIS file that is installed on the device has an identifier. The phone OS tracks which file was installed by which packacge, and if some new package wants to overwrite an existing file, the OS checks whether the new package has the same 'identity' than the previous owner of the file to be overwritten.
If the identity does not match, this error pops up.
There are number of reasons why this could have happened. For example, you could have simply changed the UID3 of the QJson before the build. Or, maybe you have forgot to set the library's UID3? Check the "src.pro' in the QJson project and go to the half of the file, you'd see lines:
#TARGET.UID3 =
TARGET.CAPABILITY = ReadDeviceData WriteDeviceData
If there's #, then you have forgot to set it and the build process assumed, well, letssay 'a random value'. So, now, set it to something, ie. TARGET.UID3 = 0xE0123456. Remember to correct that once you are ready to publish the application.
If a package with broken UID3 gets onto your phone and is blocking something - simply: uninstall it. Go to Settings/Installations/Installed, then find "qjson" and uninstall it. Afterwards, next installtion of qjson should succeed with no problems.

Resources