When compiling a project that mixes C, C++, and Objective-C with Clang, an error occurs indicating that system functions cannot be found. This might be a module issue. Is this because the compiled Clang does not support modules, or is there another reason? If it’s a problem with Clang, how can I compile Clang to make it work like the Clang that comes with Xcode?
I have tried replacing it with the toolchain from version 17.0.4 of https://github.com/llvm/llvm-project/releases?page=2, but I still encounter the same issue where system functions cannot be found. I also tried compiling https://github.com/61bcdefg/Hikari-Swift and using the Hikari toolchain, but the system functions still cannot be found.
When I change the “Enable Modules (C and Objective-C)” setting to “No” in the Xcode project settings, it compiles successfully. However, this causes issues with SDK integration. Therefore, I need to resolve the module issue rather than changing this setting.
When using the Clang that comes with Xcode, it compiles successfully without any issues.
cmake command:
cmake -DCMAKE_BUILD_TYPE=Release -DLLVM_CREATE_XCODE_TOOLCHAIN=ON -DCMAKE_INSTALL_PREFIX=../install/ -DLLVM_ENABLE_PROJECTS=all -DLLVM_ENABLE_RUNTIMES=all ../llvm
xcode error:
No visible @interface for ‘NSString’ declares the selector ‘dataUsingEncoding:’
No known class method for selector ‘stringWithCString:encoding:’
enter image description here
please help me, thanks
who can tell me how to solve the question
blue boy is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.