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

Undefined symbols ___isOSVersionAtLeast when use #ifdef __IPHONE_11_0 #56

Closed
MrChens opened this Issue Dec 12, 2018 · 4 comments

Comments

Projects
None yet
3 participants
@MrChens
Copy link

MrChens commented Dec 12, 2018

Mac OS 10.14
Xcode Version 10.1 (10B61)

  1. git clone -b release_70 https://github.com/HikariObfuscator/Hikari.git Hikari && mkdir Build && cd Build && cmake -G "Ninja" -DLLDB_CODESIGN_IDENTITY='' -DCMAKE_BUILD_TYPE=MinSizeRel -DLLVM_APPEND_VC_REV=on -DLLVM_CREATE_XCODE_TOOLCHAIN=on -DCMAKE_INSTALL_PREFIX=~/Library/Developer/ ../Hikari && ninja &&ninja install-xcode-toolchain && git clone https://github.com/HikariObfuscator/Resources.git ~/Hikari && rsync -a --ignore-existing /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/ ~/Library/Developer/Toolchains/Hikari.xctoolchain/ && rm ~/Library/Developer/Toolchains/Hikari.xctoolchain/ToolchainInfo.plist
  2. Xcode-->Toolchains-->Hikari
Undefined symbols for architecture arm64:
  "___isOSVersionAtLeast", referenced from:
      -[AppDelegate application:didFinishLaunchingWithOptions:] in AppDelegate.o
ld: symbol(s) not found for architecture arm64
clang-7: error: linker command failed with exit code 1 (use -v to see invocation) 

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
#ifdef __IPHONE_11_0
     if (@available(iOS 11.0, *)) {
         NSLog(@"打我啊");
     }
#else
#endif
    // Override point for customization after application launch.
    return YES;
}

  1. delete #ifdef __IPHONE_11_0,#else,#endif, that work fine.
@Naville

This comment has been minimized.

Copy link
Member

Naville commented Dec 12, 2018

You probably need to explicitly link to compiler-rt, available in your LLVM Toolchain directory

@Naville Naville added the unrelated label Dec 12, 2018

@Naville Naville closed this Dec 12, 2018

@MrChens

This comment has been minimized.

Copy link

MrChens commented Dec 13, 2018

👌, 3Q.

@Naville

This comment has been minimized.

Copy link
Member

Naville commented Dec 18, 2018

Sorry I mean clang-rt, at Hikari.xctoolchain/usr/lib/clang/10.0.0/lib/darwin/libclang_rt.ios.a (or macOS suffix)

@Naville Naville added the fixed label Dec 18, 2018

@change1wang73

This comment has been minimized.

Copy link

change1wang73 commented Jan 8, 2019

Sorry I mean clang-rt, at Hikari.xctoolchain/usr/lib/clang/10.0.0/lib/darwin/libclang_rt.ios.a (or macOS suffix)

hello,I can't understand what do u mean。 Can you explain it in more detail? what it's “clang-rt”?

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