Results 1 to 3 of 3

Thread: QSqlRecord problem

  1. #1
    Join Date
    Mar 2006
    Posts
    140
    Thanks
    8
    Thanked 4 Times in 3 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default QSqlRecord problem

    Hi,

    I've been trying to make use of the QSqlQueryModel class to display items in a list view while retaining extra data that I need later on. This removes the need for another db call.

    QSqlQueryModel has a function called 'record' which returns a QSqlRecord.
    If I try to instantiate a QSqlRecord or any call which creates a QSqlRecord, ie the call to 'record' I get the following error when compiling:

    Error 2 error LNK2019: unresolved external symbol "__declspec(dllimport) public: __thiscall QSqlRecord::~QSqlRecord(void)" (__imp_??1QSqlRecord@@QAE@XZ) referenced in function "private: void __thiscall ImageView:n_lwImages_clicked(class QModelIndex)" (?on_lwImages_clicked@ImageView@@AAEXVQModelIndex@ @@Z) imageview.obj

    If I try to declare 'QSqlRecord *record;' then the build error isn't raised, it's only when a call to create the object is used.

    I'm running 4.1.4 on Win32 in VS 2k5.
    I actually built Qt with nmake from 2k3 so I thought maybe that was causing some problems. So I tried it in 2k3 and the issue was still there.

    My 4.1.4 folder doesn't actually have the object file, only headers which explains the error, but my 4.2.0-snapshot-20060923 has the debug and release obj under /src/sql/tmp/obj.
    4.2.0 was the release I was using when I found the problem, even though these obj's are there.

    I'm building the MySql plugin in each version, and all other QSql module classes I've used are working, so can anyone suggest why these aren't being built / linked into the final libraries?



    Thanks,

    Steve

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    5,372
    Thanks
    28
    Thanked 976 Times in 912 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: QSqlRecord problem

    Does this error occur when you use Qt 4.1.4?

  3. #3
    Join Date
    Mar 2006
    Posts
    140
    Thanks
    8
    Thanked 4 Times in 3 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: QSqlRecord problem

    Yes.

    Although I did try to create a fresh test project to see what would happen.
    I think that the problem might relate to my project files.
    I've been trying out recent snapshots of 4.2.0 and had to manually alter the .vcproj files Qt Version number. It wouldn't build against 4.2.0 unless I did that.
    ut, I'm guessing somewhere along the line things have got a little messed up, and simply switching back to 4.1.4 isn't working.

    I'll rebuild my project files today and see what happens.



    Steve

Similar Threads

  1. QTimer problem ... it runs but never triggs
    By yellowmat in forum Newbie
    Replies: 4
    Last Post: 4th July 2006, 12:54
  2. Grid Layout Problem
    By Seema Rao in forum Qt Programming
    Replies: 2
    Last Post: 4th May 2006, 12:45
  3. Problem with bitBlt
    By yellowmat in forum Newbie
    Replies: 1
    Last Post: 5th April 2006, 14:08
  4. fftw problem
    By lordy in forum General Programming
    Replies: 1
    Last Post: 16th March 2006, 21:36
  5. Replies: 16
    Last Post: 7th March 2006, 15:57

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.