Open asdfzxcvbn opened 6 months ago
I am hesitant to remove an entire syntax just to appease Linux. Does whatever compiler you're using on Linux really not support @available
?
You say manually defining __isOSVersionAtLeast
fixes it, but your PR does not define it?
I am hesitant to remove an entire syntax just to appease Linux. Does whatever compiler you're using on Linux really not support
@available
?
i looked up the issue, it's a problem with the SDKs available on linux not having the symbol needed for @available
. source
You say manually defining
__isOSVersionAtLeast
fixes it, but your PR does not define it?
sorry, i originally was defining it if you see my original commit, however i switched to the SYSTEM_VERSION_GREATER_THAN_OR_EQUAL_TO
macro since defining __isOSVersionAtLeast
would break compiling on macOS.
Ah. I think you can get around that with a preprocessor macro, like
#ifdef APPLE
int __isOSVersionAtLeast = ...
#endif
Google around a bit to find the right macro
Ah. I think you can get around that with a preprocessor macro, like
#ifdef APPLE int __isOSVersionAtLeast = ... #endif
Google around a bit to find the right macro
yep, i tried that yesterday, for some reason it wouldn't work. the method was still being defined even though i used #ifdef __APPLE__
on linux. strange, honestly
Can you paste the exact code you tried? This should work… Were you using #ifdef
instead of #ifndef
? I accidentally used #ifdef
in my example
#ifndef __APPLE__
int __isOSVersionAtLeast(int major, int minor, int patch) {
NSOperatingSystemVersion version;
version.majorVersion = major;
version.minorVersion = minor;
version.patchVersion = patch;
return [NSProcessInfo.processInfo isOperatingSystemAtLeastVersion:version];
}
#endif
yeah i copy pasted that, i still get the following:
Undefined symbols for architecture arm64:
"___isOSVersionAtLeast", referenced from:
-[FLEXExplorerViewController statusWindow] in FLEXExplorerViewController.m.51039443.o
-[FLEXNavigationController viewWillAppear:] in FLEXNavigationController.m.51039443.o
ld: symbol(s) not found for architecture arm64
clang-11: error: linker command failed with exit code 1 (use -v to see invocation)
Can you try running clang somefile.m -dM -E
and pasting the output here for me?
Can you try running
clang somefile.m -dM -E
and pasting the output here for me?
huh? just on a random file?
I think so; supposedly it will output all the available preprocessor macros. It's the first step to debugging a better way to approach this
I think so; supposedly it will output all the available preprocessor macros. It's the first step to debugging a better way to approach this
no mention of __APPLE__
anywhere with this test.
Can you try using #ifdef linux
or with __linux__
?
the issue results from using
@available
. manually definingint __isOSVersionAtLeast
fixes compiling on linux.