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. LNK2019: unresolved external symbol __imp_fftw_execute referenced in function "private: virtual void __cdecl QFFT::run(void)"
Forum Updated to NodeBB v4.3 + New Features

LNK2019: unresolved external symbol __imp_fftw_execute referenced in function "private: virtual void __cdecl QFFT::run(void)"

Scheduled Pinned Locked Moved Solved General and Desktop
6 Posts 3 Posters 881 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.
  • V Offline
    V Offline
    vakh
    wrote on last edited by vakh
    #1

    I'm using FFTW in my project. it works with MinGW perfectly but now I want to change my compiler to MSVC (2019). so first I make .lib files according to this. then I add

    LIBS += -L "C:\fftw\fftw-3.3.5-dll64" -lfftw3-3
    INCLUDEPATH += "C:\fftw\fftw-3.3.5-dll64"
    

    to my .pro but after compilation this error occurred:

    error: LNK2019: unresolved external symbol __imp_fftw_execute referenced in function "private: virtual void __cdecl QFFT::run(void)" (?run@QFFT@@EEAAXXZ)
    

    QFFT is my internal class and FFTW functions called in run function.
    I think it cannot find the library file. what is the problem? Also I use "Add Library" to import this lib to my project but the error doesn't changed:

    win32:CONFIG(release, debug|release): LIBS += -L$$PWD/../../../../../../fftw/fftw-3.3.5-dll64/ -lfftw3-3
    else:win32:CONFIG(debug, debug|release): LIBS += -L$$PWD/../../../../../../fftw/fftw-3.3.5-dll64/ -lfftw3-3d
    else:unix: LIBS += -L$$PWD/../../../../../../fftw/fftw-3.3.5-dll64/ -lfftw3-3
    
    INCLUDEPATH += $$PWD/../../../../../../fftw/fftw-3.3.5-dll64
    DEPENDPATH += $$PWD/../../../../../../fftw/fftw-3.3.5-dll64
    

    FFTW directory in my PC:
    606a4b8c-2aa1-4b21-97dc-1d41e97baca8-image.png

    JonBJ 1 Reply Last reply
    0
    • V vakh

      I'm using FFTW in my project. it works with MinGW perfectly but now I want to change my compiler to MSVC (2019). so first I make .lib files according to this. then I add

      LIBS += -L "C:\fftw\fftw-3.3.5-dll64" -lfftw3-3
      INCLUDEPATH += "C:\fftw\fftw-3.3.5-dll64"
      

      to my .pro but after compilation this error occurred:

      error: LNK2019: unresolved external symbol __imp_fftw_execute referenced in function "private: virtual void __cdecl QFFT::run(void)" (?run@QFFT@@EEAAXXZ)
      

      QFFT is my internal class and FFTW functions called in run function.
      I think it cannot find the library file. what is the problem? Also I use "Add Library" to import this lib to my project but the error doesn't changed:

      win32:CONFIG(release, debug|release): LIBS += -L$$PWD/../../../../../../fftw/fftw-3.3.5-dll64/ -lfftw3-3
      else:win32:CONFIG(debug, debug|release): LIBS += -L$$PWD/../../../../../../fftw/fftw-3.3.5-dll64/ -lfftw3-3d
      else:unix: LIBS += -L$$PWD/../../../../../../fftw/fftw-3.3.5-dll64/ -lfftw3-3
      
      INCLUDEPATH += $$PWD/../../../../../../fftw/fftw-3.3.5-dll64
      DEPENDPATH += $$PWD/../../../../../../fftw/fftw-3.3.5-dll64
      

      FFTW directory in my PC:
      606a4b8c-2aa1-4b21-97dc-1d41e97baca8-image.png

      JonBJ Online
      JonBJ Online
      JonB
      wrote on last edited by
      #2

      @vakh
      I don't know exactly what your problem is, but I do not think it is that it cannot find a library, you should get a different message for that I think (try commenting out your LIBS += ... line and see what error you then get), rather there is an issue in how it was compiled/linked. Maybe go look at how QFFT::run() references fftw_execute() and how the latter is defined. I will say that the code looks like it is over a decade old and was last tested against VS 2010.

      V 1 Reply Last reply
      0
      • C Offline
        C Offline
        ChrisW67
        wrote on last edited by
        #3

        @vakh said in LNK2019: unresolved external symbol __imp_fftw_execute referenced in function "private: virtual void __cdecl QFFT::run(void)":

        I'm using FFTW in my project. it works with MinGW perfectly but now I want to change my compiler to MSVC (2019). so first I make .lib files according to this. then I add
        LIBS += -L "C:\fftw\fftw-3.3.5-dll64" -lfftw3-3
        INCLUDEPATH += "C:\fftw\fftw-3.3.5-dll64"

        Try removing the space following -L

        If that fails post the entire set of linker command leading up to this failure.

        V 1 Reply Last reply
        1
        • JonBJ JonB

          @vakh
          I don't know exactly what your problem is, but I do not think it is that it cannot find a library, you should get a different message for that I think (try commenting out your LIBS += ... line and see what error you then get), rather there is an issue in how it was compiled/linked. Maybe go look at how QFFT::run() references fftw_execute() and how the latter is defined. I will say that the code looks like it is over a decade old and was last tested against VS 2010.

          V Offline
          V Offline
          vakh
          wrote on last edited by vakh
          #4

          @JonB I commented INCLUDEPATH and LIBS and seen same error messages:

          error: LNK2019: unresolved external symbol __imp_fftw_execute referenced in function "private: virtual void __cdecl QFFT::run(void)" (?run@QFFT@@EEAAXXZ)
          error: LNK2019: unresolved external symbol __imp_fftw_plan_dft_1d referenced in function "private: virtual void __cdecl QFFT::run(void)" (?run@QFFT@@EEAAXXZ)
          error: LNK2019: unresolved external symbol __imp_fftw_destroy_plan referenced in function "private: virtual void __cdecl QFFT::run(void)" (?run@QFFT@@EEAAXXZ)
          error: LNK2019: unresolved external symbol __imp_fftw_alloc_complex referenced in function "private: virtual void __cdecl QFFT::run(void)" (?run@QFFT@@EEAAXXZ)
          error: LNK2019: unresolved external symbol __imp_fftw_free referenced in function "private: virtual void __cdecl QFFT::run(void)" (?run@QFFT@@EEAAXXZ)
          

          It works properly with MinGW and it must works with MSVC too. so I think QFFT::run(void) is OK.

          1 Reply Last reply
          0
          • C ChrisW67

            @vakh said in LNK2019: unresolved external symbol __imp_fftw_execute referenced in function "private: virtual void __cdecl QFFT::run(void)":

            I'm using FFTW in my project. it works with MinGW perfectly but now I want to change my compiler to MSVC (2019). so first I make .lib files according to this. then I add
            LIBS += -L "C:\fftw\fftw-3.3.5-dll64" -lfftw3-3
            INCLUDEPATH += "C:\fftw\fftw-3.3.5-dll64"

            Try removing the space following -L

            If that fails post the entire set of linker command leading up to this failure.

            V Offline
            V Offline
            vakh
            wrote on last edited by
            #5

            @ChrisW67 removing and adding INCLUDEPATH and LIBS doesn't affect the errors.

            1 Reply Last reply
            0
            • V Offline
              V Offline
              vakh
              wrote on last edited by
              #6

              the problem was wrong changing name. after using lib.exe to convert libfftw3f-3.dll to libfftw3f-3.lib. after this I changed the libfftw3f-3.lib to fftw3f-3.lib to detected by QT. but it's wrong. the name must not changed and I used this in my .pro file.

              # MinGW
              #INCLUDEPATH += "c:\fftw\fftw-3.3.5-dll64"
              #LIBS += -L "C:\fftw\fftw-3.3.5-dll64" -lfftw3-3
              
              # MSVC
              INCLUDEPATH += "c:\fftw\fftw-3.3.5-dll64"
              LIBS += -L"C:\fftw\fftw-3.3.5-dll64" -llibfftw3-3
              

              and now my FFTW folder contains these files:
              0bd8cce9-10f4-4afd-9b7c-0d8be22ea9fc-image.png

              1 Reply Last reply
              0
              • V vakh has marked this topic as solved on

              • Login

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