Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Mobile and Embedded
  4. Linker error on qnativesocketengine_win.obj after adding QtNetwork.lib
Forum Updated to NodeBB v4.3 + New Features

Linker error on qnativesocketengine_win.obj after adding QtNetwork.lib

Scheduled Pinned Locked Moved Mobile and Embedded
2 Posts 1 Posters 1.6k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • G Offline
    G Offline
    gpus2
    wrote on last edited by
    #1

    I'm not sure if this is a QT build issue, path issue or something else. I am using visual studio 2008 and writing software for WinCE/PocketPC devices.

    My QT build configuration had the following options
    -platform win32-msvc2008 -xplatform wincewm50pocket-msvc2008 -no-qt3support -debug-and-release

    I'm adding a new feature to an existing program to send data over HTTP. So I added some basic code to create a QNetworkAccessManager object. I added QtNetwork.lib to my project linker options and hit build on the project.

    I'm probably missing something silly, but I'm out of ideas at the moment. The following linker errors are the result of the build...

    1>QtNetwork.lib(qnativesocketengine_win.obj) : error LNK2019: unresolved external symbol WSAGetLastError referenced in function "enum QAbstractSocket::SocketType __cdecl qt_socket_getType(int)" (?qt_socket_getType@@YA?AW4SocketType@QAbstractSocket@@H@Z)

    1>QtNetwork.lib(qhostinfo_win.obj) : error LNK2001: unresolved external symbol WSAGetLastError

    1>QtNetwork.lib(qnativesocketengine_win.obj) : error LNK2019: unresolved external symbol WSASocketW referenced in function "public: bool __cdecl QNativeSocketEnginePrivate::createNewSocket(enum QAbstractSocket::SocketType,enum QAbstractSocket::NetworkLayerProtocol)" (?createNewSocket@QNativeSocketEnginePrivate@@QAA_NW4SocketType@QAbstractSocket@@W4NetworkLayerProtocol@3@@Z)

    1>QtNetwork.lib(qnativesocketengine_win.obj) : error LNK2019: unresolved external symbol WSAAccept referenced in function "public: int __cdecl QNativeSocketEnginePrivate::nativeAccept(void)" (?nativeAccept@QNativeSocketEnginePrivate@@QAAHXZ)

    1>QtNetwork.lib(qnativesocketengine_win.obj) : error LNK2019: unresolved external symbol WSARecvFrom referenced in function "public: __int64 __cdecl QNativeSocketEnginePrivate::nativeBytesAvailable(void)const " (?nativeBytesAvailable@QNativeSocketEnginePrivate@@QBA_JXZ)

    1>QtNetwork.lib(qnativesocketengine_win.obj) : error LNK2019: unresolved external symbol WSARecv referenced in function "public: __int64 __cdecl QNativeSocketEnginePrivate::nativeRead(char *,__int64)" (?nativeRead@QNativeSocketEnginePrivate@@QAA_JPAD_J@Z)

    1>QtNetwork.lib(qnativesocketengine_win.obj) : error LNK2019: unresolved external symbol WSASetLastError referenced in function "public: __int64 __cdecl QNativeSocketEnginePrivate::nativeRead(char *,__int64)" (?nativeRead@QNativeSocketEnginePrivate@@QAA_JPAD_J@Z)

    1>QtNetwork.lib(qnativesocketengine_win.obj) : error LNK2019: unresolved external symbol WSASend referenced in function "public: __int64 __cdecl QNativeSocketEnginePrivate::nativeWrite(char const *,__int64)" (?nativeWrite@QNativeSocketEnginePrivate@@QAA_JPBD_J@Z)

    1>QtNetwork.lib(qnativesocketengine_win.obj) : error LNK2019: unresolved external symbol WSANtohl referenced in function "void __cdecl qt_socket_getPortAndAddress(unsigned int,union qt_sockaddr const *,unsigned short *,class QHostAddress *)" (?qt_socket_getPortAndAddress@@YAXIPBTqt_sockaddr@@PAGPAVQHostAddress@@@Z)

    1>QtNetwork.lib(qnativesocketengine_win.obj) : error LNK2019: unresolved external symbol WSANtohs referenced in function "void __cdecl qt_socket_getPortAndAddress(unsigned int,union qt_sockaddr const *,unsigned short *,class QHostAddress *)" (?qt_socket_getPortAndAddress@@YAXIPBTqt_sockaddr@@PAGPAVQHostAddress@@@Z)

    1>QtNetwork.lib(qnativesocketengine_win.obj) : error LNK2019: unresolved external symbol WSAHtonl referenced in function "void __cdecl qt_socket_setPortAndAddress(unsigned int,struct sockaddr_in *,struct qt_sockaddr_in6 *,unsigned short,class QHostAddress const &,struct sockaddr * *,int *)" (?qt_socket_setPortAndAddress@@YAXIPAUsockaddr_in@@PAUqt_sockaddr_in6@@GABVQHostAddress@@PAPAUsockaddr@@PAH@Z)

    1>QtNetwork.lib(qnativesocketengine_win.obj) : error LNK2019: unresolved external symbol WSAHtons referenced in function "void __cdecl qt_socket_setPortAndAddress(unsigned int,struct sockaddr_in *,struct qt_sockaddr_in6 *,unsigned short,class QHostAddress const &,struct sockaddr * *,int *)" (?qt_socket_setPortAndAddress@@YAXIPAUsockaddr_in@@PAUqt_sockaddr_in6@@GABVQHostAddress@@PAPAUsockaddr@@PAH@Z)

    1>QtNetwork.lib(qnativesocketengine_win.obj) : error LNK2019: unresolved external symbol WSAConnect referenced in function "public: bool __cdecl QNativeSocketEnginePrivate::nativeConnect(class QHostAddress const &,unsigned short)" (?nativeConnect@QNativeSocketEnginePrivate@@QAA_NABVQHostAddress@@G@Z)

    1>QtNetwork.lib(qnativesocketengine_win.obj) : error LNK2019: unresolved external symbol WSASendTo referenced in function "public: __int64 __cdecl QNativeSocketEnginePrivate::nativeSendDatagram(char const *,__int64,class QHostAddress const &,unsigned short)" (?nativeSendDatagram@QNativeSocketEnginePrivate@@QAA_JPBD_JABVQHostAddress@@G@Z)

    1 Reply Last reply
    0
    • G Offline
      G Offline
      gpus2
      wrote on last edited by
      #2

      Solved it. For anyone else that might get this, I needed to add ws2.lib to my project, which is another library in the PocketPC SDK.

      1 Reply Last reply
      0

      • Login

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • Users
      • Groups
      • Search
      • Get Qt Extensions
      • Unsolved