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. Using FMod library with Qt Creator crashes the program.
Forum Updated to NodeBB v4.3 + New Features

Using FMod library with Qt Creator crashes the program.

Scheduled Pinned Locked Moved Solved General and Desktop
5 Posts 3 Posters 945 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.
  • A Offline
    A Offline
    Aaron Kim
    wrote on last edited by Aaron Kim
    #1

    The same error in this post occurs . It seems that it can not find corresponding lib.

    QT       += core gui widgets
    
    TARGET = fmod
    TEMPLATE = app
    
    DEFINES += QT_DEPRECATED_WARNINGS
    
    
    CONFIG += c++11
    
    SOURCES += \
            main.cpp \
            mainwindow.cpp
    
    HEADERS += \
            mainwindow.h
    
    FORMS += \
            mainwindow.ui
    
    qnx: target.path = /tmp/$${TARGET}/bin
    else: unix:!android: target.path = /opt/$${TARGET}/bin
    !isEmpty(target.path): INSTALLS += target
    
    INCLUDEPATH += "D:/FMOD Studio API Windows/api/lowlevel/inc"
    LIBS += D:\FMOD Studio API Windows\api\lowlevel\lib\fmod.dll
    

    This is my pro file. I'm using minGW as compiler.

    0_1535633683326_capture.PNG
    The fmod.dll file do exist.

    [+EDIT]
    I found that it does not crash if I execute the result executable file directly. (Maybe this is because I added the lib path to system path).

    [+EDIT2]
    It doesn't crash if I put the fmod.dll in the directory where result exectuable file is. Why does this happen? I can't understand why it can not find a dll file even though I specify the path of it.

    1 Reply Last reply
    0
    • A Offline
      A Offline
      Aaron Kim
      wrote on last edited by Aaron Kim
      #2

      It works after I remove the path of lib from the system path. I have no idea what blocks the execution.

      aha_1980A 1 Reply Last reply
      0
      • A Aaron Kim

        It works after I remove the path of lib from the system path. I have no idea what blocks the execution.

        aha_1980A Offline
        aha_1980A Offline
        aha_1980
        Lifetime Qt Champion
        wrote on last edited by
        #3

        Hi @Aaron-Kim,

        1. if you use paths with spaces or non-ASCII chars in it, you can expect trouble everywhere. Please avoid this.
        2. The libs lines should be something like:
          LIBS += -LD:/FMOD Studio API Windows/api/lowlevel/lib -lfmod

        Note the forward slashes, the "-L" for the path and the "-l" for the linker include, not for the DLL!

        And please, please rename FMOD Studio API Windows to something without spaces (e.g. FMOD_Studio_API_Windows).

        Regards

        Qt has to stay free or it will die.

        A 1 Reply Last reply
        1
        • aha_1980A aha_1980

          Hi @Aaron-Kim,

          1. if you use paths with spaces or non-ASCII chars in it, you can expect trouble everywhere. Please avoid this.
          2. The libs lines should be something like:
            LIBS += -LD:/FMOD Studio API Windows/api/lowlevel/lib -lfmod

          Note the forward slashes, the "-L" for the path and the "-l" for the linker include, not for the DLL!

          And please, please rename FMOD Studio API Windows to something without spaces (e.g. FMOD_Studio_API_Windows).

          Regards

          A Offline
          A Offline
          Aaron Kim
          wrote on last edited by
          #4

          @aha_1980 Thanks! It works. Do you mind if I ask the difference between

          LIBS += -LD:/FMOD Studio API Windows/api/lowlevel/lib -lfmod
          

          and

          LIBS += D:/FMOD Studio API Windows/api/lowlevel/lib/fmod.dll
          

          this?

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

            Hi,

            In the first one, you tell the linker where it can find the .lib file (either a static or import library) and the name of the library you want to link to.

            The second line you just add the path to a .dll file which won't help because the linker don't know what to do with that kind of input.

            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
            1

            • Login

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