Results 1 to 3 of 3

Thread: SQLCipher, Windows and Mac OS

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Jan 2012
    Posts
    46
    Thanks
    11
    Qt products
    Qt4
    Platforms
    MacOS X Windows

    Default SQLCipher, Windows and Mac OS

    Afternoon all --

    I've managed to perform a minor miracle and have compiled SQLCipher in Windows and on my Mac (following these instructions: https://sites.google.com/site/lukesh...er-for-windows and http://www.qtcentre.org/wiki/index.php?title=Building_QSQLITE_driver_with_AES-256_encryption_support_(Linux). On the Mac, w/out doing anything beyond the directions, when I execute the following code,

    Qt Code:
    1. #include <QtGui>
    2. #include <QtSql>
    3.  
    4. int main(int argc, char *argv[])
    5. {
    6. QApplication a(argc, argv);
    7. qDebug() << QSqlDatabase::drivers();
    8. return 0;
    9. }
    To copy to clipboard, switch view to plain text mode 

    "QSQLCIPHER" does indeed show up. In Windows, I have modified my .pro to point to the new libraries accordingly, like so:
    Qt Code:
    1. win32 {
    2. message("Compiling for Windows!")
    3. LIBS += \
    4. c:\sqlcipher\.libs\libeay32.lib \
    5. c:\sqlcipher\.libs\libsqlite3.a \
    6. c:\sqlcipher\.libs\libgcc.a
    7.  
    8. INCLUDEPATH += c:\sqlcipher\
    9. }
    To copy to clipboard, switch view to plain text mode 
    but I *don't* see QSQLCIPHER using the same main.cpp

    So, now I'm stuck as to what to "include" to use SQLCipher on both platforms, and there's not much documentation out there about that. I tried to open my DB (that's non-encrypted right now) using SQLCipher on the Mac, and the database didn't open (and the error told me nothing). Obviously I'm missing something easy, possible the correct "include", so please feel free to embarrass me in getting beyond this. I'm stuck on the Windows side trying to make the code "see" SQLCipher and then on both platforms actually using it.


    Kodi

    ps -- still googling in the meantime and will update if I figure it out

    Ed. additional question -- is the sqlite3.h file created in the sqlcipher directory something I know need to be including? Should move it to build directory and/or add that directly into my project? Also, I found this link: https://code.google.com/p/qsqlcipher4win/downloads/list with a pre-compiled .dll (or course, after I spend hours creating a static one). Will I know how to add a library to my project I still can't get Windows working, and I think it's got something to do with the header file and making sure I have the right library linked in.
    Last edited by mtnbiker66; 11th October 2012 at 21:22.

Similar Threads

  1. Using NCReport with SQLCipher
    By SIFE in forum Qt Programming
    Replies: 2
    Last Post: 12th March 2012, 17:02
  2. Replies: 2
    Last Post: 16th November 2011, 22:19
  3. Encrypting an existing sqlite database in sqlcipher
    By thefatladysingsopera in forum Newbie
    Replies: 5
    Last Post: 21st October 2011, 18:47
  4. AES-256 encrypted SQLite databases with SQLCipher
    By Lykurg in forum Installation and Deployment
    Replies: 10
    Last Post: 29th July 2011, 03:22
  5. Replies: 2
    Last Post: 6th September 2010, 14:22

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.