Results 1 to 8 of 8

Thread: Reimplementing QFtp and "Cannot mix incompatible Qt libraries" error

  1. #1
    Join Date
    Nov 2006
    Location
    Poland
    Posts
    35
    Thanks
    2
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Unix/X11

    Question Reimplementing QFtp and "Cannot mix incompatible Qt libraries" error

    I'm trying to reimplement QFtp class to add some methods I need to it.

    Everything compiles and seems to work
    but when I create a new instance of my QFtp in run-time
    program exists with "Cannot mix incompatible Qt libraries" error.

    I use sources of the very same version of Qt I have in my system.

    Simple test code attached.

    Thanks for help or any suggestions.
    Attached Files Attached Files
    Last edited by ultr; 20th March 2011 at 13:52.

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Reimplementing QFtp and "Cannot mix incompatible Qt libraries" error

    Did you rebuild all of Qt's libraries after changing the class? If not, did you at least rebuild the network library with the same options as the library contained in your system?
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  3. #3
    Join Date
    Nov 2006
    Location
    Poland
    Posts
    35
    Thanks
    2
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Unix/X11

    Default Re: Reimplementing QFtp and "Cannot mix incompatible Qt libraries" error

    Thanks for you reply.

    No, i haven't rebuilt the library.
    I include the modified class in my source code (see attachment).
    Why should I rebuild the whole Qt then?

  4. #4
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Reimplementing QFtp and "Cannot mix incompatible Qt libraries" error

    Quote Originally Posted by ultr View Post
    No, i haven't rebuilt the library.
    I include the modified class in my source code (see attachment).
    So you have two classes called QFtp? How do you expect it to work? Why don't you subclass QFtp instead of changing the original class?
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  5. #5
    Join Date
    Nov 2006
    Location
    Poland
    Posts
    35
    Thanks
    2
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Unix/X11

    Default Re: Reimplementing QFtp and "Cannot mix incompatible Qt libraries" error

    I have changed its name to UFtp and the results are the same. Test case in attachment.

    I tried subclassing - it would be the best solution.
    But the QTcpSocket I need access to is a private member of QFtpDTP, which can only be accessed with d_func().
    See src/network/access/qftp.cpp
    Attached Files Attached Files
    Last edited by ultr; 20th March 2011 at 18:07.

  6. #6
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Reimplementing QFtp and "Cannot mix incompatible Qt libraries" error

    What do you need the socket for? You can probably access the socket using QObject::findChild().
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  7. #7
    Join Date
    Nov 2006
    Location
    Poland
    Posts
    35
    Thanks
    2
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Unix/X11

    Default Re: Reimplementing QFtp and "Cannot mix incompatible Qt libraries" error

    > What do you need the socket for?
    I need to limit its read buffer size.

    > You can probably access the socket using QObject::findChild().
    First I have to get to QFtpPrivate from the subclass. Private d_func() returns it.
    But even if it make it protected/public I get an error when accessing it:
    Qt Code:
    1. uftp.cpp: In member function ‘void UFtp::setReadBufferSize(qint64)’:
    2. uftp.cpp:45:3: error: invalid use of incomplete type ‘struct QFtpPrivate’
    3. /usr/include/qt4/QtNetwork/qftp.h:57:7: error: forward declaration of ‘struct QFtpPrivate’
    To copy to clipboard, switch view to plain text mode 
    Last edited by ultr; 20th March 2011 at 18:45.

  8. #8
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Reimplementing QFtp and "Cannot mix incompatible Qt libraries" error

    Quote Originally Posted by ultr View Post
    > What do you need the socket for?
    I need to limit its read buffer size.
    I'm not sure doing it this way is a good idea. You could do it by implementing an artificial proxy and connect though that proxy.

    > You can probably access the socket using QObject::findChild().
    First I have to get to QFtpPrivate from the subclass.
    No, you don't. Unless of course you want your app to magically stop working when Qt is upgraded. You need to find another way to do what you want.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


Similar Threads

  1. Replies: 32
    Last Post: 25th August 2012, 23:10
  2. Loading plugin and "Incompatible Qt library" issue.
    By TorAn in forum Qt Programming
    Replies: 4
    Last Post: 31st May 2010, 13:04
  3. "Treat wchar_t as Built-in Type" to "yes" link error
    By sungaoyong in forum Qt Programming
    Replies: 1
    Last Post: 5th June 2008, 11:45
  4. Translation QFileDialog standart buttons ("Open"/"Save"/"Cancel")
    By victor.yacovlev in forum Qt Programming
    Replies: 4
    Last Post: 24th January 2008, 19:05
  5. QFile Problem~ "Unknow error" in "open(QIODevice::ReadWrite)"
    By fengtian.we in forum Qt Programming
    Replies: 3
    Last Post: 23rd May 2007, 15:58

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.