Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Installation and Deployment
  4. LNK2019 : Unresolved External Symbols referenced in function_main
QtWS25 Last Chance

LNK2019 : Unresolved External Symbols referenced in function_main

Scheduled Pinned Locked Moved Installation and Deployment
6 Posts 2 Posters 5.2k 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.
  • A Offline
    A Offline
    alok9871
    wrote on last edited by
    #1

    Please help me with a problem I've been facing

    I have been trying to add a library into my project. My project file looks like this :

    @
    QT += core gui
    greaterThan(QT_MAJOR_VERSION, 4): QT += widgets

    TARGET = sdk2
    TEMPLATE = app
     
     
     
    SOURCES += main.cpp\
    mainwindow.cpp
     
    HEADERS += mainwindow.h \
    ../../../../../SDKstudy/Runtime5.1/include/fgrab_struct.h \
    ../../../../../SDKstudy/Runtime5.1/include/fgrab_prototyp.h \
    ../../../../../SDKstudy/Runtime5.1/include/fgrab_define.h
     
    INCLUDEPATH += $$PWD/../../../../../SDKstudy/Runtime5.1\include
    DEPENDPATH += $$PWD/../../../../../SDKstudy/Runtime5.1\include
     
     
    INCLUDEPATH += C:\Users\Alok\SDKstudy\Runtime5.1\dll\mE4AD1-CL
    DEPENDPATH += C:\Users\Alok\SDKstudy\Runtime5.1\dll\mE4AD1-CL
     
     
    FORMS += mainwindow.ui
     
     
     
    LIBS += -L$$PWD/../../../../../SDKstudy/Runtime5.1/lib/visualc2005_amd64/ -lfglib5
     
    INCLUDEPATH += $$PWD/../../../../../SDKstudy/Runtime5.1/lib/visualc2005_amd64
    DEPENDPATH += $$PWD/../../../../../SDKstudy/Runtime5.1/lib/visualc2005_amd64
    

    @

    When i try to run the code i get the following error

    main.obj:-1: error: LNK2019: unresolved external symbol _Fg_Init referenced in function _main

    Can you please help me resolve this

    Many thanks

    1 Reply Last reply
    0
    • T Offline
      T Offline
      tzander
      wrote on last edited by
      #2

      looks like the lib you link to (fglib5) did not export that symbol. Are you sure its supposed to be used by your app?

      1 Reply Last reply
      0
      • A Offline
        A Offline
        alok9871
        wrote on last edited by
        #3

        Hi Thomas

        pardon me..but i did not understand by what you meant by "did not export that symbol". fglib5 is a 3rd party library very crucial for my project, and I have been unable to link it yet.

        1 Reply Last reply
        0
        • T Offline
          T Offline
          tzander
          wrote on last edited by
          #4

          http://www.gnu.org/software/gnulib/manual/html_node/Exported-Symbols-of-Shared-Libraries.html

          1 Reply Last reply
          0
          • A Offline
            A Offline
            alok9871
            wrote on last edited by
            #5

            I see.. thanks for the link.

            What is the way out then?

            1 Reply Last reply
            0
            • A Offline
              A Offline
              alok9871
              wrote on last edited by
              #6

              my compilation output is this, in case it helps

              @16:29:46: Running steps for project sdk2...
              16:29:46: Starting: "C:\Users\Alok\Qt5.0.0beta2\5.0.0-beta2\msvc2010\bin\qmake.exe" "C:\Users\Alok\Qt5.0.0beta2\Tools\Qt Creator\bin\sdk2\sdk2.pro" -r -spec win32-msvc2010 "CONFIG+=debug" "CONFIG+=qml_debug"
              16:29:47: The process "C:\Users\Alok\Qt5.0.0beta2\5.0.0-beta2\msvc2010\bin\qmake.exe" exited normally.
              16:29:47: Starting: "C:\Users\Alok\Qt5.0.0beta2\Tools\Qt Creator\bin\jom.exe"
              "C:\Users\Alok\Qt5.0.0beta2\Tools\Qt Creator\bin\jom.exe" -f Makefile.Debug
              echo 1 /* CREATEPROCESS_MANIFEST_RESOURCE_ID / 24 / RT_MANIFEST / "debug\sdk2.exe.embed.manifest">debug\sdk2.exe_manifest.rc
              if not exist debug\sdk2.exe del debug\sdk2.exe.embed.manifest>NUL 2>&1
              if exist debug\sdk2.exe.embed.manifest copy /Y debug\sdk2.exe.embed.manifest debug\sdk2.exe_manifest.bak
              link /NOLOGO /DYNAMICBASE /NXCOMPAT /DEBUG /SUBSYSTEM:WINDOWS "/MANIFESTDEPENDENCY:type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' publicKeyToken='6595b64144ccf1df' language='
              ' processorArchitecture='*'" /MANIFEST /MANIFESTFILE:debug\sdk2.exe.embed.manifest /OUT:debug\sdk2.exe @C:\Users\Alok\AppData\Local\Temp\sdk2.exe.1200.0.jom
              main.obj : error LNK2019: unresolved external symbol _Fg_Init referenced in function _main
              debug\sdk2.exe : fatal error LNK1120: 1 unresolved externals
              jom: C:\Users\Alok\Qt5.0.0beta2\Tools\Qt Creator\bin\sdk2-build-Desktop_Qt_5_0_0_beta2_MSVC2010_32bit_SDK-Debug\Makefile.Debug [debug\sdk2.exe] Error 1120
              jom: C:\Users\Alok\Qt5.0.0beta2\Tools\Qt Creator\bin\sdk2-build-Desktop_Qt_5_0_0_beta2_MSVC2010_32bit_SDK-Debug\Makefile [debug] Error 2
              16:29:47: The process "C:\Users\Alok\Qt5.0.0beta2\Tools\Qt Creator\bin\jom.exe" exited with code 2.
              Error while building/deploying project sdk2 (target: Desktop Qt 5.0.0 beta2 MSVC2010 32bit (SDK))
              When executing step 'Make'
              @

              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