akemin-dayo / simject

simject is a command-line tool and iOS dynamic library that allows developers to easily test their tweaks on the iOS Simulator.
BSD 2-Clause "Simplified" License
486 stars 55 forks source link

clang: error: using sysroot for 'iPhoneOS' but targeting 'MacOSX' #49

Closed foxfortmobile closed 5 years ago

foxfortmobile commented 5 years ago

I am trying to install simject for the first time. So i followed the instructions on the README:

git clone https://github.com/angelXwind/simject.git
cd simject/
make setup

This fails with the following log:

Mevins-MacBook-Pro:simject foxfort$ make setup messages=1
(printf "\e[0;3%im==> \e[1;39m%s…\e[m\n" 6 "Cleaning"); set -o pipefail; (rm -rf "/Users/foxfort/Documents/workspace/simject/resim/.theos/obj/macosx")
==> Cleaning…
set -o pipefail; (rm "/Users/foxfort/Documents/workspace/simject/resim/.theos/build_session")
set -o pipefail; (touch "/Users/foxfort/Documents/workspace/simject/resim/.theos/build_session")
(printf "\e[0;3%im==> \e[1;39m%s…\e[m\n" 6 "Cleaning"); set -o pipefail; (rm -rf "/Users/foxfort/Documents/workspace/simject/simject/.theos/obj/iphone_simulator")
==> Cleaning…
> Making all for tool resim…
/Applications/Xcode.app/Contents/Developer/usr/bin/make -f Makefile --no-keep-going COLOR=1 \
        internal-tool-compile \
        _THEOS_CURRENT_TYPE=tool THEOS_CURRENT_INSTANCE=resim _THEOS_CURRENT_OPERATION=compile \
        THEOS_BUILD_DIR="." _THEOS_MAKE_PARALLEL=yes
/Applications/Xcode.app/Contents/Developer/usr/bin/make -f Makefile --no-print-directory --no-keep-going internal-tool-compile _THEOS_CURRENT_TYPE="tool" THEOS_CURRENT_INSTANCE="resim" _THEOS_CURRENT_OPERATION="compile" THEOS_BUILD_DIR="." THEOS_CURRENT_ARCH="x86_64"
set -o pipefail; (mkdir -p /Users/foxfort/Documents/workspace/simject/resim/.theos/obj/macosx/debug/x86_64/)
(printf "\e[0;3%im==> \e[1;39m%s…\e[m\n" 2 "Compiling resim.mm (x86_64)"); set -o pipefail; (/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++ -x objective-c++ -c -I/Users/foxfort/theos/include -I/Users/foxfort/theos/vendor/include -I/Users/foxfort/theos/include/_fallback -include /Users/foxfort/theos/Prefix.pch -MT /Users/foxfort/Documents/workspace/simject/resim/.theos/obj/macosx/debug/x86_64/resim.mm.11d5628d.o -MMD -MP -MF "/Users/foxfort/Documents/workspace/simject/resim/.theos/obj/macosx/debug/x86_64/resim.mm.11d5628d.Td" -fcolor-diagnostics -DTARGET_MACOSX=1 -O0 -Wall -ggdb -Werror -isysroot "/Users/foxfort/theos/sdks/iPhoneOS11.2.sdk" -mmacosx-version-min=10.9 -fmodules -fcxx-modules -fmodule-name=resim -fbuild-session-file=/Users/foxfort/Documents/workspace/simject/resim/.theos/build_session -fmodules-prune-after=345600 -fmodules-prune-interval=86400 -fmodules-validate-once-per-build-session   -Wno-deprecated-declarations -DDEBUG -O0  -DTHEOS_INSTANCE_NAME="\"resim\"" -fmodules -fcxx-modules -fmodule-name=resim -fbuild-session-file=/Users/foxfort/Documents/workspace/simject/resim/.theos/build_session -fmodules-prune-after=345600 -fmodules-prune-interval=86400 -fmodules-validate-once-per-build-session  -arch x86_64               resim.mm -o /Users/foxfort/Documents/workspace/simject/resim/.theos/obj/macosx/debug/x86_64/resim.mm.11d5628d.o)
==> Compiling resim.mm (x86_64)…
clang: error: using sysroot for 'iPhoneOS' but targeting 'MacOSX' [-Werror,-Wincompatible-sysroot]
make[4]: *** [/Users/foxfort/Documents/workspace/simject/resim/.theos/obj/macosx/debug/x86_64/resim.mm.11d5628d.o] Error 1
make[3]: *** [/Users/foxfort/Documents/workspace/simject/resim/.theos/obj/macosx/debug/x86_64/resim] Error 2
make[2]: *** [internal-tool-all_] Error 2
make[1]: *** [resim.all.tool.variables] Error 2
make: *** [all] Error 2

I have both Xcode 10 and 11 installed on my mac running Mac OS 10.14. I want to run it on my ios 13 simulator. My ~/.theosrc contains the following:

SDKVERSION = 11.2
SYSROOT = $(THEOS)/sdks/iPhoneOS11.2.sdk

I have also a paid developer account and i can build and run apps from xcode on my devices. How do i fix this?

PoomSmart commented 5 years ago

You should not specify SDKVERSION and SYSROOT while you are building tweaks for iOS simulators as they will point to the native iOS SDK.

You should specify it like TARGET=simulator:clang:latest:8.0, for example.