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]Can`t link FMOD in Windows.
Forum Updated to NodeBB v4.3 + New Features

[SOLVED]Can`t link FMOD in Windows.

Scheduled Pinned Locked Moved General and Desktop
13 Posts 2 Posters 4.8k 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.
  • H Offline
    H Offline
    heatblazer
    wrote on last edited by
    #1

    Hello. I am using FMOD in my project. It`s working on linux, but when I try to compile Win32 it gives me that:
    @
    :-1: error: error: /FMOD/Win32/libs/ -lfmodex: No such file or directory
    @
    Here is my pro. file:
    @
    #-------------------------------------------------#

    Project created by QtCreator 2014-11-04T22:15:51#

    #-------------------------------------------------#

    QT += core gui multimedia

    linux {
    message("*using settings for linux")
    #FMOD linux
    INCLUDEPATH += /home/ilian/fmodstudioapi10509linux/api/lowlevel/inc/
    LIBS += -L/home/ilian/fmodstudioapi10509linux/api/lowlevel/lib/x86/ -lfmod
    }

    win32 {
    message("*using settings for windows")
    #FMOD windows
    INCLUDEPATH += "$$_PRO_FILE_PWD/FMOD/Win32/inc/"
    LIBS += "$$_PRO_FILE_PWD/FMOD/Win32/libs/ -lfmodex"
    }

    greaterThan(QT_MAJOR_VERSION, 4): QT += widgets

    TARGET = MathForFun
    TEMPLATE = app
    RESOURCES += application.qrc

    SOURCES +=
    MainWindow.cpp
    ActionRectItem.cpp
    ActionEllipseItem.cpp
    TextNodes.cpp
    GameOfNumbers.cpp
    AssetManager.cpp
    WindowFrame.cpp
    Callbacks.cpp
    FModePlayer.cpp

    HEADERS +=
    MainWindow.h
    ActionRectItem.h
    ActionEllipseItem.h
    TextNodes.h
    GameOfNumbers.h
    AssetManager.h
    GameObserver.h
    WindowFrame.h
    LayoutFactory.h
    Callbacks.h
    FModePlayer.h

    FORMS +=

    @
    IMPORTANT. I am using qtcreator MingGW build under Fedora with Wine. So if there is a workaround please help.
    [EDIT] Ive read about linking the libfmod.a if using mingw but I dont understand how to do it in the pro file or do I have to use the pragma?
    [SOLVED] I was able to solve that problem now each time I click the circles the sound is played:
    https://www.flickr.com/photos/heatblazer/15877532839/

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

      I have to bump this with the similar android question:
      How to link it for android? I am using Qt creator for Fedora ( native not emulated ) and my FMOD dir is in tht QT project I wish to deploy to on my android device.

      1 Reply Last reply
      0
      • Chris KawaC Offline
        Chris KawaC Offline
        Chris Kawa
        Lifetime Qt Champion
        wrote on last edited by
        #3

        @
        LIBS += "$$_PRO_FILE_PWD/FMOD/Win32/libs/ -lfmodex"
        @

        You're linking to fmod on linux but to fmodex on windows. This should be -lfmod for windows too.

        I don't know about android.

        1 Reply Last reply
        0
        • H Offline
          H Offline
          heatblazer
          wrote on last edited by
          #4

          OK. Here is what Ive changed: @ win32 { message("*using settings for windows") #FMOD INCLUDEPATH += /home/ilian/QT5/MathForFun/FMOD/Win32/api/lowlevel/inc/ LIBS += -L/home/ilian/QT5/MathForFun/FMOD/Win32/api/lowlevel/lib/ -lfmod } @ Now I get completely missing all of the functions I called with FMOD: @ Z:\home\ilian\QT5\MathForFun\FModePlayer.cpp:-1: error: undefined reference to FMOD::System::createSound(char const*, unsigned int, FMOD_CREATESOUNDEXINFO*, FMOD::Sound**)@20'
          @

          So like I can`t get why is that :(

          1 Reply Last reply
          0
          • Chris KawaC Offline
            Chris KawaC Offline
            Chris Kawa
            Lifetime Qt Champion
            wrote on last edited by
            #5

            I know little about wine, but shouldn't you include the drive letter in the paths?
            And have you re-run qmake after the changes?

            1 Reply Last reply
            0
            • H Offline
              H Offline
              heatblazer
              wrote on last edited by
              #6

              I`ve tried with
              @
              LIBS += Z:/home/ilian/QT5/MathForFun/FMOD/Win32/api/lowlevel/lib/
              @
              and got this
              @
              :-1: error: cannot find Z:/home/ilian/QT5/MathForFun/FMOD/Win32/api/lowlevel/lib/: Permission denied
              @
              Weird stuff... I should try building it on real Windows with VSC :(

              1 Reply Last reply
              0
              • Chris KawaC Offline
                Chris KawaC Offline
                Chris Kawa
                Lifetime Qt Champion
                wrote on last edited by
                #7

                Sounds reasonable. Maybe try to chmod the permissions for that directory.

                1 Reply Last reply
                0
                • H Offline
                  H Offline
                  heatblazer
                  wrote on last edited by
                  #8

                  I did. Nothing happened. Ive also tried to point to this folder: @ Z:/home/ilian/.wine/drive_c/Program Files/FMOD SoundSystem/FMOD Studio API Windows/api/lowlevel/lib/ @ Apparently where Ive installed the fmod, but it tells me that
                  @
                  :-1: error: error: /home/ilian/.wine/drive_c/Program\Files/FMOD: No such file or directory
                  @
                  Really no idea....

                  1 Reply Last reply
                  0
                  • Chris KawaC Offline
                    Chris KawaC Offline
                    Chris Kawa
                    Lifetime Qt Champion
                    wrote on last edited by
                    #9

                    You've got a space in the folder name "FMOD SoundSystem". Tools hate that.

                    1 Reply Last reply
                    0
                    • H Offline
                      H Offline
                      heatblazer
                      wrote on last edited by
                      #10

                      So what should I do? Rename my dirs?
                      [quote author="Chris Kawa" date="1419069554"]You've got a space in the folder name "FMOD SoundSystem". Tools hate that.[/quote]

                      1 Reply Last reply
                      0
                      • Chris KawaC Offline
                        Chris KawaC Offline
                        Chris Kawa
                        Lifetime Qt Champion
                        wrote on last edited by
                        #11

                        Either that or copy the relevant files to some path without spaces e.g. your app directory or something.

                        1 Reply Last reply
                        0
                        • H Offline
                          H Offline
                          heatblazer
                          wrote on last edited by
                          #12

                          Here: http://www.qtcentre.org/threads/2831-Qt-and-fmod is a guy who says its working. However I dont have libfmodex.a to my download for Windows. I have libfmod.a and libfmodL.a. I changed to this:
                          @
                          INCLUDEPATH += Z:/home/ilian/.wine/drive_c/FMODSoundSystem/FMODStudioAPIWindows/api/lowlevel/inc/
                          LIBS += Z:/home/ilian/.wine/drive_c/FMODSoundSystem/FMODStudioAPIWindows/api/lowlevel/lib/libfmod.a
                          @
                          But I still get the undefined references to all fmod functions I`ve called.

                          1 Reply Last reply
                          0
                          • H Offline
                            H Offline
                            heatblazer
                            wrote on last edited by
                            #13

                            Thank you, mr.Chris Kawa. I was able to make it work in Wine + MinGW. Apparenlty Ive read there were C++ ABI problems, so Ive changed my function to the pure C API they support like that:
                            @
                            bool FMPlayer::systemInit(const char *fname, int len) {

                            FMOD_CREATESOUNDEXINFO *info = new FMOD_CREATESOUNDEXINFO();
                            info->cbsize = sizeof(FMOD_CREATESOUNDEXINFO);
                            info->length = len;
                            FMOD_CHANNEL *channel;
                            //FMOD::Channel* channel;
                            //FMOD::System* system;
                            //FMOD::Sound* sound;
                            //FMOD::System_Create(&system);
                            FMOD_SYSTEM *system;
                            FMOD_SOUND *sound;
                            FMOD_System_Create(&system);
                            FMOD_System_Init(system, 32, FMOD_INIT_NORMAL, 0);
                            
                            //system->init(32, FMOD_INIT_NORMAL, 0);
                            if ( FMOD_OK == ( FMOD_System_CreateSound(system,
                                                  fname,FMOD_OPENMEMORY, info, &sound)) ) {
                            

                            // if ( FMOD_OK == system->createSound(fname,
                            // FMOD_OPENMEMORY, info, &sound) ) {

                                FMOD_Sound_SetMode(sound, FMOD_LOOP_OFF);
                            

                            // sound->setMode(FMOD_LOOP_OFF);
                            // system->playSound(sound, false, 0, &channel);
                            FMOD_System_PlaySound(system, sound, false, 0, &channel);
                            return true;
                            } else {
                            return false;
                            }
                            }
                            @
                            Ive left the commented code to see what Ive changed. Now it plays the desired sound... Whew. That was nasty. I got worried I wont be able to fix it. Thanks for the help. Ill avoid and whitespaces from now on. Regards from a newbie coder like me :)

                            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