Unable to merge Unity 5 into our iOS application - ios
We have a large and complicated application and we are looking to upgrade our 3d engine to Unity 5.0. But I am having trouble integrating Unity.
I been trying to follow these tutorials but constant errors keep poping up whatever I do.
http://www.the-nerd.be/2014/09/08/sandbox-unity-app-in-existing-ios-app/
http://www.makethegame.net/unity/add-unity3d-to-native-ios-app-with-unity-5-and-vuforia-4-x/
http://www.markuszancolo.at/2014/05/integrating-unity-into-a-native-ios-app/
If I just add the "Libraries" and the "Classes" folders into my project, I get an odd amount errors. It gets confused with other c code in the project(really doesn't like msgpack) and tries to import the wrong files (ILCPP files). If I remove all offending code from the project I still have a list of errors with the native cstring class.
CompileC
/Users/jess/Library/Developer/Xcode/DerivedData/CricHQ-bsrxghpplcwahnadlgmwxmzwbxff/Build/Intermediates/CricHQ.build/Debug-iphoneos/CricHQ.build/Objects-normal/armv7/main-5D1DD4E92C87F57A.o
Classes/Other/main.mm normal armv7 objective-c++
com.apple.compilers.llvm.clang.1_0.compiler
cd /Users/jess/Projects/GIT/CricHQ-iPhone
export LANG=en_US.US-ASCII
export PATH="/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin:/Applications/Xcode.app/Contents/Developer/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin"
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang
-x objective-c++ -arch armv7 -fmessage-length=0 -fdiagnostics-show-note-include-stack -fmacro-backtrace-limit=0 -std=c++11 -stdlib=libc++ -fobjc-arc -fmodules -fmodules-cache-path=/Users/jess/Library/Developer/Xcode/DerivedData/ModuleCache
-fmodules-prune-interval=86400 -fmodules-prune-after=345600 -fbuild-session-file=/Users/jess/Library/Developer/Xcode/DerivedData/ModuleCache/Session.modulevalidation
-fmodules-validate-once-per-build-session -Wno-trigraphs -fpascal-strings -O0 -Werror=incompatible-pointer-types -Wmissing-field-initializers -Wmissing-prototypes -Wno-return-type -Wimplicit-atomic-properties -Wno-receiver-is-weak -Warc-repeated-use-of-weak -Wexplicit-ownership-type -Wimplicit-retain-self -Wno-non-virtual-dtor -Wno-overloaded-virtual -Wexit-time-destructors -Wduplicate-method-match -Wno-missing-braces -Wparentheses -Wswitch -Wno-unused-function -Wno-unused-label -Wno-unused-parameter -Wunused-variable -Wunused-value -Wempty-body -Wuninitialized -Wno-unknown-pragmas -Wno-shadow -Wno-four-char-constants -Wno-conversion -Wno-constant-conversion -Wint-conversion -Wno-bool-conversion -Wenum-conversion -Wassign-enum -Wno-shorten-64-to-32 -Wno-newline-eof -Wno-selector -Wstrict-selector-match -Wno-undeclared-selector -Wdeprecated-implementations -Wc++11-extensions -DDEBUG=1 -DOBJC_OLD_DISPATCH_PROTOTYPES=0 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.3.sdk
-fstrict-aliasing -Wprotocol -Wdeprecated-declarations -Winvalid-offsetof -g -fvisibility=hidden -fvisibility-inlines-hidden -Wno-sign-conversion -miphoneos-version-min=7.0 -I/Users/jess/Library/Developer/Xcode/DerivedData/CricHQ-bsrxghpplcwahnadlgmwxmzwbxff/Build/Intermediates/CricHQ.build/Debug-iphoneos/CricHQ.build/CricHQ\
Next.hmap
-I/Users/jess/Library/Developer/Xcode/DerivedData/CricHQ-bsrxghpplcwahnadlgmwxmzwbxff/Build/Products/Debug-iphoneos/include
-I/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include
-I/Users/jess/Projects/GIT/CricHQ-iPhone/Libraries -I/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.3.sdk/usr/include/libxml2
-I/Users/jess/Projects/GIT/CricHQ-iPhone/../CricHQ-3d/iOS-export/Classes
-I/Users/jess/Projects/GIT/CricHQ-iPhone/../CricHQ-3d/iOS-export/Libraries/bdwgc/include
-I/Users/jess/Projects/GIT/CricHQ-iPhone/../CricHQ-3d/iOS-export/Libraries/libil2cpp/include
-I/Users/jess/Projects/GIT/CricHQ-iPhone/../CricHQ-3d/iOS-export/Classes/Native
-I/Users/jess/Projects/GIT/CricHQ-iPhone/Libraries/CricEngine/source -I/Users/jess/Library/Developer/Xcode/DerivedData/CricHQ-bsrxghpplcwahnadlgmwxmzwbxff/Build/Intermediates/CricHQ.build/Debug-iphoneos/CricHQ.build/DerivedSources/armv7
-I/Users/jess/Library/Developer/Xcode/DerivedData/CricHQ-bsrxghpplcwahnadlgmwxmzwbxff/Build/Intermediates/CricHQ.build/Debug-iphoneos/CricHQ.build/DerivedSources
-F/Users/jess/Library/Developer/Xcode/DerivedData/CricHQ-bsrxghpplcwahnadlgmwxmzwbxff/Build/Products/Debug-iphoneos
-F/Users/jess/Projects/GIT/CricHQ-iPhone -mno-thumb -DINIT_SCRIPTING_BACKEND=1 -include /Users/jess/Projects/GIT/CricHQ-iPhone/Classes/Other/CricHQ_Prefix.pch
-MMD -MT dependencies -MF /Users/jess/Library/Developer/Xcode/DerivedData/CricHQ-bsrxghpplcwahnadlgmwxmzwbxff/Build/Intermediates/CricHQ.build/Debug-iphoneos/CricHQ.build/Objects-normal/armv7/main-5D1DD4E92C87F57A.d
--serialize-diagnostics /Users/jess/Library/Developer/Xcode/DerivedData/CricHQ-bsrxghpplcwahnadlgmwxmzwbxff/Build/Intermediates/CricHQ.build/Debug-iphoneos/CricHQ.build/Objects-normal/armv7/main-5D1DD4E92C87F57A.dia
-c /Users/jess/Projects/GIT/CricHQ-iPhone/Classes/Other/main.mm -o /Users/jess/Library/Developer/Xcode/DerivedData/CricHQ-bsrxghpplcwahnadlgmwxmzwbxff/Build/Intermediates/CricHQ.build/Debug-iphoneos/CricHQ.build/Objects-normal/armv7/main-5D1DD4E92C87F57A.o
In file included from :353: In file included from :4: In file included from
/Users/jess/Projects/GIT/CricHQ-iPhone/Classes/Other/CricHQ_Prefix.pch:6:
In file included from
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.3.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.h:6:
In file included from
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.3.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CoreFoundation.h:18:
In file included from
/Users/jess/Projects/GIT/CricHQ-iPhone/Libraries/../../CricHQ-3d/iOS-export/Libraries/libil2cpp/include/os/Locale.h:4:
In file included from
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/string:436:
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/cstring:70:9:
error: no member named 'memcpy' in the global namespace; did you mean
'wmemcpy'? using ::memcpy;
~~^ In file included from :353: In file included from :4: In file included from
/Users/jess/Projects/GIT/CricHQ-iPhone/Classes/Other/CricHQ_Prefix.pch:6:
In file included from
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.3.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.h:6:
In file included from
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.3.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CoreFoundation.h:18:
In file included from
/Users/jess/Projects/GIT/CricHQ-iPhone/Libraries/../../CricHQ-3d/iOS-export/Libraries/libil2cpp/include/os/Locale.h:4:
In file included from
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/string:435:
In file included from
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/iosfwd:90:
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.3.sdk/usr/include/wchar.h:152:10:
note: 'wmemcpy' declared here wchar_t *wmemcpy(wchar_t * __restrict,
const wchar_t * __restrict, size_t);
^ In file included from :353: In file included from :4: In file included from
/Users/jess/Projects/GIT/CricHQ-iPhone/Classes/Other/CricHQ_Prefix.pch:6:
In file included from
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.3.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.h:6:
In file included from
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.3.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CoreFoundation.h:18:
In file included from
/Users/jess/Projects/GIT/CricHQ-iPhone/Libraries/../../CricHQ-3d/iOS-export/Libraries/libil2cpp/include/os/Locale.h:4:
In file included from
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/string:436:
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/cstring:71:9:
error: no member named 'memmove' in the global namespace; did you mean
'wmemmove'? using ::memmove;
~~^ In file included from :353: In file included from :4: In file included from
/Users/jess/Projects/GIT/CricHQ-iPhone/Classes/Other/CricHQ_Prefix.pch:6:
In file included from
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.3.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.h:6:
In file included from
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.3.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CoreFoundation.h:18:
In file included from
/Users/jess/Projects/GIT/CricHQ-iPhone/Libraries/../../CricHQ-3d/iOS-export/Libraries/libil2cpp/include/os/Locale.h:4:
In file included from
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/string:435:
In file included from
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/iosfwd:90:
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.3.sdk/usr/include/wchar.h:153:10:
note: 'wmemmove' declared here wchar_t *wmemmove(wchar_t *, const
wchar_t *, size_t);
^ In file included from :353: In file included from :4: In file included from
/Users/jess/Projects/GIT/CricHQ-iPhone/Classes/Other/CricHQ_Prefix.pch:6:
In file included from
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.3.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.h:6:
In file included from
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.3.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CoreFoundation.h:18:
In file included from
/Users/jess/Projects/GIT/CricHQ-iPhone/Libraries/../../CricHQ-3d/iOS-export/Libraries/libil2cpp/include/os/Locale.h:4:
In file included from
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/string:436:
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/cstring:72:9:
error: no member named 'strcpy' in the global namespace using
::strcpy;
~~^ /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/cstring:73:9:
error: no member named 'strncpy' in the global namespace using
::strncpy;
~~^ /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/cstring:74:9:
error: no member named 'strcat' in the global namespace using
::strcat;
~~^ /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/cstring:75:9:
error: no member named 'strncat' in the global namespace using
::strncat;
~~^ /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/cstring:76:9:
error: no member named 'memcmp' in the global namespace; did you mean
'wmemcmp'? using ::memcmp;
~~^ In file included from :353: In file included from :4: In file included from
/Users/jess/Projects/GIT/CricHQ-iPhone/Classes/Other/CricHQ_Prefix.pch:6:
In file included from
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.3.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.h:6:
In file included from
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.3.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CoreFoundation.h:18:
In file included from
/Users/jess/Projects/GIT/CricHQ-iPhone/Libraries/../../CricHQ-3d/iOS-export/Libraries/libil2cpp/include/os/Locale.h:4:
In file included from
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/string:435:
In file included from
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/iosfwd:90:
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.3.sdk/usr/include/wchar.h:151:5:
note: 'wmemcmp' declared here int wmemcmp(const wchar_t *, const
wchar_t *, size_t);
^ In file included from :353: In file included from :4: In file included from
/Users/jess/Projects/GIT/CricHQ-iPhone/Classes/Other/CricHQ_Prefix.pch:6:
In file included from
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.3.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.h:6:
In file included from
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.3.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CoreFoundation.h:18:
In file included from
/Users/jess/Projects/GIT/CricHQ-iPhone/Libraries/../../CricHQ-3d/iOS-export/Libraries/libil2cpp/include/os/Locale.h:4:
In file included from
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/string:436:
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/cstring:77:9:
error: no member named 'strcmp' in the global namespace using
::strcmp;
~~^ /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/cstring:78:9:
error: no member named 'strncmp' in the global namespace using
::strncmp;
~~^ /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/cstring:79:9:
error: no member named 'strcoll' in the global namespace; did you mean
'strtoll'? using ::strcoll;
~~^ In file included from :353: In file included from :4: In file included from
/Users/jess/Projects/GIT/CricHQ-iPhone/Classes/Other/CricHQ_Prefix.pch:6:
In file included from
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.3.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.h:6:
In file included from
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.3.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CoreFoundation.h:13:
In file included from
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.3.sdk/usr/include/assert.h:44:
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.3.sdk/usr/include/stdlib.h:169:3:
note: 'strtoll' declared here
strtoll(const char *, char **, int);
^ In file included from :353: In file included from :4: In file included from
/Users/jess/Projects/GIT/CricHQ-iPhone/Classes/Other/CricHQ_Prefix.pch:6:
In file included from
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.3.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.h:6:
In file included from
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.3.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CoreFoundation.h:18:
In file included from
/Users/jess/Projects/GIT/CricHQ-iPhone/Libraries/../../CricHQ-3d/iOS-export/Libraries/libil2cpp/include/os/Locale.h:4:
In file included from
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/string:436:
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/cstring:80:9:
error: no member named 'strxfrm' in the global namespace using
::strxfrm;
~~^ /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/cstring:82:9:
error: no member named 'memchr' in the global namespace; did you mean
'wmemchr'? using ::memchr;
~~^ In file included from :353: In file included from :4: In file included from
/Users/jess/Projects/GIT/CricHQ-iPhone/Classes/Other/CricHQ_Prefix.pch:6:
In file included from
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.3.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.h:6:
In file included from
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.3.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CoreFoundation.h:18:
In file included from
/Users/jess/Projects/GIT/CricHQ-iPhone/Libraries/../../CricHQ-3d/iOS-export/Libraries/libil2cpp/include/os/Locale.h:4:
In file included from
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/string:435:
In file included from
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/iosfwd:90:
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.3.sdk/usr/include/wchar.h:150:10:
note: 'wmemchr' declared here wchar_t *wmemchr(const wchar_t ,
wchar_t, size_t);
^ In file included from :353: In file included from :4: In file included from
/Users/jess/Projects/GIT/CricHQ-iPhone/Classes/Other/CricHQ_Prefix.pch:6:
In file included from
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.3.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.h:6:
In file included from
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.3.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CoreFoundation.h:18:
In file included from
/Users/jess/Projects/GIT/CricHQ-iPhone/Libraries/../../CricHQ-3d/iOS-export/Libraries/libil2cpp/include/os/Locale.h:4:
In file included from
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/string:436:
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/cstring:84:9:
error: no member named 'strchr' in the global namespace using
::strchr;
~~^ /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/cstring:86:9:
error: no member named 'strcspn' in the global namespace using
::strcspn;
~~^ /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/cstring:88:9:
error: no member named 'strpbrk' in the global namespace using
::strpbrk;
~~^ /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/cstring:90:9:
error: no member named 'strrchr' in the global namespace using
::strrchr;
~~^ /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/cstring:92:9:
error: no member named 'strspn' in the global namespace using
::strspn;
~~^ /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/cstring:94:9:
error: no member named 'strstr' in the global namespace using
::strstr;
~~^ /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/cstring:98:87:
error: no member named 'strchr' in the global namespace; did you mean
simply 'strchr'? inline _LIBCPP_INLINE_VISIBILITY char strchr(
char* __s, int __c) {return ::strchr(__s, __c);}
^~
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/cstring:98:46:
note: 'strchr' declared here inline _LIBCPP_INLINE_VISIBILITY
char* strchr( char* __s, int __c) {return ::strchr(__s, __c);}
Screenshot:
Anyone know of a solution? Any help in this matter would be great as I'm totally stuck on what I should try next.
Edit: A plain project worked, so that is a start. Sounds like one of libraries is interfering maybe. The code base is large so need help narrowing the issue down.
Edit 2: Updated to Unity 5.1, xcode 7 beta, clean, deleted the DerivedData folder and still no change.
Once I added "-ferror-limit=1000" then I saw 999+ errors instead of 30.
Common errors:
"Declaration conflicts with target of using declaration already in scope".
"Call to 'X' is ambiguous" (cos, exp, ceil)
"Could not build module 'X'" (Foundation, Darwin)
"No member named 'X" in namespace" (memset, memcpy, memmove)
"Use of undeclared identifier 'x'" (strdup)
"Expected ';' after top level declarator"
Edit 3:
I solve the errors by setting "Always Search User Paths" to "No" in the XCode project settings.
But I'm having a few other issues.
Unity is still using CPU when I pause it. Is there anyway to solve this? I am calling Unity's "applicationDidBecomeActive" method. I also tried just calling "UnityPause".
Calling Unity's "GetAppController()" in my own code causes this error:
Undefined symbols for architecture armv7:
"_GetAppController", referenced from:
-[Test3d viewDidDisappear:] in Test3d.o
ld: symbol(s) not found for architecture armv7
I dont have enough reputation here to comment, so i write it as an answer:
After 3 Edits i am not sure what problems are still left...
GetAppController is an inline function in UnityAppController.h If it isnt linked to you project, you probably didnt include the file (but instead only declared GetAppController() somewhere yourself).
The other errors looks like you have conflicts with the basic c-libs. Is your other code using the c++ std lib? and if yes, which one? Which one is stated in Your BuildSettings under "C++ Standard Library"? It should be libc++
The "Solution" to switch "Always Search User Paths" to "No" sounds even more like a problem with other included projects.
Most of my answers are in the question. The core solution was setting "Always Search User Paths" to "No" in the XCode project settings.
As for the last edit, I believe they are bugs. I don't use GetAppController, instead I have my own method. I have reported the CPU issue, it isn't a major problem as it is only ~3% on phones and ipads.
I've this problem too recently trying to integrate my Unity 5 project into an existing iOS project.
How I managed to integrate is
1) Drag Class and Libraries files from your Unity project into your iOS project. Same like the tutorial from the-nerd. Uncheck copy items, and select create group radio box.
2) Update your Header Search Path and Library Search Path under Build Settings. The folders should point to your Unity project folder.
Header Search Path -> Unity's Classes folder
Library Search Path -> Unity's Library folder
This part is really important, it made me solve those errors.
3) Under Build Phases, remember to create a run script and make sure the script points to the correct path in Unity's Data folder.
rm -rf "$TARGET_BUILD_DIR/$PRODUCT_NAME.app/Data"
cp -Rf "$PROJECT_DIR/../CHANGE THIS TO YOU PATH/Data" "$TARGET_BUILD_DIR/$PRODUCT_NAME.app/Data"
4) Compare the Build Settings from the Unity's project and your current iOS project. Make sure you select the correct C++ and C compiler. Your iOS project should match the one of Unity. Also the Linker Flag have to be in the correct order.
-weak_framework
CoreMotion
-weak-lSystem
That is all I did to make my iOS project compile with the Unity project I have. I hope it helps.
Related
Error in Cannot specify link libraries for target "Opencvtest" which is not built by this project [duplicate]
I am implementing CMake in my code but I'm getting the error "Cannot specify link libraries for target "Qt5::Widgets" which is not built by the project". Below are the contents of the CMakeLists.txt: #Specify the version being used aswell as the language cmake_minimum_required(VERSION 2.6) #Name your project here project(eCAD) #Sends the -std=c++11 flag to the gcc compiler ADD_DEFINITIONS(-std=c++11) #This tells CMake to main.cpp and name it eCAD add_executable(eCAD main.cpp) #include the subdirectory containing our libs add_subdirectory (gui) include_directories(gui) #include Qt directories find_package(Qt5Widgets) find_package(Qt5Core) find_package(Qt5Designer) SET(QT_USE_QTDESIGNER ON) #link_libraries target_link_libraries(Qt5::Widgets Qt5::Core)
In addition to the accepted answer: An important detail is to place target_link_libraries after the add_executable and find_package lines, so all linked components are known.
The first argument of target_link_libraries is the target name: target_link_libraries(eCAD Qt5::Widgets Qt5::Core)
Also, do not confuse target name with the project name: a command project specifies a project name, but a target is the one created with add_executable, add_library or add_custom_target. The error message is about the target.
Set you_lib_name before setting target_link_libraries set(you_lib_name libname) target_link_libraries(you_lib_name Qt5::Widgets Qt5::Core)
xCode project not locating c++ std libraries on macOS Catalina 10.15.5
I have an xCode Swift 5 project using Metal which has two targets, the main app, and a static library target which builds a third party C library. When I compile the project, error messages (see below) indicate that xCode is searching iPhone SDK for system C headers, which it doesn't find, and doesn't find them anywhere. How can I fix this? please :) The static library target builds a third party C library, and has an Obj-c public h/m file (AGBGPUType.h, AGBGPUType.m). This library header is referenced in a bridging header file (Common.h) in a Swift/Metal project. All of the internal library header files and relevant source are included within the Swift/Metal project - this is not a workspace, it is a single project with two targets. The scheme to build the app target is setup to compile the library first, then the app, the device I'm building with is an iPhone Xs Max running iOS 13.5. I've set up the C library's public Obj-c (.h & .m) to log to the console and create a reference to a font library - which would mean it can access the third party C library code in a functional way. The library obj-c file is: #import "AGBGPUType.h" #import "ft2build.h" #include FT_FREETYPE_H #include FT_STROKER_H #implementation AGBGPUType FT_Library _fontLibrary; FT_Face _face; FT_GlyphSlot _glyph; FT_Stroker _stroker; -(void) simple { int giddy = 5000; NSLog(#"From main library objc AGBGPUType.m %d", giddy); if(FT_Init_FreeType(&_fontLibrary)) { NSLog(#"Could not init Freetype library"); } } #end and the bridging header file within the Swift/Metal application has: #ifndef Common_h #define Common_h #include <stdio.h> #include <stdlib.h> #include <stdint.h> #import <simd/simd.h> #import "AGBGPUType/AGBGPUType.h" ... #endif The following errors are generated when the application is built: CompileMetalFile /Users/username/Documents/xCode/IncuFlic/IncuFlic/Shaders.metal (in target 'IncuFlic' from project 'IncuFlic') cd /Users/username/Documents/xCode/IncuFlic export SDKROOT=/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS13.5.sdk /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/metal -c -target air64-apple-ios13.5 -gline-tables-only -MO -I/Users/username/Library/Developer/Xcode/DerivedData/IncuFlic-fxtjxtzaumyrcuhiwrtiajlsnzak/Build/Products/Debug-iphoneos/include -F/Users/username/Library/Developer/Xcode/DerivedData/IncuFlic-fxtjxtzaumyrcuhiwrtiajlsnzak/Build/Products/Debug-iphoneos -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS13.5.sdk -ffast-math -serialize-diagnostics /Users/username/Library/Developer/Xcode/DerivedData/IncuFlic-fxtjxtzaumyrcuhiwrtiajlsnzak/Build/Intermediates.noindex/IncuFlic.build/Debug-iphoneos/IncuFlic.build/Metal/Shaders.dia -o /Users/username/Library/Developer/Xcode/DerivedData/IncuFlic-fxtjxtzaumyrcuhiwrtiajlsnzak/Build/Intermediates.noindex/IncuFlic.build/Debug-iphoneos/IncuFlic.build/Metal/Shaders.air -index-store-path /Users/username/Library/Developer/Xcode/DerivedData/IncuFlic-fxtjxtzaumyrcuhiwrtiajlsnzak/Index/DataStore "" -MMD -MT dependencies -MF /Users/username/Library/Developer/Xcode/DerivedData/IncuFlic-fxtjxtzaumyrcuhiwrtiajlsnzak/Build/Intermediates.noindex/IncuFlic.build/Debug-iphoneos/IncuFlic.build/Metal/Shaders.dat /Users/username/Documents/xCode/IncuFlic/IncuFlic/Shaders.metal In file included from /Users/username/Documents/xCode/IncuFlic/IncuFlic/Shaders.metal:35: In file included from /Users/username/Documents/xCode/IncuFlic/IncuFlic/Common.h:33: In file included from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS13.5.sdk/usr/include/stdio.h:64: In file included from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS13.5.sdk/usr/include/_stdio.h:68: /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS13.5.sdk/usr/include/sys/cdefs.h:807:2: error: Unsupported architecture ##error Unsupported architecture## ^ In file included from /Users/username/Documents/xCode/IncuFlic/IncuFlic/Shaders.metal:35: In file included from /Users/username/Documents/xCode/IncuFlic/IncuFlic/Common.h:33: In file included from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS13.5.sdk/usr/include/stdio.h:64: In file included from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS13.5.sdk/usr/include/_stdio.h:71: In file included from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS13.5.sdk/usr/include/_types.h:27: In file included from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS13.5.sdk/usr/include/sys/_types.h:33: /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS13.5.sdk/usr/include/machine/_types.h:34:2: error: architecture not supported ##error architecture not supported## ^ In file included from /Users/username/Documents/xCode/IncuFlic/IncuFlic/Shaders.metal:35: In file included from /Users/username/Documents/xCode/IncuFlic/IncuFlic/Common.h:33: In file included from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS13.5.sdk/usr/include/stdio.h:64: In file included from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS13.5.sdk/usr/include/_stdio.h:71: In file included from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS13.5.sdk/usr/include/_types.h:27: /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS13.5.sdk/usr/include/sys/_types.h:55:9: error: unknown type name '__int64_t' typedef __int64_t __darwin_blkcnt_t; /* total blocks */ ^ /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS13.5.sdk/usr/include/sys/_types.h:56:9: error: unknown type name '__int32_t' typedef __int32_t __darwin_blksize_t; /* preferred block size */ ^ /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS13.5.sdk/usr/include/sys/_types.h:57:9: error: unknown type name '__int32_t' typedef __int32_t __darwin_dev_t; /* dev_t */ ^ /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS13.5.sdk/usr/include/sys/_types.h:60:9: error: unknown type name '__uint32_t' typedef __uint32_t __darwin_gid_t; /* [???] process and group IDs */ ^ /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS13.5.sdk/usr/include/sys/_types.h:61:9: error: unknown type name '__uint32_t' typedef __uint32_t __darwin_id_t; /* [XSI] pid_t, uid_t, or gid_t*/ ^ /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS13.5.sdk/usr/include/sys/_types.h:62:9: error: unknown type name '__uint64_t'; did you mean 'uint64_t'? typedef __uint64_t __darwin_ino64_t; /* [???] Used for 64 bit inodes */ ^ /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/metal/ios/lib/clang/3902.67/include/metal/metal_types:48:25: note: 'uint64_t' declared here typedef __UINT64_TYPE__ uint64_t; ^ In file included from /Users/username/Documents/xCode/IncuFlic/IncuFlic/Shaders.metal:35: In file included from /Users/username/Documents/xCode/IncuFlic/IncuFlic/Common.h:33: In file included from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS13.5.sdk/usr/include/stdio.h:64: In file included from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS13.5.sdk/usr/include/_stdio.h:71: In file included from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS13.5.sdk/usr/include/_types.h:27: /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS13.5.sdk/usr/include/sys/_types.h:68:9: error: unknown type name '__darwin_natural_t' typedef __darwin_natural_t __darwin_mach_port_name_t; /* Used by mach */ ^ /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS13.5.sdk/usr/include/sys/_types.h:70:9: error: unknown type name '__uint16_t' typedef __uint16_t __darwin_mode_t; /* [???] Some file attributes */ ^ /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS13.5.sdk/usr/include/sys/_types.h:71:9: error: unknown type name '__int64_t' typedef __int64_t __darwin_off_t; /* [???] Used for file sizes */ ^ /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS13.5.sdk/usr/include/sys/_types.h:72:9: error: unknown type name '__int32_t' typedef __int32_t __darwin_pid_t; /* [???] process and group IDs */ ^ /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS13.5.sdk/usr/include/sys/_types.h:73:9: error: unknown type name '__uint32_t' typedef __uint32_t __darwin_sigset_t; /* [???] signal set */ ^ /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS13.5.sdk/usr/include/sys/_types.h:74:9: error: unknown type name '__int32_t' typedef __int32_t __darwin_suseconds_t; /* [???] microseconds */ ^ /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS13.5.sdk/usr/include/sys/_types.h:75:9: error: unknown type name '__uint32_t' typedef __uint32_t __darwin_uid_t; /* [???] user IDs */ ^ /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS13.5.sdk/usr/include/sys/_types.h:76:9: error: unknown type name '__uint32_t' typedef __uint32_t __darwin_useconds_t; /* [???] microseconds */ ^ In file included from /Users/username/Documents/xCode/IncuFlic/IncuFlic/Shaders.metal:35: In file included from /Users/username/Documents/xCode/IncuFlic/IncuFlic/Common.h:33: In file included from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS13.5.sdk/usr/include/stdio.h:64: In file included from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS13.5.sdk/usr/include/_stdio.h:71: In file included from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS13.5.sdk/usr/include/_types.h:27: In file included from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS13.5.sdk/usr/include/sys/_types.h:80: /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS13.5.sdk/usr/include/sys/_pthread/_pthread_types.h:58:25: error: pointer type must have explicit address space qualifier void (*__routine)(void *); // Routine to call ^ /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS13.5.sdk/usr/include/sys/_pthread/_pthread_types.h:59:7: error: pointer type must have explicit address space qualifier void *__arg; // Argument to pass ^ /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS13.5.sdk/usr/include/sys/_pthread/_pthread_types.h:60:38: error: pointer type must have explicit address space qualifier struct __darwin_pthread_handler_rec *__next; Additional Environment Details My path sudo nano /etc/paths /usr/local/bin /usr/bin /bin /usr/sbin /sbin The currently active developer dir xcode-select -p /Applications/Xcode.app/Contents/Developer The GCC compiler gcc -v Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr --with-gxx-include-dir=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/4.2.1 Apple clang version 11.0.3 (clang-1103.0.32.62) Target: x86_64-apple-darwin19.5.0 Thread model: posix InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin The C preprocessor cpp -v Apple clang version 11.0.3 (clang-1103.0.32.62) Target: x86_64-apple-darwin19.5.0 Thread model: posix InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang" -cc1 -triple x86_64-apple-macosx10.15.0 -Wdeprecated-objc-isa-usage -Werror=deprecated-objc-isa-usage -E -disable-free -disable-llvm-verifier -discard-value-names -main-file-name - -mrelocation-model pic -pic-level 2 -mthread-model posix -mframe-pointer=all -fno-strict-return -masm-verbose -munwind-tables -target-sdk-version=10.15.4 -target-cpu penryn -dwarf-column-info -debugger-tuning=lldb -target-linker-version 556.6 -v -resource-dir /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/11.0.3 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk -I /usr/include -I/usr/local/include -internal-isystem /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/local/include -internal-isystem /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/11.0.3/include -internal-externc-isystem /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include -internal-externc-isystem /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include -Wno-objc-signed-char-bool-implicit-int-conversion -Wno-extra-semi-stmt -Wno-quoted-include-in-framework-header -fdebug-compilation-dir /Users/annstramer -ferror-limit 19 -fmessage-length 80 -stack-protector 1 -fstack-check -mdarwin-stkchk-strong-link -fblocks -fencode-extended-block-signature -fregister-global-dtors-with-atexit -fobjc-runtime=macosx-10.15.0 -fmax-type-align=16 -fdiagnostics-show-option -fcolor-diagnostics -traditional-cpp -o - -x c - clang -cc1 version 11.0.3 (clang-1103.0.32.62) default target x86_64-apple-darwin19.5.0 ignoring nonexistent directory "/usr/include" ignoring nonexistent directory "/usr/local/include" ignoring nonexistent directory "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/local/include" ignoring nonexistent directory "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/Library/Frameworks" include "..." search starts here: include <...> search starts here: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/11.0.3/include /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks (framework directory) End of search list. From reading several articles, including Broken c++ std libraries on macOS High Sierra 10.13 and How can I find all Clang versions installed on my Mac?, possibly xCode is not finding headers of C installation. The error messages indicate that xCode is looking for files in the iPhone13.5 sdk, but terminal commands seem to confirm a version of C isn't included with that sdk. There exists a C installation in the xCode developer directory. When the library is included as a prebuilt archive in an Obj-c project or a Swift project, the project compiles without errors, C headers are found, logs the message to the console and create the reference to the font library. Golden - but doesn't work at all from bridging header in Swift/Metal project. There are several structs in that bridging header which work perfectly in other areas of Swift/Metal code. A (brute force) clean installation of xCode didn't solve the problem, nor did installing the command line tools, both of these after installing the recent Catalina upgrade over a relatively recent clean install of Catalina, and then just today installing a command line tools upgrade. My questions: Am I correct that xCode is not locating a C installation? cpp -v finds xCode's C installation, why doesn't xCode during compile? Please, what is the correct professional way to solve this problem? Thanks in advance for your insights.
Here is an excellent explanation as an overview for this issue, from Cecelia Humlelu. https://www.youtube.com/watch?v=NvURClY2Xzk I found this explanation of how to integrate the C library exceedingly direct also, and contemporary to xCode 11: https://www.youtube.com/watch?v=WQI02KR9kQw I was convoluting the integration of the C library into the Swift project by building the C library within an ObjC library target, and then using ObjC to access the library. Since Swift can directly consume C, I deleted the Obj-C library target, built the C library from the command line, and dropped the archive and headers into the project (see 2nd video link). The first 6 minutes of Cecelia's video are key to understanding why these changes worked, and the C/Swift segment that starts at 6:45 clearly outlines what I followed. To the letter. In this project, the bridging header is imported in the metal shader. I was importing the C library within the bridging header, using an Obj-C header file. Deleting this Obj-C header, and writing C functions appeared to work at first. However, when it came down to using the core functionality of the library, there was another problem. This library involves processing strings, and to pass a string from a Swift function call into a C function call, pointer parameters had to be added to the C function calls that use the library code. Address space qualifiers are required for running code on the GPU. Since the C functions were being imported in a bridging header through Metal, the compiler requires the code to designate address space identifiers. The problem is that C does not have a construct for designating the address space of the pointer parameters, so importing these function declarations in the bridging header was not possible. Please note: there are some C declarations that would not require address space qualifiers, the discussion is out of scope for this question. There is only one bridging header allowed per target in an xCode project, but there is another way to import header files. I created a modulemap for the library header file, and added it to the Import Paths setting of Swift Compiler Search Paths in the project build settings. Because this library uses complex macros to expose functionality, a C or Obj-C wrapper is still needed to use the library from Swift, but the library is fully integrated and accessible from CPU code. In the working solution, Swift recognizes the header files in the modulemap as globally defined, so they can be called from any Swift file in the project, the library header files are no longer referenced in the target's bridging header. I followed the video to the letter in it's guidance about creating a modulemap for the C library. Here's the Obj-C source file declaration: #import <LibraryWrapperCode.h> #import <MetalKit/MetalKit.h> #include "ft2build.h" #include FT_FREETYPE_H #implementation LibraryWrapperCode { FT_Library _fontLibrary; FT_Face _face; FT_GlyphSlot _glyph; } The modulemap: module GPUTextCWrapper { header "../GPUText/libraryWrapperCode.h" export * } The C library is imported from any Swift file: import GPUTextCWrapper It is still somewhat unclear to me what I was doing that generated the error messages documented in this question, but I think I was importing the library in such a way that the compiler found it twice, and the second time, tried to recompile the library. I will update this answer again if I find a more direct explanation.
Unable to compile/link program after inclusion of opencv.hpp
I am trying to compile a program which uses opencv. I have included the opencv.hpp file in the .h and the .c file which needs the opencv functions. The project also has the properties set to use opencv. I am using 2.4.5 version of opencv. The problems I am facing is that after including these files in the project the project fails to compile. I get an error saying I have failed to #inlcude "stdafx.h". This is because I am using precompiled headers and #include"stdafx.h" has to be the first line of code in that .c or .cpp file. If I add the inclusion of stdafx.h tehn the program compiles but it does not link. shown below is how i have included the files in the .c file. ** include "../stdafx.h" include "C:\opencv\include\opencv2\opencv.hpp" include "DPD_AlgorithmInit.h" ** and shown below is the inclusion in the .h file include "C:\opencv\build\include\opencv2\core\types_c.h" the error I am receiving is error C1083: Cannot open source file: '..\MOSS\PedestrianDetection\DPD_Tracker.c': No such file or directory C:\Users\sankalp\Desktop\check\MOSS_Evaluation\c1 error LNK2001: unresolved external symbol _InitializeTracker C:\Users\sankalp\Desktop\check\MOSS\DPD_AlgorithmInit.obj error LNK2001: unresolved external symbol _DPD_Tracker C:\Users\sankalp\Desktop\check\MOSS\DPD_AlgorithmInit.obj error LNK2001: unresolved external symbol "unsigned char * __cdecl DPD_Alloc(unsigned int)" (?DPD_Alloc##YAPAEI#Z) C:\Users\sankalp\Desktop\check\MOSS\DPD_Tracker1.obj error LNK1120: 3 unresolved externals C:\Users\sankalp\Desktop\check\Release\MOSS.exe Am I doing something wrong while including the .hpp file? Is there a better way to include opencv to allow compilation and linking? I have tried toggling the precompiled header usage settings in the project too but It did not help.
Include AVFoundation Framework in Theos application
I am writing an application for my iPhone 5 using Theos tools and I want to use AVFoundation framework. I've included AVFoundation in FRAMEWORKS section of my Makefile: include theos/makefiles/common.mk APPLICATION_NAME = appName appName_FILES = main.m appNameApplication.mm RootViewController.mm StandardPlaybackVC.mm appName_FRAMEWORKS = UIKit CoreGraphics AVFoundation include $(THEOS_MAKE_PATH)/application.mk But it doesn't seem to work and give the following error: error: unknown type name 'AVAudioPlayer' I've also tried to include this line in my header file: #import <AVFoundation/AVFoundation.h> But this gives a lot of confusing errors: In file included from RootViewController.mm:3: In file included from ./StandardPlaybackVC.h:1: In file included from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/System/Library/Frameworks/AVFoundation.framework/Headers/AVFoundation.h:12: In file included from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/System/Library/Frameworks/AVFoundation.framework/Headers/AVBase.h:11: In file included from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSObjCRuntime.h:9: In file included from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/objc/NSObjCRuntime.h:9: In file included from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/objc/objc.h:31: In file included from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/sys/types.h:75: /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/sys/cdefs.h:680:2: error: Unsupported architecture #error Unsupported architecture ^ In file included from RootViewController.mm:3: In file included from ./StandardPlaybackVC.h:1: In file included from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/System/Library/Frameworks/AVFoundation.framework/Headers/AVFoundation.h:12: In file included from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/System/Library/Frameworks/AVFoundation.framework/Headers/AVBase.h:11: In file included from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSObjCRuntime.h:9: In file included from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/objc/NSObjCRuntime.h:9: In file included from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/objc/objc.h:31: In file included from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/sys/types.h:78: /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/machine/types.h:37:2: error: architecture not supported #error architecture not supported ^ In file included from RootViewController.mm:3: In file included from ./StandardPlaybackVC.h:1: In file included from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/System/Library/Frameworks/AVFoundation.framework/Headers/AVFoundation.h:12: In file included from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/System/Library/Frameworks/AVFoundation.framework/Headers/AVBase.h:11: In file included from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSObjCRuntime.h:9: In file included from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/objc/NSObjCRuntime.h:9: In file included from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/objc/objc.h:31: In file included from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/sys/types.h:79: In file included from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/sys/_types.h:33: /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/machine/_types.h:34:2: error: architecture not supported #error architecture not supported ^ In file included from RootViewController.mm:3: In file included from ./StandardPlaybackVC.h:1: In file included from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/System/Library/Frameworks/AVFoundation.framework/Headers/AVFoundation.h:12: In file included from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/System/Library/Frameworks/AVFoundation.framework/Headers/AVBase.h:11: In file included from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSObjCRuntime.h:9: In file included from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/objc/NSObjCRuntime.h:9: In file included from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/objc/objc.h:31: In file included from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/sys/types.h:81: /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/machine/endian.h:37:2: error: architecture not supported #error architecture not supported ^ In file included from RootViewController.mm:3: In file included from ./StandardPlaybackVC.h:1: In file included from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/System/Library/Frameworks/AVFoundation.framework/Headers/AVFoundation.h:12: In file included from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/System/Library/Frameworks/AVFoundation.framework/Headers/AVBase.h:11: In file included from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSObjCRuntime.h:12: In file included from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/clang/6.0/include/limits.h:38: In file included from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/limits.h:64: /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/machine/limits.h:8:2: error: architecture not supported #error architecture not supported ^ In file included from RootViewController.mm:3: In file included from ./StandardPlaybackVC.h:1: In file included from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/System/Library/Frameworks/AVFoundation.framework/Headers/AVFoundation.h:14: In file included from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/System/Library/Frameworks/AVFoundation.framework/Headers/AVAudioBuffer.h:8: In file included from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/System/Library/Frameworks/AVFoundation.framework/Headers/AVAudioTypes.h:11: In file included from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.h:6: In file included from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CoreFoundation.h:21: In file included from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/signal.h:63: In file included from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/sys/signal.h:81: /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/machine/signal.h:34:2: error: architecture not supported #error architecture not supported ^ In file included from RootViewController.mm:3: In file included from ./StandardPlaybackVC.h:1: In file included from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/System/Library/Frameworks/AVFoundation.framework/Headers/AVFoundation.h:14: In file included from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/System/Library/Frameworks/AVFoundation.framework/Headers/AVAudioBuffer.h:8: In file included from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/System/Library/Frameworks/AVFoundation.framework/Headers/AVAudioTypes.h:11: In file included from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.h:6: In file included from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CoreFoundation.h:21: In file included from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/signal.h:63: In file included from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/sys/signal.h:145: /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/machine/_mcontext.h:31:2: error: architecture not supported #error architecture not supported ^ In file included from RootViewController.mm:3: In file included from ./StandardPlaybackVC.h:1: In file included from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/System/Library/Frameworks/AVFoundation.framework/Headers/AVFoundation.h:14: In file included from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/System/Library/Frameworks/AVFoundation.framework/Headers/AVAudioBuffer.h:8: In file included from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/System/Library/Frameworks/AVFoundation.framework/Headers/AVAudioTypes.h:11: In file included from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.h:6: In file included from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CoreFoundation.h:43: In file included from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFByteOrder.h:10: /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/libkern/OSByteOrder.h:45:10: fatal error: 'libkern/machine/OSByteOrder.h' file not found #include <libkern/machine/OSByteOrder.h> ^ 8 errors generated. I do not use #import pragmas for UIKit and Core Graphics so I thought that modifying the Makefile should be enough... What am I doing wrong here? And what is the right way of including frameworks in Theos? I'm using iPhone SDK 8.1. Thank you!
I had same error on my tweaks,but solved this error. Cause is the StandardPlaybackVC file. UIKit CoreGraphics AVFoundation, Don't write all "#import Framework" in StandardPlaybackVC.
Errors building ios project with CMake
I'm trying to build an ios app using CMake, and I am running into a few warnings and errors. First, I'm getting this when I call cmake: CMake Error in CMakeLists.txt: Syntax error in cmake code when parsing string <string>arxan.${PRODUCT_NAME:rfc1034identifier}</string> syntax error, unexpected cal_SYMBOL, expecting } (48) It still seems to build everything though, and I can run make. However, I get the following warning: clang: warning: no such sysroot directory: 'iphoneos' and error: In file included from /Users/aottinger/TestFrameWorkiOS/AppDelegate.m:9: /Users/aottinger/TestFrameWorkiOS/AppDelegate.h:9:9: fatal error: 'UIKit/UIKit.h' file not found #import <UIKit/UIKit.h> Here is my CMakeLists.txt: cmake_minimum_required(VERSION 2.8) project(auto_generated_xcodeproj) set(NAME auto_generated_xcodeproj) file(GLOB headers *.h) file(GLOB sources *.c *.cpp *.cc *.m) set(CMAKE_OSX_SYSROOT iphoneos7.1) set(CMAKE_OSX_ARCHITECTURES "arm64") set(CMAKE_XCODE_EFFECTIVE_PLATFORMS "-iphoneos") add_executable(${NAME} MACOSX_BUNDLE ${APP_TYPE} ${headers} ${sources}) target_link_libraries(${NAME} "-framework Foundation" "-framework CoreGraphics" "-framework UIKit" "-framework XCTest") set_target_properties(${NAME} PROPERTIES MACOSX_BUNDLE_GUI_IDENTIFIER "com.arxan.auto_generated_xcodeproj" MACOSX_BUNDLE_INFO_PLIST ${CMAKE_CURRENT_SOURCE_DIR}/Info.plist XCODE_ATTRIBUTE_DEBUG_INFORMATION_FORMAT "dwarf-with-dysm" XCODE_ATTRIBUTE_GCC_PRECOMPILE_PREFIX_HEADER YES XCODE_ATTRIBUTE_GCC_PREFIX_HEADER ${CMAKE_CURRENT_LIST_DIR}/Prefix.pch XCODE_ATTRIBUTE_INFOPLIST_PREPROCESS YES XCODE_ATTRIBUTE_IPHONEOS_DEPLOYMENT_TARGET 7.1) I don't understand why it can't find the header file as I linked the frameworks, and I'm at a loss for the other CMake error and clang warning.