1

I downloaded and compiled the following sqlite extension library: SQLITE in order to use spellfix1.


Compile and install

    $ ./configure --enable-tempstore=yes CFLAGS="-DSQLITE_HAS_CODEC" \
        LDFLAGS="-lcrypto"
    $ sudo make
    $ sudo make install

Output

Libraries have been installed in:
   /usr/share/tcltk/tcl8.6/sqlite3

If you ever happen to want to link against installed libraries
in a given directory, LIBDIR, you must either use libtool, and
specify the full pathname of the library, or use the `-LLIBDIR'
flag during linking and do at least one of the following:
   - add LIBDIR to the `LD_LIBRARY_PATH' environment variable
     during execution
   - add LIBDIR to the `LD_RUN_PATH' environment variable
     during linking
   - use the `-Wl,-rpath -Wl,LIBDIR' linker flag
   - have your system administrator add LIBDIR to `/etc/ld.so.conf'

See any operating system documentation about shared libraries for
more information, such as the ld(1) and ld.so(8) manual pages.

rm -f /usr/share/tcltk/tcl8.6/sqlite3/libtclsqlite3.la /usr/share/tcltk/tcl8.6/sqlite3/libtclsqlite3.a
/usr/bin/install -c -m 0644 pkgIndex.tcl /usr/share/tcltk/tcl8.6/sqlite3
/usr/bin/install -c -d /usr/local/bin
./libtool --mode=install /usr/bin/install -c sqlcipher /usr/local/bin
libtool: install: /usr/bin/install -c .libs/sqlcipher /usr/local/bin/sqlcipher
/usr/bin/install -c -d /usr/local/include/sqlcipher
/usr/bin/install -c -m 0644 sqlite3.h /usr/local/include/sqlcipher
/usr/bin/install -c -m 0644 /home/hani/Documents/articles/Architecture/Modules/sqlcipher/src/sqlite3ext.h /usr/local/include/sqlcipher
/usr/bin/install -c -d /usr/local/lib/pkgconfig
/usr/bin/install -c -m 0644 sqlcipher.pc /usr/local/lib/pkgconfig"

Question

I want to add this library to my project to in order to use spellfix1. For this I am using CMake. Are the steps that I following correct?


First I exported the Environment variables:

  $export SQLITE_EXT=/usr/local/include
  $export SQLITE_LIB=/usr/share/tcltk/tcl8.6

Second I added the following lines to my CMakelist file.

link_directories($ENV{SQLITE_LIB}/sqlite3)
include_directories($ENV{SQLITE_EXT}/sqlcipher)
target_link_libraries(MyProgram tclsqlite3)

Compilation error

I included #include<sqlite3ext.h>

sqlite_modern_cpp.h is an extra layer for sqlite3. error:

/MyProgram/3rdparty/sqlite_modern_cpp.h:160:8: error: ‘sqlite3_api’ was not declared in this scope

Update 1

I have no CMake error. I added SQLITE_EXTENSION_INIT1 based on what was provided in the answer. No compilate error. Right now I have a runtime error which I am going to solve.

#include <sqlite3ext.h>
SQLITE_EXTENSION_INIT1

1 Answer 1

1

In official site, there is an example extension: half. Recently, I used it with a success. Please check it out first to find out how the extension works. And if in trouble, check out this.

2
  • i'll check the first one sounds interesting. The Good part is that I was able to link the library by using cmake. The bad part is that I am having the same problem as the followingh question lol stackoverflow.com/questions/11229862/…
    – Hani Goc
    Apr 16, 2015 at 15:50
  • it's very very very complicate to create a private function. Man it's a pain in the tuchus. why is it that hard!!!!!!!!!!!!! i'll let it go try tomorrow
    – Hani Goc
    Apr 16, 2015 at 16:51

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.