Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. [SOLVED] Unresolved external symbols
Forum Updated to NodeBB v4.3 + New Features

[SOLVED] Unresolved external symbols

Scheduled Pinned Locked Moved General and Desktop
6 Posts 4 Posters 3.9k Views
  • 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.
  • ? Offline
    ? Offline
    A Former User
    wrote on last edited by
    #1

    Hello... I am trying to compile project that I found on the internet, but getting two unresolved external symbols... Project I am trying to compile was built with Qt4 and I am using Qt5...

    I believe errors are appearing because of PacketReceive in header...
    @public:

    //Constructor
    phHandShake();

    //Destructor
    ~phHandShake();

    //HandShake packets
    int PacketReceive(void* data);
    int PacketReceive(void* data, LPBYTE outdata, DWORD* outDataSize);
    int PacketReceive(void* data, SOCKET s);
    @

    Errors:
    phHandShake.obj:-1: error: LNK2019: unresolved external symbol _send@16 referenced in function "public: int __thiscall phHandShake::PacketReceive(void *,unsigned int)" (?PacketReceive@phHandShake@@QAEHPAXI@Z)

    phHandShake.obj:-1: error: LNK2019: unresolved external symbol __imp__CoCreateGuid@4 referenced in function "public: int __thiscall phHandShake::PacketReceive(void *)" (?PacketReceive@phHandShake@@QAEHPAX@Z)

    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi,

      It's rather that one or more of these functions are calling windows specific API(s) and you don't link to the corresponding library. In this case Ole32.lib

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      0
      • M Offline
        M Offline
        MohammadReza
        wrote on last edited by
        #3

        Hi.
        I think Sometimes this this error occurs when there is different between signature & definition or you use the functions of class wrongly(bad parameter and so on)

        Hope to solve.
        Ya Ali.

        1 Reply Last reply
        0
        • IamSumitI Offline
          IamSumitI Offline
          IamSumit
          wrote on last edited by
          #4

          Have you defined all the member functions of the class that you have declared? This problem encounters when you don't define the functions in .cpp class.

          Hope it helps.

          Be Cute

          1 Reply Last reply
          0
          • ? Offline
            ? Offline
            A Former User
            wrote on last edited by
            #5

            Hello... I added lib to .pro file, ran qmake, clean project, rebuild project...

            LIBS += -L"C:/Users/Admin/Desktop/" -lOle32

            Second error has gone, but the first one is still there...

            phHandShake.obj:-1: error: LNK2019: unresolved external symbol _send@16 referenced in function "public: int __thiscall phHandShake::PacketReceive(void *,unsigned int)" (?PacketReceive@phHandShake@@QAEHPAXI@Z)

            1 Reply Last reply
            0
            • ? Offline
              ? Offline
              A Former User
              wrote on last edited by
              #6

              Solved... Had to add one more lib - ws2_32.lib

              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