Compiling terminal mp3player for Android in C and Fmod: Functions gets undefined reference





.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty{ height:90px;width:728px;box-sizing:border-box;
}







1















All functions throws undefined reference error.



Here's my code:



/*

terminal mp3 player android

requirements:
c4droid terminal fmod

requires:
copy fmod api lowlevel lib armeabi-v7a libs to lib dir

compile:
gcc -I./fmod/api/lowlevel/inc -L./fmod/api/lowlevel/lib/ mp3player.c -o mp3player

*/

#include <fmod.h>
#include <stdio.h>

static FMOD_SYSTEM * system;
static FMOD_SOUND * audioStream;

int main()
{
// Create FMOD interface object
FMOD_System_Create(&system);
FMOD_System_SetDSPBufferSize(system, 1000, 2);
FMOD_Channel_SetFrequency(0, 44100);

// Initialise FMOD
FMOD_System_Init(system, 64, FMOD_INIT_NORMAL, 0);

// Load Mp3
FMOD_System_CreateStream(system, "/storage/emulated/0/playlist/starat16.mp3", FMOD_DEFAULT, 0, &audioStream);

// Play mp3
FMOD_System_PlaySound(system, audioStream, 0, 0, 0);

return 0;
}


fmod.jar would solve the problem. How to use it or alternatives with GCC on c4droid terminal? Or should I use C with libasound? Sdl mixer works fine but it plays only one MP3 at same time and traps terminal by window.










share|improve this question































    1















    All functions throws undefined reference error.



    Here's my code:



    /*

    terminal mp3 player android

    requirements:
    c4droid terminal fmod

    requires:
    copy fmod api lowlevel lib armeabi-v7a libs to lib dir

    compile:
    gcc -I./fmod/api/lowlevel/inc -L./fmod/api/lowlevel/lib/ mp3player.c -o mp3player

    */

    #include <fmod.h>
    #include <stdio.h>

    static FMOD_SYSTEM * system;
    static FMOD_SOUND * audioStream;

    int main()
    {
    // Create FMOD interface object
    FMOD_System_Create(&system);
    FMOD_System_SetDSPBufferSize(system, 1000, 2);
    FMOD_Channel_SetFrequency(0, 44100);

    // Initialise FMOD
    FMOD_System_Init(system, 64, FMOD_INIT_NORMAL, 0);

    // Load Mp3
    FMOD_System_CreateStream(system, "/storage/emulated/0/playlist/starat16.mp3", FMOD_DEFAULT, 0, &audioStream);

    // Play mp3
    FMOD_System_PlaySound(system, audioStream, 0, 0, 0);

    return 0;
    }


    fmod.jar would solve the problem. How to use it or alternatives with GCC on c4droid terminal? Or should I use C with libasound? Sdl mixer works fine but it plays only one MP3 at same time and traps terminal by window.










    share|improve this question



























      1












      1








      1








      All functions throws undefined reference error.



      Here's my code:



      /*

      terminal mp3 player android

      requirements:
      c4droid terminal fmod

      requires:
      copy fmod api lowlevel lib armeabi-v7a libs to lib dir

      compile:
      gcc -I./fmod/api/lowlevel/inc -L./fmod/api/lowlevel/lib/ mp3player.c -o mp3player

      */

      #include <fmod.h>
      #include <stdio.h>

      static FMOD_SYSTEM * system;
      static FMOD_SOUND * audioStream;

      int main()
      {
      // Create FMOD interface object
      FMOD_System_Create(&system);
      FMOD_System_SetDSPBufferSize(system, 1000, 2);
      FMOD_Channel_SetFrequency(0, 44100);

      // Initialise FMOD
      FMOD_System_Init(system, 64, FMOD_INIT_NORMAL, 0);

      // Load Mp3
      FMOD_System_CreateStream(system, "/storage/emulated/0/playlist/starat16.mp3", FMOD_DEFAULT, 0, &audioStream);

      // Play mp3
      FMOD_System_PlaySound(system, audioStream, 0, 0, 0);

      return 0;
      }


      fmod.jar would solve the problem. How to use it or alternatives with GCC on c4droid terminal? Or should I use C with libasound? Sdl mixer works fine but it plays only one MP3 at same time and traps terminal by window.










      share|improve this question
















      All functions throws undefined reference error.



      Here's my code:



      /*

      terminal mp3 player android

      requirements:
      c4droid terminal fmod

      requires:
      copy fmod api lowlevel lib armeabi-v7a libs to lib dir

      compile:
      gcc -I./fmod/api/lowlevel/inc -L./fmod/api/lowlevel/lib/ mp3player.c -o mp3player

      */

      #include <fmod.h>
      #include <stdio.h>

      static FMOD_SYSTEM * system;
      static FMOD_SOUND * audioStream;

      int main()
      {
      // Create FMOD interface object
      FMOD_System_Create(&system);
      FMOD_System_SetDSPBufferSize(system, 1000, 2);
      FMOD_Channel_SetFrequency(0, 44100);

      // Initialise FMOD
      FMOD_System_Init(system, 64, FMOD_INIT_NORMAL, 0);

      // Load Mp3
      FMOD_System_CreateStream(system, "/storage/emulated/0/playlist/starat16.mp3", FMOD_DEFAULT, 0, &audioStream);

      // Play mp3
      FMOD_System_PlaySound(system, audioStream, 0, 0, 0);

      return 0;
      }


      fmod.jar would solve the problem. How to use it or alternatives with GCC on c4droid terminal? Or should I use C with libasound? Sdl mixer works fine but it plays only one MP3 at same time and traps terminal by window.







      android c terminal mp3 fmod






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Nov 23 '18 at 1:41









      K.Dᴀᴠɪs

      7,310112440




      7,310112440










      asked Nov 22 '18 at 21:48









      Jani VerkkomäkiJani Verkkomäki

      61




      61
























          5 Answers
          5






          active

          oldest

          votes


















          0














          I added -lfmod to end of compile command. Now it gives : fmod depends libstdc++. Install it.






          share|improve this answer































            0














            I did some changes, final code:



            /*

            terminal mp3 player android

            requirements:
            c4droid terminal fmod and install some dependencies

            requires:
            copy fmod api lowlevel lib armeabi-v7a libs to lib dir

            compile:
            gcc -I./fmod/api/lowlevel/inc -L./fmod/api/lowlevel/lib/ mp3player.c -o mp3player -lfmod

            */


            #include <fmod.h>
            #include <stdio.h>


            static FMOD_SYSTEM * system;
            static FMOD_SOUND * audioStream;
            static FMOD_BOOL * isplaying;

            int main()
            {
            // Create FMOD interface object
            FMOD_System_Create(&system);
            FMOD_System_SetDSPBufferSize(system, 1000, 2);
            FMOD_Channel_SetFrequency(0, 44100);

            // Initialise FMOD
            FMOD_System_Init(system, 64, FMOD_INIT_NORMAL, 0);

            // Load Mp3
            FMOD_System_CreateStream(system, "/storage/emulated/0/playlist/starat16.mp3", FMOD_DEFAULT, 0,
            &audioStream);

            // Play mp3
            FMOD_System_PlaySound(system, audioStream, 0, 0, 0);
            isplaying=(FMOD_BOOL *)1;
            while(FMOD_Channel_IsPlaying(0, isplaying))
            {

            }

            return 0;
            }





            share|improve this answer































              0














              no, just download and link libstdc++ headers for compiler



              compile command:



              gcc -I/storage/emulated/0/Download/fmodlowlatencymp3player/fmod/api/lowlevel/inc -I/system/inc/ -L/storage/emulated/0/Download/fmodlowlatencymp3player/fmod/api/lowlevel/lib/ -L/system/lib mp3player.c -o mp3player -lfmod -llog -lm -lstdc++






              share|improve this answer































                0














                all .so libs needs headers, download those to /system/inc and link those to gcc with -I directive .






                share|improve this answer































                  0














                  solved!



                  download and link these headers or dev packets dependencies for fmod :



                  liblog android
                  libm android
                  libstdc++ android



                  extra:
                  fmod source : compile it for android 7 and 8






                  share|improve this answer






















                    protected by Community Dec 8 '18 at 14:26



                    Thank you for your interest in this question.
                    Because it has attracted low-quality or spam answers that had to be removed, posting an answer now requires 10 reputation on this site (the association bonus does not count).



                    Would you like to answer one of these unanswered questions instead?














                    5 Answers
                    5






                    active

                    oldest

                    votes








                    5 Answers
                    5






                    active

                    oldest

                    votes









                    active

                    oldest

                    votes






                    active

                    oldest

                    votes









                    0














                    I added -lfmod to end of compile command. Now it gives : fmod depends libstdc++. Install it.






                    share|improve this answer




























                      0














                      I added -lfmod to end of compile command. Now it gives : fmod depends libstdc++. Install it.






                      share|improve this answer


























                        0












                        0








                        0







                        I added -lfmod to end of compile command. Now it gives : fmod depends libstdc++. Install it.






                        share|improve this answer













                        I added -lfmod to end of compile command. Now it gives : fmod depends libstdc++. Install it.







                        share|improve this answer












                        share|improve this answer



                        share|improve this answer










                        answered Nov 23 '18 at 3:20









                        Jani VerkkomäkiJani Verkkomäki

                        61




                        61

























                            0














                            I did some changes, final code:



                            /*

                            terminal mp3 player android

                            requirements:
                            c4droid terminal fmod and install some dependencies

                            requires:
                            copy fmod api lowlevel lib armeabi-v7a libs to lib dir

                            compile:
                            gcc -I./fmod/api/lowlevel/inc -L./fmod/api/lowlevel/lib/ mp3player.c -o mp3player -lfmod

                            */


                            #include <fmod.h>
                            #include <stdio.h>


                            static FMOD_SYSTEM * system;
                            static FMOD_SOUND * audioStream;
                            static FMOD_BOOL * isplaying;

                            int main()
                            {
                            // Create FMOD interface object
                            FMOD_System_Create(&system);
                            FMOD_System_SetDSPBufferSize(system, 1000, 2);
                            FMOD_Channel_SetFrequency(0, 44100);

                            // Initialise FMOD
                            FMOD_System_Init(system, 64, FMOD_INIT_NORMAL, 0);

                            // Load Mp3
                            FMOD_System_CreateStream(system, "/storage/emulated/0/playlist/starat16.mp3", FMOD_DEFAULT, 0,
                            &audioStream);

                            // Play mp3
                            FMOD_System_PlaySound(system, audioStream, 0, 0, 0);
                            isplaying=(FMOD_BOOL *)1;
                            while(FMOD_Channel_IsPlaying(0, isplaying))
                            {

                            }

                            return 0;
                            }





                            share|improve this answer




























                              0














                              I did some changes, final code:



                              /*

                              terminal mp3 player android

                              requirements:
                              c4droid terminal fmod and install some dependencies

                              requires:
                              copy fmod api lowlevel lib armeabi-v7a libs to lib dir

                              compile:
                              gcc -I./fmod/api/lowlevel/inc -L./fmod/api/lowlevel/lib/ mp3player.c -o mp3player -lfmod

                              */


                              #include <fmod.h>
                              #include <stdio.h>


                              static FMOD_SYSTEM * system;
                              static FMOD_SOUND * audioStream;
                              static FMOD_BOOL * isplaying;

                              int main()
                              {
                              // Create FMOD interface object
                              FMOD_System_Create(&system);
                              FMOD_System_SetDSPBufferSize(system, 1000, 2);
                              FMOD_Channel_SetFrequency(0, 44100);

                              // Initialise FMOD
                              FMOD_System_Init(system, 64, FMOD_INIT_NORMAL, 0);

                              // Load Mp3
                              FMOD_System_CreateStream(system, "/storage/emulated/0/playlist/starat16.mp3", FMOD_DEFAULT, 0,
                              &audioStream);

                              // Play mp3
                              FMOD_System_PlaySound(system, audioStream, 0, 0, 0);
                              isplaying=(FMOD_BOOL *)1;
                              while(FMOD_Channel_IsPlaying(0, isplaying))
                              {

                              }

                              return 0;
                              }





                              share|improve this answer


























                                0












                                0








                                0







                                I did some changes, final code:



                                /*

                                terminal mp3 player android

                                requirements:
                                c4droid terminal fmod and install some dependencies

                                requires:
                                copy fmod api lowlevel lib armeabi-v7a libs to lib dir

                                compile:
                                gcc -I./fmod/api/lowlevel/inc -L./fmod/api/lowlevel/lib/ mp3player.c -o mp3player -lfmod

                                */


                                #include <fmod.h>
                                #include <stdio.h>


                                static FMOD_SYSTEM * system;
                                static FMOD_SOUND * audioStream;
                                static FMOD_BOOL * isplaying;

                                int main()
                                {
                                // Create FMOD interface object
                                FMOD_System_Create(&system);
                                FMOD_System_SetDSPBufferSize(system, 1000, 2);
                                FMOD_Channel_SetFrequency(0, 44100);

                                // Initialise FMOD
                                FMOD_System_Init(system, 64, FMOD_INIT_NORMAL, 0);

                                // Load Mp3
                                FMOD_System_CreateStream(system, "/storage/emulated/0/playlist/starat16.mp3", FMOD_DEFAULT, 0,
                                &audioStream);

                                // Play mp3
                                FMOD_System_PlaySound(system, audioStream, 0, 0, 0);
                                isplaying=(FMOD_BOOL *)1;
                                while(FMOD_Channel_IsPlaying(0, isplaying))
                                {

                                }

                                return 0;
                                }





                                share|improve this answer













                                I did some changes, final code:



                                /*

                                terminal mp3 player android

                                requirements:
                                c4droid terminal fmod and install some dependencies

                                requires:
                                copy fmod api lowlevel lib armeabi-v7a libs to lib dir

                                compile:
                                gcc -I./fmod/api/lowlevel/inc -L./fmod/api/lowlevel/lib/ mp3player.c -o mp3player -lfmod

                                */


                                #include <fmod.h>
                                #include <stdio.h>


                                static FMOD_SYSTEM * system;
                                static FMOD_SOUND * audioStream;
                                static FMOD_BOOL * isplaying;

                                int main()
                                {
                                // Create FMOD interface object
                                FMOD_System_Create(&system);
                                FMOD_System_SetDSPBufferSize(system, 1000, 2);
                                FMOD_Channel_SetFrequency(0, 44100);

                                // Initialise FMOD
                                FMOD_System_Init(system, 64, FMOD_INIT_NORMAL, 0);

                                // Load Mp3
                                FMOD_System_CreateStream(system, "/storage/emulated/0/playlist/starat16.mp3", FMOD_DEFAULT, 0,
                                &audioStream);

                                // Play mp3
                                FMOD_System_PlaySound(system, audioStream, 0, 0, 0);
                                isplaying=(FMOD_BOOL *)1;
                                while(FMOD_Channel_IsPlaying(0, isplaying))
                                {

                                }

                                return 0;
                                }






                                share|improve this answer












                                share|improve this answer



                                share|improve this answer










                                answered Nov 23 '18 at 4:25









                                Jani VerkkomäkiJani Verkkomäki

                                61




                                61























                                    0














                                    no, just download and link libstdc++ headers for compiler



                                    compile command:



                                    gcc -I/storage/emulated/0/Download/fmodlowlatencymp3player/fmod/api/lowlevel/inc -I/system/inc/ -L/storage/emulated/0/Download/fmodlowlatencymp3player/fmod/api/lowlevel/lib/ -L/system/lib mp3player.c -o mp3player -lfmod -llog -lm -lstdc++






                                    share|improve this answer




























                                      0














                                      no, just download and link libstdc++ headers for compiler



                                      compile command:



                                      gcc -I/storage/emulated/0/Download/fmodlowlatencymp3player/fmod/api/lowlevel/inc -I/system/inc/ -L/storage/emulated/0/Download/fmodlowlatencymp3player/fmod/api/lowlevel/lib/ -L/system/lib mp3player.c -o mp3player -lfmod -llog -lm -lstdc++






                                      share|improve this answer


























                                        0












                                        0








                                        0







                                        no, just download and link libstdc++ headers for compiler



                                        compile command:



                                        gcc -I/storage/emulated/0/Download/fmodlowlatencymp3player/fmod/api/lowlevel/inc -I/system/inc/ -L/storage/emulated/0/Download/fmodlowlatencymp3player/fmod/api/lowlevel/lib/ -L/system/lib mp3player.c -o mp3player -lfmod -llog -lm -lstdc++






                                        share|improve this answer













                                        no, just download and link libstdc++ headers for compiler



                                        compile command:



                                        gcc -I/storage/emulated/0/Download/fmodlowlatencymp3player/fmod/api/lowlevel/inc -I/system/inc/ -L/storage/emulated/0/Download/fmodlowlatencymp3player/fmod/api/lowlevel/lib/ -L/system/lib mp3player.c -o mp3player -lfmod -llog -lm -lstdc++







                                        share|improve this answer












                                        share|improve this answer



                                        share|improve this answer










                                        answered Dec 8 '18 at 6:09









                                        Jani VerkkomäkiJani Verkkomäki

                                        61




                                        61























                                            0














                                            all .so libs needs headers, download those to /system/inc and link those to gcc with -I directive .






                                            share|improve this answer




























                                              0














                                              all .so libs needs headers, download those to /system/inc and link those to gcc with -I directive .






                                              share|improve this answer


























                                                0












                                                0








                                                0







                                                all .so libs needs headers, download those to /system/inc and link those to gcc with -I directive .






                                                share|improve this answer













                                                all .so libs needs headers, download those to /system/inc and link those to gcc with -I directive .







                                                share|improve this answer












                                                share|improve this answer



                                                share|improve this answer










                                                answered Dec 8 '18 at 6:47









                                                Jani VerkkomäkiJani Verkkomäki

                                                61




                                                61























                                                    0














                                                    solved!



                                                    download and link these headers or dev packets dependencies for fmod :



                                                    liblog android
                                                    libm android
                                                    libstdc++ android



                                                    extra:
                                                    fmod source : compile it for android 7 and 8






                                                    share|improve this answer




























                                                      0














                                                      solved!



                                                      download and link these headers or dev packets dependencies for fmod :



                                                      liblog android
                                                      libm android
                                                      libstdc++ android



                                                      extra:
                                                      fmod source : compile it for android 7 and 8






                                                      share|improve this answer


























                                                        0












                                                        0








                                                        0







                                                        solved!



                                                        download and link these headers or dev packets dependencies for fmod :



                                                        liblog android
                                                        libm android
                                                        libstdc++ android



                                                        extra:
                                                        fmod source : compile it for android 7 and 8






                                                        share|improve this answer













                                                        solved!



                                                        download and link these headers or dev packets dependencies for fmod :



                                                        liblog android
                                                        libm android
                                                        libstdc++ android



                                                        extra:
                                                        fmod source : compile it for android 7 and 8







                                                        share|improve this answer












                                                        share|improve this answer



                                                        share|improve this answer










                                                        answered Dec 8 '18 at 14:26









                                                        Jani VerkkomäkiJani Verkkomäki

                                                        61




                                                        61

















                                                            protected by Community Dec 8 '18 at 14:26



                                                            Thank you for your interest in this question.
                                                            Because it has attracted low-quality or spam answers that had to be removed, posting an answer now requires 10 reputation on this site (the association bonus does not count).



                                                            Would you like to answer one of these unanswered questions instead?



                                                            Popular posts from this blog

                                                            Biblatex bibliography style without URLs when DOI exists (in Overleaf with Zotero bibliography)

                                                            ComboBox Display Member on multiple fields

                                                            Is it possible to collect Nectar points via Trainline?