Results 1 to 2 of 2

Thread: How to create an SQL Function in QSqlDatabase?

  1. #1
    Join Date
    Oct 2020
    Posts
    10
    Thanked 1 Time in 1 Post
    Qt products
    Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default How to create an SQL Function in QSqlDatabase?

    How to create an SQL Function in QSqlDatabase? The method, described in Adding a custom sqlite function to a Qt application it doesn't work. When sqlite3_create_function is called, the program crashes, although there is a call to sqlite3_initialize. QSqlDatabase uses C:/Qt/5.15.0/msvc2019_64/plugins/sqldrivers/qsqlite.dll, and sqlite3_create_function is called from sqlite3.c, added to the project. I added sqlite3.c because the linker does not find sqlite3_create_function

  2. #2
    Join Date
    Jun 2012
    Location
    Austria
    Posts
    22
    Thanked 1 Time in 1 Post
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: How to create an SQL Function in QSqlDatabase?

    I can't help with the specific sqlite3_create_function but the overall description of your problem would match with a version conflict between the header you use during compile and the library you use at runtime. That you have to add sqlite3.c to your project in order for the linker to find the symbol may indicate that you mix different calling conventions - the linker looks for a symbol with different marshaling. Depending on call parameters and other activities on the stack an application may survive the function entry but die with obscure symptoms later on.
    So, double check if the sqlite header and implementation belong together.

Similar Threads

  1. Replies: 4
    Last Post: 26th September 2012, 16:41
  2. To create a pause game function
    By SlaynX in forum Newbie
    Replies: 7
    Last Post: 21st June 2011, 20:51
  3. Does Qt have function to create Bézier curve?
    By lni in forum Qt Programming
    Replies: 1
    Last Post: 20th April 2009, 07:22
  4. QSqlDatabase and "CREATE DATABASE ..." ??
    By codematic in forum Qt Programming
    Replies: 19
    Last Post: 11th April 2009, 07:28
  5. how to create a new function
    By tommy in forum Qt Programming
    Replies: 3
    Last Post: 10th November 2007, 18:08

Tags for this Thread

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.