Skip to content
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

📱 Unable to build ios framework #147

Closed
skye-z opened this issue Dec 13, 2021 · 8 comments
Closed

📱 Unable to build ios framework #147

skye-z opened this issue Dec 13, 2021 · 8 comments

Comments

@skye-z
Copy link

skye-z commented Dec 13, 2021

😭 I need zt.framework!

I tried to visit https://download.zerotier.com/dist/sdk , and found that this page no longer exists ⛔️ , so I had to compile the SDK myself.

I clone the entire project, and executed . /build.sh iphoneos-framework, the script did not execute correctly 😱 !!!

error message is as follows

CompileC /Users/zhaoguiyang/Documents/Project/Flutter/Zerotier/libzt/cache/iphoneos-arm64-framework-Release/zt.build/Release-iphoneos/libzt_obj.build/Objects-normal/arm64/Events.o /Users/zhaoguiyang/Documents/Project/Flutter/Zerotier/libzt/src/Events.cpp normal arm64 c++ com.apple.compilers.llvm.clang.1_0.compiler (in target 'libzt_obj' from project 'zt')
    cd /Users/zhaoguiyang/Documents/Project/Flutter/Zerotier/libzt
    export LANG\=en_US.US-ASCII
    /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -x c++ -target arm64-apple-ios15.0 -fmessage-length\=362 -fdiagnostics-show-note-include-stack -fmacro-backtrace-limit\=0 -fcolor-diagnostics -Wno-trigraphs -fpascal-strings -O3 -Wno-missing-field-initializers -Wno-missing-prototypes -Wno-return-type -Wno-non-virtual-dtor -Wno-overloaded-virtual -Wno-exit-time-destructors -Wno-missing-braces -Wparentheses -Wswitch -Wno-unused-function -Wno-unused-label -Wno-unused-parameter -Wno-unused-variable -Wunused-value -Wno-empty-body -Wno-uninitialized -Wno-unknown-pragmas -Wno-shadow -Wno-four-char-constants -Wno-conversion -Wno-constant-conversion -Wno-int-conversion -Wno-bool-conversion -Wno-enum-conversion -Wno-float-conversion -Wno-non-literal-null-conversion -Wno-objc-literal-conversion -Wshorten-64-to-32 -Wno-newline-eof -Wno-c++11-extensions -DCMAKE_INTDIR\=\"Release-iphoneos\" -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS15.0.sdk -fstrict-aliasing -Wdeprecated-declarations -Winvalid-offsetof -Wno-sign-conversion -Wno-infinite-recursion -Wno-move -Wno-comma -Wno-block-capture-autoreleasing -Wno-strict-prototypes -Wno-range-loop-analysis -Wno-semicolon-before-method-body -fembed-bitcode-marker -I/Users/zhaoguiyang/Documents/Project/Flutter/Zerotier/libzt/cache/iphoneos-arm64-framework-Release/zt.build/Release/libzt_obj.build/include -I/usr/lib/jvm/java-11-openjdk-amd64/include/linux -I/Users/zhaoguiyang/Documents/Project/Flutter/Zerotier/libzt/ext/ZeroTierOne -I/Users/zhaoguiyang/Documents/Project/Flutter/Zerotier/libzt/ext/ZeroTierOne/include -I/Users/zhaoguiyang/Documents/Project/Flutter/Zerotier/libzt/ext/ZeroTierOne/node -I/Users/zhaoguiyang/Documents/Project/Flutter/Zerotier/libzt/ext/ZeroTierOne/osdep -I/Users/zhaoguiyang/Documents/Project/Flutter/Zerotier/libzt/ext/ZeroTierOne/ext/libnatpmp -I/Users/zhaoguiyang/Documents/Project/Flutter/Zerotier/libzt/src -I/Users/zhaoguiyang/Documents/Project/Flutter/Zerotier/libzt/include -I/Users/zhaoguiyang/Documents/Project/Flutter/Zerotier/libzt/ext/concurrentqueue -I/Users/zhaoguiyang/Documents/Project/Flutter/Zerotier/libzt/ext/lwip/src/include -I/Users/zhaoguiyang/Documents/Project/Flutter/Zerotier/libzt/ext/lwip-contrib/ports/unix/port/include -I/Users/zhaoguiyang/Documents/Project/Flutter/Zerotier/libzt/include/ZeroTierSockets.h -I/Users/zhaoguiyang/Documents/Project/Flutter/Zerotier/libzt/cache/iphoneos-arm64-framework-Release/zt.build/Release-iphoneos/libzt_obj.build/DerivedSources-normal/arm64 -I/Users/zhaoguiyang/Documents/Project/Flutter/Zerotier/libzt/cache/iphoneos-arm64-framework-Release/zt.build/Release-iphoneos/libzt_obj.build/DerivedSources/arm64 -I/Users/zhaoguiyang/Documents/Project/Flutter/Zerotier/libzt/cache/iphoneos-arm64-framework-Release/zt.build/Release-iphoneos/libzt_obj.build/DerivedSources -F/Users/zhaoguiyang/Documents/Project/Flutter/Zerotier/libzt/cache/iphoneos-arm64-framework-Release/zt.build/Release/libzt_obj.build -DOMIT_JSON_SUPPORT\=1 -DZTS_DISABLE_CENTRAL_API\=1 -DZT_SDK\=1 -DZT_USE_MINIUPNPC\=1 -D_USING_LWIP_DEFINITIONS_\=0 -DOMIT_JSON_SUPPORT\=1 -Wno-unused-parameter -Wall -Wextra -std\=c++11 -DZTS_NO_STDINT_H\=0 -DNDEBUG -DZT_SDK\=1 -DZT_USE_MINIUPNPC\=1 -D_USING_LWIP_DEFINITIONS_\=0 -DOMIT_JSON_SUPPORT\=1 -Wno-unused-parameter -MMD -MT dependencies -MF /Users/zhaoguiyang/Documents/Project/Flutter/Zerotier/libzt/cache/iphoneos-arm64-framework-Release/zt.build/Release-iphoneos/libzt_obj.build/Objects-normal/arm64/Events.d --serialize-diagnostics /Users/zhaoguiyang/Documents/Project/Flutter/Zerotier/libzt/cache/iphoneos-arm64-framework-Release/zt.build/Release-iphoneos/libzt_obj.build/Objects-normal/arm64/Events.dia -c /Users/zhaoguiyang/Documents/Project/Flutter/Zerotier/libzt/src/Events.cpp -o /Users/zhaoguiyang/Documents/Project/Flutter/Zerotier/libzt/cache/iphoneos-arm64-framework-Release/zt.build/Release-iphoneos/libzt_obj.build/Objects-normal/arm64/Events.o
In file included from /Users/zhaoguiyang/Documents/Project/Flutter/Zerotier/libzt/src/Events.cpp:23:
In file included from /Users/zhaoguiyang/Documents/Project/Flutter/Zerotier/libzt/src/NodeService.hpp:25:
/Users/zhaoguiyang/Documents/Project/Flutter/Zerotier/libzt/ext/ZeroTierOne/osdep/Binder.hpp:45:10: fatal error: 'netinet6/in6_var.h' file not found
#include <netinet6/in6_var.h>
         ^~~~~~~~~~~~~~~~~~~~


** BUILD FAILED **


The following build commands failed:
	CompileC /Users/zhaoguiyang/Documents/Project/Flutter/Zerotier/libzt/cache/iphoneos-arm64-framework-Release/zt.build/Release-iphoneos/libzt_obj.build/Objects-normal/arm64/NodeService.o /Users/zhaoguiyang/Documents/Project/Flutter/Zerotier/libzt/src/NodeService.cpp normal arm64 c++ com.apple.compilers.llvm.clang.1_0.compiler (in target 'libzt_obj' from project 'zt')
(1 failure)
/Users/zhaoguiyang/Documents/Project/Flutter/Zerotier/libzt
cp: /Users/zhaoguiyang/Documents/Project/Flutter/Zerotier/libzt/cache/iphoneos-arm64-framework-Release/lib/Release/*.framework: No such file or directory

 - Build cache  : /Users/zhaoguiyang/Documents/Project/Flutter/Zerotier/libzt/cache/iphoneos-arm64-framework-Release
 - Build output : /Users/zhaoguiyang/Documents/Project/Flutter/Zerotier/libzt/dist

0	/Users/zhaoguiyang/Documents/Project/Flutter/Zerotier/libzt/dist/iphoneos-arm64-framework-Release/pkg
0	/Users/zhaoguiyang/Documents/Project/Flutter/Zerotier/libzt/dist/iphoneos-arm64-framework-Release

This error message highlights netinet6/in6_var.h, I searched 🧐 the Finder and found that Kernel.framework contains this file, but this framework is a MacOS SDK, it should not appear in the build of the iOS SDK.

Please help me, thanks 🤦🏻 !

@L00rdD
Copy link

L00rdD commented May 24, 2022

Got the same issue, did someone find a solution ?

@joseph-henry
Copy link
Contributor

Try rebuilding from the dev branch. It should build now. Let me know if you run into any other issues.

@L00rdD
Copy link

L00rdD commented Jun 2, 2022

Try rebuilding from the dev branch. It should build now. Let me know if you run into any other issues.

Worked for me, add to clean cache before but the build worked 👍

@skye-z
Copy link
Author

skye-z commented Jun 2, 2022

Buildable, perfect 👏

@skye-z skye-z closed this as completed Jun 2, 2022
@abdulrehmanveemed
Copy link

Try rebuilding from the dev branch. It should build now. Let me know if you run into any other issues.

Worked for me, add to clean cache before but the build worked 👍

Framework is building but when I am building project on Xcode its giving me arch error: o framework is building now but I am not able to build the project with framework. Facing arm-64 error.

Undefined symbols for architecture arm64:
"typeinfo for std::bad_alloc", referenced from:
ZeroTier::Node::Node(void*, void*, ZT_Node_Callbacks const*, long long) in zt(Node.o)
GCC_except_table43 in zt(Node.o)
GCC_except_table45 in zt(Node.o)
GCC_except_table46 in zt(Node.o)
GCC_except_table47 in zt(Node.o)
GCC_except_table48 in zt(Node.o)
GCC_except_table49 in zt(Node.o)

@abdulrehmanveemed
Copy link

@skay-zhang Framework is building but when I am building project on Xcode its giving me arch error: o framework is building now but I am not able to build the project with framework. Facing arm-64 error.

Undefined symbols for architecture arm64:
"typeinfo for std::bad_alloc", referenced from:
ZeroTier::Node::Node(void*, void*, ZT_Node_Callbacks const*, long long) in zt(Node.o)
GCC_except_table43 in zt(Node.o)
GCC_except_table45 in zt(Node.o)
GCC_except_table46 in zt(Node.o)
GCC_except_table47 in zt(Node.o)
GCC_except_table48 in zt(Node.o)
GCC_except_table49 in zt(Node.o)

@skye-z
Copy link
Author

skye-z commented Jun 3, 2022

@skay-zhang Framework is building but when I am building project on Xcode its giving me arch error: o framework is building now but I am not able to build the project with framework. Facing arm-64 error.

Undefined symbols for architecture arm64:

"typeinfo for std::bad_alloc", referenced from:

ZeroTier::Node::Node(void*, void*, ZT_Node_Callbacks const*, long long) in zt(Node.o)

GCC_except_table43 in zt(Node.o)

GCC_except_table45 in zt(Node.o)

GCC_except_table46 in zt(Node.o)

GCC_except_table47 in zt(Node.o)

GCC_except_table48 in zt(Node.o)

GCC_except_table49 in zt(Node.o)

I am not good at iOS 😅.

You can try to exclude the arm64 instruction set from your project, or check Link Binary With Libraries.

The above suggestions are not guaranteed to work, but give it a try

@abdulrehmanveemed
Copy link

@skay-zhang excluding arm64 won't allow you to run on device then.

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

No branches or pull requests

4 participants