Results 1 to 4 of 4

Thread: VS2008 build error for connect function

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Aug 2007
    Posts
    13
    Thanks
    3
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11

    Default VS2008 build error for connect function

    I'm developing a client server application using winsock2.h functions of windows.
    But I have also some Gui's which are coded in QT 4.7 in the project.

    This part of the code is casue a build error:

    code :

    Qt Code:
    1. // Connect to server
    2. iResult= connect( ConnectSocket, (SOCKADDR*) &clientService, sizeof(clientService) );
    3. if (iResult == SOCKET_ERROR)
    4. {
    5. printf( "Failed to connect.\n" );
    6. WSACleanup();
    7. }
    To copy to clipboard, switch view to plain text mode 

    build error:

    1>.\client_thread.cpp(80) : error C2664: 'bool QObject::connect(const QObject *,const char *,const char *,Qt::ConnectionType) const' : cannot convert parameter 1 from 'SOCKET' to 'const QObject *'
    1> Conversion from integral type to pointer type requires reinterpret_cast, C-style cast or function-style cast

    Compiler is assuming that the connect function is the function of QT (connect signal slot).

    How can I solve this ?
    Last edited by high_flyer; 11th February 2011 at 09:28. Reason: code tags

Similar Threads

  1. error message in Ti SEH in VS2008 with QT 4.7.1 & QWT 5.1.1
    By stevethefirst in forum General Programming
    Replies: 4
    Last Post: 5th June 2012, 12:30
  2. help - need to build Qt libraries on 64Bit VS2008
    By caius9090 in forum Installation and Deployment
    Replies: 2
    Last Post: 15th November 2010, 21:18
  3. Runtime error QtGui4.dll VS2008
    By mbisotto in forum Installation and Deployment
    Replies: 3
    Last Post: 20th October 2010, 19:52
  4. Compile Qt 4.6.2 with VS2008 - exception in release build, debug ok
    By LynneV in forum Installation and Deployment
    Replies: 0
    Last Post: 7th June 2010, 04:52
  5. LNK 2019 Error while compiling qt program in VS2008
    By mevkurray in forum Qt for Embedded and Mobile
    Replies: 3
    Last Post: 7th February 2010, 00:29

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
  •  
Qt is a trademark of The Qt Company.