Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Libdispatch errors with GCC on some Linuxes #66

Open
brinoausrino opened this issue Feb 3, 2021 · 4 comments
Open

Libdispatch errors with GCC on some Linuxes #66

brinoausrino opened this issue Feb 3, 2021 · 4 comments

Comments

@brinoausrino
Copy link

I'm trying to compile ofxHapPlayer in Arch Linux and get this preprocessing error

In File, included by /usr/include/dispatch/dispatch.h:32,
                 by /home/brian/Dev/openframeworks/addons/ofxHapPlayer/src/ofxHapPlayer.cpp:49:
/usr/include/os/generic_unix_base.h:97:54: Error: missing binary operator before token "("
   97 | #if __has_feature(objc_fixed_enum) || __has_extension(cxx_strong_enums)
      |    

Maybe some has any idea.

@bangnoise
Copy link
Owner

Are you using GCC? Are you able to try building with clang?

@brinoausrino
Copy link
Author

I built it with GCC. Right now I tried clang and it worked.
Is there some workaround for GCC?

@bangnoise
Copy link
Owner

I think this should eventually be supported by newer versions of GCC, but in the meantime this hack will lose multi-threaded decoding of chunked Hap movies, which will be bad for performance if you are using them.

Using line numbers in current master, in ofxHapPlayer.cpp:

delete line 48 #include <dispatch/dispatch.h>

replaces lines 110-111 with

    for (int i = 0; i < count; i++)
    {
        function(p, i);
    }

@bangnoise
Copy link
Owner

Leaving this open as we could remove the dependency on libdispatch on Linux.

Once OpenFrameworks supports C++17 we could use std::for_each with parallel_unsequenced_policy.

@bangnoise bangnoise changed the title Compile error at preprocessing Libdispatch errors with GCC on some Linuxes May 6, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants