Skip to content

errors when compiling for Android with ant #2

Open

Description

@adamski

when I include this module and try and compile for android with e.g. ant release I get lots of errors such as the following:

     [exec] /Users/adamelemental/dev/SDKs/android-ndk/platforms/android-9/arch-arm/usr/include/sys/endian.h:56:24: error: expected unqualified-id before '__extension__'
     [exec]  #define __swap16gen(x) __statement({     \
     [exec]                         ^
     [exec] /Users/adamelemental/dev/SDKs/android-ndk/platforms/android-9/arch-arm/usr/include/sys/endian.h:141:18: note: in expansion of macro '__swap16gen'
     [exec]  #define __swap16 __swap16gen
     [exec]                   ^
     [exec] /Users/adamelemental/dev/SDKs/android-ndk/platforms/android-9/arch-arm/usr/include/sys/endian.h:158:16: note: in expansion of macro '__swap16'
     [exec]  #define swap16 __swap16
     [exec]                 ^
     [exec] ../../JuceLibraryCode/modules/stk/../../../../../juce_modules/drowaudio/stk_module/stk/stk.h:181:15: note: in expansion of macro 'swap16'
     [exec]    static void swap16( unsigned char *ptr );
     [exec]                ^

Do you have any suggestions why this might happen with ant but not with Xcode?

Activity

  1. drowaudio commented on Feb 25, 2015

    @drowaudio
    Owner

    Hi Adam,

    It looks like Android might be defining macro with the same name as a function in STK. Try undeffing all any symbol clashes at the top of the stk module header (and maybe the cpp header as well). E.g.

    #undef swap16

    Let me know if that gets rid on any errors.

    Dave

    On 25 Feb 2015, at 20:27, Adam Wilson notifications@github.com wrote:

    when I include this module and try and compile for android with e.g. ant release I get lots of errors such as the following:

     [exec] /Users/adamelemental/dev/SDKs/android-ndk/platforms/android-9/arch-arm/usr/include/sys/endian.h:56:24: error: expected unqualified-id before '__extension__'
     [exec]  #define __swap16gen(x) __statement({     \
     [exec]                         ^
     [exec] /Users/adamelemental/dev/SDKs/android-ndk/platforms/android-9/arch-arm/usr/include/sys/endian.h:141:18: note: in expansion of macro '__swap16gen'
     [exec]  #define __swap16 __swap16gen
     [exec]                   ^
     [exec] /Users/adamelemental/dev/SDKs/android-ndk/platforms/android-9/arch-arm/usr/include/sys/endian.h:158:16: note: in expansion of macro '__swap16'
     [exec]  #define swap16 __swap16
     [exec]                 ^
     [exec] ../../JuceLibraryCode/modules/stk/../../../../../juce_modules/drowaudio/stk_module/stk/stk.h:181:15: note: in expansion of macro 'swap16'
     [exec]    static void swap16( unsigned char *ptr );
     [exec]                ^
    

    Do you have any suggestions why this might happen with ant but not with Xcode?

    —
    Reply to this email directly or view it on GitHub #2.

  2. adamski commented on Mar 5, 2015

    @adamski
    Author

    I tried some of the suggestions from the JUCE forum, and also your advice on both the stk.h and stk.cpp files. However still getting complaints from ant. You can see the additions I've made on my fork https://github.com/adamski/stk_module/tree/android-undefs

    Thanks for your help on this

  3. adamski commented on Mar 16, 2015

    @adamski
    Author

    See pull request for the solution that worked for me. Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions