jeudi 16 avril 2015

How to add sqlite extension Library to cmake in order to use spellfix1

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



db <<"CREATE VIRTUAL TABLE entite_virtual USING spellfix1;";


When I compile I get the following error:


what(): no such module: spellfix1


Aucun commentaire:

Enregistrer un commentaire