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] mainwindow.obj:-1: error: LNK2001: unresolved external symbol
QtWS25 Last Chance

[Solved] mainwindow.obj:-1: error: LNK2001: unresolved external symbol

Scheduled Pinned Locked Moved General and Desktop
4 Posts 2 Posters 1.6k 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.
  • M Offline
    M Offline
    MohammadReza
    wrote on last edited by
    #1

    Hello friends.

    I got into a trouble & i dont know the right solution. I searched & tried more suggestion but they dont work! :(
    i cleaned,build,rebuild, delete build directory, run qmake,etc more & more.
    I confused!
    These are the error:

    !http://upload7.ir/imgs/2014-03/91601961016608413478.jpg(http://upload7.ir/imgs/2014-03/91601961016608413478.jpg)!

    please help me.
    Thanks a lot.
    Ya Ali.

    1 Reply Last reply
    0
    • H Offline
      H Offline
      hpollak
      wrote on last edited by
      #2

      It seams like the linker couldn't find the pcap library.

      Have you set the LIB in your qmake correct?

      Something like:

      INCLUDEPATH += c:/pcap/include
      LIBS += -L c:/pcap/Lib -lwpcap ....

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

        Thanks for your response dear hpollak.
        I installed both mcvs-opengl 32bit & 64bit.
        i can solve these errors for 32bit (By declartion non-static variable !!! )
        how can i solve these similar errors for x64.
        Also, I've added INCLUDEPATH & LIBS but the errors are shown.

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

          finally i could solve one of my problem!
          if you use winpcap in your program, you must add -lwsock32 in LIBS to your .pro file. like this:

          @
          LIBS += -LC:/WpdPack/Lib -lwpcap -lpacket -lwsock32
          @

          source: http://www.qtcentre.org/threads/48269-Using-Wsock32-lib-with-QT

          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