ofxHapPlayer
ofxHapPlayer copied to clipboard
Libdispatch errors with GCC on some Linuxes
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.
Are you using GCC? Are you able to try building with clang?
I built it with GCC. Right now I tried clang and it worked. Is there some workaround for GCC?
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);
}
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
.