I am new to building command line on Mac. While working on a cross-platform app using OpenGL, IMGui, and GLFW, I keep getting linking errors:
Undefined symbols for architecture x86_64:
"__glfwCreateContextEGL", referenced from:
__glfwPlatformCreateWindow in libGLFW.a(cocoa_window.o)
"__glfwCreateContextNSGL", referenced from:
__glfwPlatformCreateWindow in libGLFW.a(cocoa_window.o)
"__glfwCreateContextOSMesa", referenced from:
__glfwPlatformCreateWindow in libGLFW.a(cocoa_window.o)
"__glfwInitEGL", referenced from:
__glfwPlatformCreateWindow in libGLFW.a(cocoa_window.o)
"__glfwInitNSGL", referenced from:
__glfwPlatformCreateWindow in libGLFW.a(cocoa_window.o)
"__glfwInitOSMesa", referenced from:
__glfwPlatformCreateWindow in libGLFW.a(cocoa_window.o)
"__glfwPlatformCreateMutex", referenced from:
_glfwInit in libGLFW.a(init.o)
"__glfwPlatformCreateTls", referenced from:
_glfwInit in libGLFW.a(init.o)
"__glfwPlatformDestroyMutex", referenced from:
_terminate in libGLFW.a(init.o)
"__glfwPlatformDestroyTls", referenced from:
_terminate in libGLFW.a(init.o)
"__glfwPlatformGetTls", referenced from:
_glfwDestroyWindow in libGLFW.a(window.o)
__glfwRefreshContextAttribs in libGLFW.a(context.o)
_glfwMakeContextCurrent in libGLFW.a(context.o)
_glfwExtensionSupported in libGLFW.a(context.o)
_glfwGetCurrentContext in libGLFW.a(context.o)
_glfwSwapInterval in libGLFW.a(context.o)
_glfwGetProcAddress in libGLFW.a(context.o)
...
"__glfwPlatformLockMutex", referenced from:
__glfwInputError in libGLFW.a(init.o)
"__glfwPlatformSetTls", referenced from:
__glfwInputError in libGLFW.a(init.o)
_glfwInit in libGLFW.a(init.o)
"__glfwPlatformUnlockMutex", referenced from:
__glfwInputError in libGLFW.a(init.o)
"__glfwTerminateNSGL", referenced from:
__glfwPlatformTerminate in libGLFW.a(cocoa_init.o)
"__glfwUpdateDisplayLinkDisplayNSGL", referenced from:
-[GLFWWindowDelegate windowDidChangeScreen:] in libGLFW.a(cocoa_window.o)
I am linking to the Cocoa, CoreVideo, and IOKit frameworks. Any idea what I'm missing?
Hello might have found your error while doing something similar you forgot to link it to a few libs that are required...
"g++ -o test main.c libGLEW.a libglfw3.a -framework opengl -framework Cocoa -framework IOKit"
source: https://web.eecs.umich.edu/~sugih/courses/eecs487/glfw-howto/
I had a similar issue to you when trying to build GLFW on my own. It seems as though when building GLFW you're not including all files needed.
The following macOS-specific files are needed in the current version of GLFW when building:
src/cocoa_init.m
src/cocoa_joystick.m
src/cocoa_monitor.m
src/cocoa_window.m
src/cocoa_time.c
src/posix_thread.c
src/nsgl_context.m
src/egl_context.c
src/osmesa_context.c
src/posix_module.c
For you specifically, make sure egl_context.c,
nsgl_context.m, and
posix_thread.c are included.
Related
I tried to run the project in the emulator, I encountered some problems and solved it, I finally got the following error, I tried many ways, but I can't solve it. How can I fix this, please give me some ideas, I'm new to ios development.
cpu: m1 pro
system: macOS12.3
xcode: 13.4
react native: 0.62.2
The following is the error message:
Showing Recent Errors Only
Build target tolernPowerBankApp of project demo with configuration Debug
Undefined symbols for architecture x86_64:
"_OBJC_CLASS_$_OIDURLQueryComponent", referenced from:
objc-class-ref in GoogleSignIn(GIDSignIn_f05654be6d1b2af59ab6df426a0c4eb9.o)
"_OBJC_CLASS_$_GTMSessionFetcher", referenced from:
objc-class-ref in GoogleSignIn(GIDSignIn_f05654be6d1b2af59ab6df426a0c4eb9.o)
"_OBJC_CLASS_$_OIDAuthorizationRequest", referenced from:
objc-class-ref in GoogleSignIn(GIDSignIn_f05654be6d1b2af59ab6df426a0c4eb9.o)
"_OIDResponseTypeCode", referenced from:
-[GIDSignIn authenticateInteractivelyWithOptions:] in GoogleSignIn(GIDSignIn_f05654be6d1b2af59ab6df426a0c4eb9.o)
"_OBJC_CLASS_$_OIDAuthState", referenced from:
objc-class-ref in GoogleSignIn(GIDAuthentication_7b83cc27af8929ec7e4c9760d73a0f31.o)
objc-class-ref in GoogleSignIn(GIDSignIn_f05654be6d1b2af59ab6df426a0c4eb9.o)
"_OBJC_CLASS_$_OIDAuthorizationService", referenced from:
objc-class-ref in GoogleSignIn(GIDAuthentication_7b83cc27af8929ec7e4c9760d73a0f31.o)
objc-class-ref in GoogleSignIn(GIDSignIn_f05654be6d1b2af59ab6df426a0c4eb9.o)
"_OIDOAuthErrorResponseErrorKey", referenced from:
+[GIDAuthentication handleTokenFetchEMMError:completion:] in GoogleSignIn(GIDAuthentication_7b83cc27af8929ec7e4c9760d73a0f31.o)
"_OBJC_CLASS_$_SKDescriptorMapper", referenced from:
objc-class-ref in AppDelegate.o
"_OBJC_CLASS_$_GTMAppAuthFetcherAuthorization", referenced from:
_OBJC_CLASS_$_GTMAppAuthFetcherAuthorizationWithEMMSupport in GoogleSignIn(GIDAuthentication_7b83cc27af8929ec7e4c9760d73a0f31.o)
objc-class-ref in GoogleSignIn(GIDAuthentication_7b83cc27af8929ec7e4c9760d73a0f31.o)
objc-class-ref in GoogleSignIn(GIDSignIn_f05654be6d1b2af59ab6df426a0c4eb9.o)
objc-class-ref in GoogleSignIn(GIDAuthStateMigration_bdf842e92d17b12b5f020e0e721bd017.o)
(maybe you meant: _OBJC_CLASS_$_GTMAppAuthFetcherAuthorizationWithEMMSupport, _OBJC_CLASS_$_GTMAppAuthFetcherAuthorizationEMMChainedDelegate )
"_OBJC_METACLASS_$_GTMAppAuthFetcherAuthorization", referenced from:
_OBJC_METACLASS_$_GTMAppAuthFetcherAuthorizationWithEMMSupport in GoogleSignIn(GIDAuthentication_7b83cc27af8929ec7e4c9760d73a0f31.o)
(maybe you meant: _OBJC_METACLASS_$_GTMAppAuthFetcherAuthorizationWithEMMSupport, _OBJC_METACLASS_$_GTMAppAuthFetcherAuthorizationEMMChainedDelegate )
"_OBJC_CLASS_$_OIDIDToken", referenced from:
objc-class-ref in GoogleSignIn(GIDGoogleUser_2bdd4a676c033bc6ca21970e75d9159c.o)
objc-class-ref in GoogleSignIn(GIDAuthentication_7b83cc27af8929ec7e4c9760d73a0f31.o)
objc-class-ref in GoogleSignIn(GIDSignIn_f05654be6d1b2af59ab6df426a0c4eb9.o)
"_OBJC_CLASS_$_OIDServiceConfiguration", referenced from:
objc-class-ref in GoogleSignIn(GIDSignIn_f05654be6d1b2af59ab6df426a0c4eb9.o)
"_OBJC_CLASS_$_FIRApp", referenced from:
objc-class-ref in AppDelegate.o
"_RCTRegisterModule", referenced from:
+[SignWithApple load] in SignWithApple.o
"_OBJC_CLASS_$_RNCPushNotificationIOS", referenced from:
objc-class-ref in AppDelegate.o
"_OBJC_CLASS_$_RCTConvert", referenced from:
__OBJC_$_CATEGORY_RCTConvert_$_GIDSignInButtonStyle in AppDelegate.o
__OBJC_$_CATEGORY_RCTConvert_$_GIDSignInButtonColorScheme in AppDelegate.o
"_OIDOAuthTokenErrorDomain", referenced from:
___46-[GIDAuthentication refreshTokensWithHandler:]_block_invoke in GoogleSignIn(GIDAuthentication_7b83cc27af8929ec7e4c9760d73a0f31.o)
"_OBJC_CLASS_$_FlipperKitNetworkPlugin", referenced from:
objc-class-ref in AppDelegate.o
"_OBJC_CLASS_$_FlipperKitReactPlugin", referenced from:
objc-class-ref in AppDelegate.o
"_OBJC_CLASS_$_RCTViewManager", referenced from:
_OBJC_CLASS_$_SignWithApple in SignWithApple.o
"_OBJC_CLASS_$_FlipperClient", referenced from:
objc-class-ref in AppDelegate.o
"_OBJC_CLASS_$_GTMOAuth2KeychainCompatibility", referenced from:
objc-class-ref in GoogleSignIn(GIDAuthStateMigration_bdf842e92d17b12b5f020e0e721bd017.o)
"_OBJC_CLASS_$_RCTLinkingManager", referenced from:
objc-class-ref in AppDelegate.o
"_OBJC_CLASS_$_FKUserDefaultsPlugin", referenced from:
objc-class-ref in AppDelegate.o
"_OBJC_CLASS_$_GTMKeychain", referenced from:
objc-class-ref in GoogleSignIn(GIDAuthStateMigration_bdf842e92d17b12b5f020e0e721bd017.o)
"_OBJC_CLASS_$_RCTBridge", referenced from:
objc-class-ref in AppDelegate.o
"_OBJC_CLASS_$_RCTRootView", referenced from:
objc-class-ref in AppDelegate.o
"_OBJC_METACLASS_$_RCTViewManager", referenced from:
_OBJC_METACLASS_$_SignWithApple in SignWithApple.o
"_OBJC_CLASS_$_FlipperKitLayoutPlugin", referenced from:
objc-class-ref in AppDelegate.o
"_OBJC_CLASS_$_SKIOSNetworkAdapter", referenced from:
objc-class-ref in AppDelegate.o
"_OBJC_CLASS_$_RCTBundleURLProvider", referenced from:
objc-class-ref in AppDelegate.o
"_RCTConvertEnumValue", referenced from:
+[RCTConvert(GIDSignInButtonStyle) GIDSignInButtonStyle:] in AppDelegate.o
+[RCTConvert(GIDSignInButtonColorScheme) GIDSignInButtonColorScheme:] in AppDelegate.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
Build failed 2022/5/23, 14:06 140.1 seconds
Doing this helped me solve this problem:
Modify the Build Settings -> Excluded Architectures option, add the Any iOS Simulator SDK option, and set the value to arm64.As shown in the figure:
and add the following code in Podfile:
post_install do |installer|
installer.pods_project.targets.each do |target|
target.build_configurations.each do |config|
config.build_settings['EXCLUDED_ARCHS[sdk=iphonesimulator*]'] = "arm64"
end
end
end
This problem I'm having seems to be caused by M1. https://juejin.cn/post/7037037120158269448
You can view these links maybe they can help:
https://github.com/facebook/react-native/issues/27166
xCode Cocoapods build fails "Undefined symbols for architecture x86_64"
Although what helped me was removing these values from the library search paths on react-native 0.64.2
Xcode -> Build Settings -> Search Paths -> Library Search Paths
"$(TOOLCHAIN_DIR)/usr/lib/swift-5.0/$(PLATFORM_NAME)"
"$(TOOLCHAIN_DIR)/usr/lib/swift/$(PLATFORM_NAME)"
Also cleaning the project and xcode derived data can help also
rm -rf ~/Library/Developer/Xcode/DerivedData (clean derived data)
CMD + K (Clean Project from xcode)
I just had to do :
rm -rf ~/Library/Developer/Xcode/DerivedData/*
and pod install (because a try pod deintegrate before)
and restart metro bundler.
I hope this will help you
I had this problem when I was initializing react-native project.
I'm using M1 Ventura 13.1.
https://github.com/facebook/react-native/issues/35053#issuecomment-1324612311
https://fek.io/blog/how-to-set-up-react-native-on-m-1-mac-2022-edition
Following these worked perfectly on initiating a react-native project!
These include specific insturctions on ruby installation(using rbenv) and using lts node, etc.
To include the details,
watchman, cocoapods are installed with homebrew.
ruby is installed with rbenv and after that, the version is stored in ~/.ruby-version
I am developing an iOS application in which i am using MailCore framework. When i am trying to install app from device from Xcode it works fine. Now when i am trying to create an archive to distribute the application i am getting error as below.
Undefined symbols for architecture armv7: "_EVP_DigestUpdate",
referenced from:
_otp_hash in libmailcore.a(otp.o)
_word2bin in libmailcore.a(otp.o) "_EVP_DigestFinal", referenced from:
_otp_hash in libmailcore.a(otp.o)
_word2bin in libmailcore.a(otp.o) "_EVP_get_digestbyname", referenced from:
_generate_otp in libmailcore.a(otp.o)
_otp_server_mech_step in libmailcore.a(otp.o) "_DES_ede3_cbc_encrypt", referenced from:
_enc_3des in libmailcore.a(digestmd5.o)
_dec_3des in libmailcore.a(digestmd5.o) "_EVP_cleanup", referenced from:
_otp_common_mech_free in libmailcore.a(otp.o) "_EVP_DigestInit", referenced from:
_otp_hash in libmailcore.a(otp.o)
_word2bin in libmailcore.a(otp.o) "_OpenSSL_add_all_digests", referenced from:
_otp_server_plug_init in libmailcore.a(otp.o)
_otp_client_plug_init in libmailcore.a(otp.o) "_DES_key_sched", referenced from:
_init_des in libmailcore.a(digestmd5.o)
_init_3des in libmailcore.a(digestmd5.o) "_DES_cbc_encrypt", referenced from:
_enc_des in libmailcore.a(digestmd5.o)
_dec_des in libmailcore.a(digestmd5.o) ld: symbol(s) not found for architecture armv7 clang: error: linker command failed with exit
code 1 (use -v to see invocation)
I have already tried to set $(ARCHS_STANDARD_32_BIT) as my Architectures for main as well sub projects. I have also set Build Active Architecture Only to NO.
I am trying to build an augmented reality app built in Unity3d using the Metaio Unity SDK. The app uses a CAD model as a target upon which it augments stuff. It looks for something like the reference CAD model in the real world and then latches onto that. In XCode, I add, from Libraries, the metaiosdk file (not metaiosdk.framework) to the Link Binaries to Libraries section. I also add the libxml2.dylib framework. When I build, I fail with tons of errors. The errors all claim that "directory not found for option '-L/..." for Metaio framework. When I search "search paths" in Build Settings and delete them all (per this SO answer), I go down to only one error, saying that there is no Metaio Framework. When I add the whole SDK folder to the project and redo the previous steps, including having to delete search paths for libraries and headers again, I then get an error saying that -liPhone-lib library was not found. I reimport that library, following the instructions from this Metaio Helpdesk post, at which point I then re-delete the search paths for libraries and headers (or else I get about 30 errors again). Then when I build I get only one error, saying that "'Unity/GlesHelper.h' was not found." I am at a loss, as Google turns up no results for "GlesHelper.h" (in this context). What am I doing wrong? Does the SDK need to be inside the Unity project and the Unity Project inside the folder of the XCode project? Is it the opposite way around? Do I need to import the example scenes and not just the scene I am using? Thank you for the help!
EDIT: Here is an example of the erros I get before deleting the search Library Paths in Build Settings:
d: warning: directory not found for option
'-L"/Users/capture/Desktop/iMacXC2/Libraries"' Undefined symbols for
architecture armv7:
"_CIDetectorAccuracy", referenced from:
__ZNWwTeFvdBdVkDNRXNPUfEgifAKsRnrNYugVMtgpHhPUMqd in metaiosdk(xhvKRhZZTIhPZZYtqieHqfH) "_OBJC_CLASS_$_CIDetector",
referenced from:
objc-class-ref in metaiosdk(xhvKRhZZTIhPZZYtqieHqfH) "_kSecReturnRef", referenced from:
_darwinssl_connect_common in metaiosdk(libcurl_la-curl_darwinssl.o) "_CIDetectorAccuracyLow",
referenced from:
__ZNWwTeFvdBdVkDNRXNPUfEgifAKsRnrNYugVMtgpHhPUMqd in metaiosdk(xhvKRhZZTIhPZZYtqieHqfH) "_kSecMatchPolicy", referenced
from:
_darwinssl_connect_common in metaiosdk(libcurl_la-curl_darwinssl.o) "_kSecMatchLimitOne",
referenced from:
_darwinssl_connect_common in metaiosdk(libcurl_la-curl_darwinssl.o) "_kSecMatchLimit", referenced
from:
_darwinssl_connect_common in metaiosdk(libcurl_la-curl_darwinssl.o) "_kSecClass", referenced
from:
_darwinssl_connect_common in metaiosdk(libcurl_la-curl_darwinssl.o) "_SSLWrite", referenced from:
_darwinssl_send in metaiosdk(libcurl_la-curl_darwinssl.o) "_SSLGetBufferedReadSize", referenced from:
_Curl_darwinssl_data_pending in metaiosdk(libcurl_la-curl_darwinssl.o) "_kSecClassIdentity",
referenced from:
_darwinssl_connect_common in metaiosdk(libcurl_la-curl_darwinssl.o) "_SSLClose", referenced from:
_Curl_darwinssl_close in metaiosdk(libcurl_la-curl_darwinssl.o) "_SSLSetSessionOption",
referenced from:
_darwinssl_connect_common in metaiosdk(libcurl_la-curl_darwinssl.o)
"_SSLGetNumberSupportedCiphers", referenced from:
_darwinssl_connect_common in metaiosdk(libcurl_la-curl_darwinssl.o) "_SSLCreateContext",
referenced from:
_darwinssl_connect_common in metaiosdk(libcurl_la-curl_darwinssl.o) "_SSLSetProtocolVersionMax",
referenced from:
_darwinssl_connect_common in metaiosdk(libcurl_la-curl_darwinssl.o) "_SecItemCopyMatching",
referenced from:
_darwinssl_connect_common in metaiosdk(libcurl_la-curl_darwinssl.o)
"_SSLGetNegotiatedProtocolVersion", referenced from:
_darwinssl_connect_step2 in metaiosdk(libcurl_la-curl_darwinssl.o) "_SSLSetProtocolVersionMin",
referenced from:
_darwinssl_connect_common in metaiosdk(libcurl_la-curl_darwinssl.o) "_SSLGetSessionState",
referenced from:
_Curl_darwinssl_check_cxn in metaiosdk(libcurl_la-curl_darwinssl.o) "_SSLSetEnabledCiphers",
referenced from:
_darwinssl_connect_common in metaiosdk(libcurl_la-curl_darwinssl.o) "_SecPolicyCreateSSL",
referenced from:
_darwinssl_connect_common in metaiosdk(libcurl_la-curl_darwinssl.o)
"_SecIdentityCopyCertificate", referenced from:
_darwinssl_connect_common in metaiosdk(libcurl_la-curl_darwinssl.o) "_SSLSetPeerID", referenced
from:
_darwinssl_connect_common in metaiosdk(libcurl_la-curl_darwinssl.o) "_SSLGetNegotiatedCipher",
referenced from:
_darwinssl_connect_step2 in metaiosdk(libcurl_la-curl_darwinssl.o) "_SSLSetPeerDomainName",
referenced from:
_darwinssl_connect_common in metaiosdk(libcurl_la-curl_darwinssl.o) "_SSLRead", referenced from:
_darwinssl_recv in metaiosdk(libcurl_la-curl_darwinssl.o) "_SSLSetIOFuncs", referenced from:
_darwinssl_connect_common in metaiosdk(libcurl_la-curl_darwinssl.o) "_SSLHandshake", referenced
from:
_darwinssl_connect_step2 in metaiosdk(libcurl_la-curl_darwinssl.o) "_SSLCopyPeerTrust",
referenced from:
_darwinssl_connect_common in metaiosdk(libcurl_la-curl_darwinssl.o) "_SSLGetSupportedCiphers",
referenced from:
_darwinssl_connect_common in metaiosdk(libcurl_la-curl_darwinssl.o)
"_SecCertificateCopySubjectSummary", referenced from:
_darwinssl_connect_common in metaiosdk(libcurl_la-curl_darwinssl.o) "_SSLSetConnection",
referenced from:
_darwinssl_connect_common in metaiosdk(libcurl_la-curl_darwinssl.o) "_CIDetectorTypeFace",
referenced from:
__ZNWwTeFvdBdVkDNRXNPUfEgifAKsRnrNYugVMtgpHhPUMqd in metaiosdk(xhvKRhZZTIhPZZYtqieHqfH) "_SSLSetCertificate", referenced
from:
_darwinssl_connect_common in metaiosdk(libcurl_la-curl_darwinssl.o)
"_SecTrustGetCertificateCount", referenced from:
_darwinssl_connect_common in metaiosdk(libcurl_la-curl_darwinssl.o)
"_SecTrustGetCertificateAtIndex", referenced from:
_darwinssl_connect_common in metaiosdk(libcurl_la-curl_darwinssl.o) ld: symbol(s) not found for
architecture armv7 clang: error: linker command failed with exit code
1 (use -v to see invocation)
And then after I delete the Library Search Paths, I get this:
Ld
/Users/capture/Library/Developer/Xcode/DerivedData/Unity-iPhone-glogufgfblmcyzasljopkkqcjtso/Build/Products/iMac.app/iMac
normal armv7
cd /Users/capture/Desktop/iMacXC2
export IPHONEOS_DEPLOYMENT_TARGET=7.1
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++
-arch armv7 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS7.1.sdk
-L/Users/capture/Library/Developer/Xcode/DerivedData/Unity-iPhone-glogufgfblmcyzasljopkkqcjtso/Build/Products
-F/Users/capture/Library/Developer/Xcode/DerivedData/Unity-iPhone-glogufgfblmcyzasljopkkqcjtso/Build/Products
-filelist /Users/capture/Library/Developer/Xcode/DerivedData/Unity-iPhone-glogufgfblmcyzasljopkkqcjtso/Build/Intermediates/Unity-iPhone.build/Debug-iphoneos/Unity-iPhone.build/Objects-normal/armv7/iMac.LinkFileList
-dead_strip -weak_framework CoreMotion -weak-lSystem -stdlib=libstdc++ -fobjc-link-runtime -miphoneos-version-min=7.1 /Users/capture/Desktop/iMacXC2/Libraries/metaiosdk -lxml2 -framework
Foundation -framework UIKit -framework OpenGLES -framework QuartzCore
-framework OpenAL -liconv.2 -liPhone-lib -framework AudioToolbox -framework CFNetwork -framework MediaPlayer -framework CoreLocation -framework SystemConfiguration -weak_framework iAd -framework CoreMedia -framework CoreVideo -weak_framework AVFoundation -framework
CoreGraphics -weak_framework CoreMotion -weak_framework GameKit
-Xlinker -dependency_info -Xlinker /Users/capture/Library/Developer/Xcode/DerivedData/Unity-iPhone-glogufgfblmcyzasljopkkqcjtso/Build/Intermediates/Unity-iPhone.build/Debug-iphoneos/Unity-iPhone.build/Objects-normal/armv7/iMac_dependency_info.dat
-o /Users/capture/Library/Developer/Xcode/DerivedData/Unity-iPhone-glogufgfblmcyzasljopkkqcjtso/Build/Products/iMac.app/iMac
ld: library not found for -liPhone-lib clang: error: linker command
failed with exit code 1 (use -v to see invocation)
And after I re-import the missing library, I just continue on that pattern of get errors for Library Search Paths, have to reimport Library, repeat, over and over, until reaching the above image where I need Unity/GlesHelper.h, at which point I am at a loss.
You are right, you do need Unity Pro, but it looks like you missed some steps from the Metaio Getting Started with Unity page. You need to drag in the metaioSDK as you have done, but you also need to add frameworks for:
libc++.dylib
libxml2.2.dylib (you did this one)
Security.framework
CoreImage.framework (SDK 5.5 and newer)
Metaio requires a Unity pro license because it is a plugin, and it will fail to launch without said license. I was attempting to compile without a license. (Lesson learned)
I have a strange issue, that may be obvious, but is really not clear for me at the moment :
I'm making a Quartz Composer plugin.
I have an XCode workspace based which includes a custom library. This library is compiling the poly2tri-c delaunay triangulation library, which is linking against glib.
I have no trouble with compiling my library, but the plugin itself doesn't want to compile and throw these errors :
Undefined symbols for architecture i386:
"p2t_cdt_new(_GPtrArray*)", referenced from:
-[hOzPolygon2D triangulationWithRefineSteps:holes:steinerPoints:] in libhOzVector.a(hOzPolygons.o)
"p2t_cdt_free(CDT_)", referenced from:
-[hOzPolygon2D triangulationWithRefineSteps:holes:steinerPoints:] in libhOzVector.a(hOzPolygons.o)
"p2t_point_new_dd(double, double)", referenced from:
-[hOzPolygon2D triangulationWithRefineSteps:holes:steinerPoints:] in libhOzVector.a(hOzPolygons.o)
"p2t_cdt_triangulate(CDT_)", referenced from:
-[hOzPolygon2D triangulationWithRefineSteps:holes:steinerPoints:] in libhOzVector.a(hOzPolygons.o)
"p2t_cdt_get_triangles(CDT_)", referenced from:
-[hOzPolygon2D triangulationWithRefineSteps:holes:steinerPoints:] in libhOzVector.a(hOzPolygons.o)
"p2t_triangle_get_point(_P2tTriangle, int)", referenced from:
-[hOzPolygon2D triangulationWithRefineSteps:holes:steinerPoints:] in libhOzVector.a(hOzPolygons.o)
"_g_ptr_array_add", referenced from:
-[hOzPolygon2D triangulationWithRefineSteps:holes:steinerPoints:] in libhOzVector.a(hOzPolygons.o)
"_g_ptr_array_new", referenced from:
-[hOzPolygon2D triangulationWithRefineSteps:holes:steinerPoints:] in libhOzVector.a(hOzPolygons.o)
ld: symbol(s) not found for architecture i386
collect2: ld returned 1 exit status
Here is the pic of the compiler messages :
And of my links :
I usually have these messages when I forget to link against a lib, but here I'm linking against glib in the library itself and in the plugin project.
Any ideas on what's wrong ?
Thank you !
Well, after some "esoteric" research, I finally found what was wrong : XCode was just not automatically including the c files in the target membership...
I'm trying to use PDColoredProgressView from here. It was working, but for some reason, XCode decided it wasn't having it and throws up 27 Apple Mach-O Linker (Id) Errors. Huh? Can anyone decode this? Thanks!
Ld /Users/xxxxxxxx/Library/Developer/Xcode/DerivedData/xxxxx-cqamvgtgfzdealbjtkomtjzxkdgr/Build/Intermediates/xxxxxxx.build/Debug-iphoneos/xxxxx.build/Objects-normal/armv6/xxxxx normal armv6
cd "/Users/xxxxxxx/Documents/iPhone Apps/xxxxx"
setenv IPHONEOS_DEPLOYMENT_TARGET 4.0
setenv PATH "/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin:/Developer/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin"
/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/gcc-4.2 -arch armv6 -isysroot /Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS4.3.sdk -L/Users/xxxxxxxxx/Library/Developer/Xcode/DerivedData/xxxxx-cqamvgtgfzdealbjtkomtjzxkdgr/Build/Products/Debug-iphoneos -F/Users/xxxxxxxxx/Library/Developer/Xcode/DerivedData/xxxxx-cqamvgtgfzdealbjtkomtjzxkdgr/Build/Products/Debug-iphoneos -filelist /Users/xxxxxxxxx/Library/Developer/Xcode/DerivedData/xxxxx-cqamvgtgfzdealbjtkomtjzxkdgr/Build/Intermediates/xxxxx.build/Debug-iphoneos/xxxxx.build/Objects-normal/armv6/xxxxx.LinkFileList -dead_strip -miphoneos-version-min=4.0 -framework UIKit -framework Foundation -framework QuartzCore -o /Users/xxxxxxxxx/Library/Developer/Xcode/DerivedData/xxxxx-cqamvgtgfzdealbjtkomtjzxkdgr/Build/Intermediates/xxxxx.build/Debug-iphoneos/xxxxx.build/Objects-normal/armv6/xxxxx
Undefined symbols for architecture armv6:
"_CGRectGetMinX", referenced from:
_addRoundedRectToPath in PDColoredProgressView.o
_fillRectWithLinearGradient in PDColoredProgressView.o
"_CGRectGetMinY", referenced from:
_addRoundedRectToPath in PDColoredProgressView.o
_fillRectWithLinearGradient in PDColoredProgressView.o
"_CGContextSetRGBStrokeColor", referenced from:
-[PDColoredProgressView drawRect:] in PDColoredProgressView.o
"_CGContextSetLineWidth", referenced from:
-[PDColoredProgressView drawRect:] in PDColoredProgressView.o
"_CGContextIsPathEmpty", referenced from:
_fillRectWithLinearGradient in PDColoredProgressView.o
"_CGColorSpaceCreateDeviceRGB", referenced from:
_fillRectWithLinearGradient in PDColoredProgressView.o
"_CGContextSaveGState", referenced from:
_addRoundedRectToPath in PDColoredProgressView.o
_fillRectWithLinearGradient in PDColoredProgressView.o
"_CGRectGetHeight", referenced from:
_addRoundedRectToPath in PDColoredProgressView.o
"_CGContextStrokeRect", referenced from:
-[PDColoredProgressView drawRect:] in PDColoredProgressView.o
"_CGContextRestoreGState", referenced from:
_addRoundedRectToPath in PDColoredProgressView.o
_fillRectWithLinearGradient in PDColoredProgressView.o
"_CGContextSetFillColorWithColor", referenced from:
-[PDColoredProgressView drawRect:] in PDColoredProgressView.o
"_CGRectGetWidth", referenced from:
_addRoundedRectToPath in PDColoredProgressView.o
"_CGContextTranslateCTM", referenced from:
_addRoundedRectToPath in PDColoredProgressView.o
_fillRectWithLinearGradient in PDColoredProgressView.o
"_CGContextScaleCTM", referenced from:
_addRoundedRectToPath in PDColoredProgressView.o
"_CGContextSetRGBFillColor", referenced from:
-[PDColoredProgressView drawRect:] in PDColoredProgressView.o
"_CGContextMoveToPoint", referenced from:
_addRoundedRectToPath in PDColoredProgressView.o
-[PDColoredProgressView drawRect:] in PDColoredProgressView.o
"_CGContextFillRect", referenced from:
-[PDColoredProgressView drawRect:] in PDColoredProgressView.o
"_CGContextClip", referenced from:
_fillRectWithLinearGradient in PDColoredProgressView.o
-[PDColoredProgressView drawRect:] in PDColoredProgressView.o
"_CGContextAddLineToPoint", referenced from:
-[PDColoredProgressView drawRect:] in PDColoredProgressView.o
"_CGContextStrokePath", referenced from:
-[PDColoredProgressView drawRect:] in PDColoredProgressView.o
"_CGContextAddRect", referenced from:
_addRoundedRectToPath in PDColoredProgressView.o
"_CGGradientRelease", referenced from:
_fillRectWithLinearGradient in PDColoredProgressView.o
"_CGContextDrawLinearGradient", referenced from:
_fillRectWithLinearGradient in PDColoredProgressView.o
"_CGColorSpaceRelease", referenced from:
_fillRectWithLinearGradient in PDColoredProgressView.o
"_CGContextAddArcToPoint", referenced from:
_addRoundedRectToPath in PDColoredProgressView.o
"_CGGradientCreateWithColorComponents", referenced from:
_fillRectWithLinearGradient in PDColoredProgressView.o
"_CGContextClosePath", referenced from:
_addRoundedRectToPath in PDColoredProgressView.o
ld: symbol(s) not found for architecture armv6
collect2: ld returned 1 exit status
Thank you!
*Note: I removed my username and app name from the error message and replaced them with x's
From Error log, I believe you are missing project or library Architecture settings (depending on where you used above code). Just add armv6(or its equivalent architecture name) in project settings and things should be fine.
You don't have the Core Graphics library installed! Add the core graphics library then in the PDColoredProgressView.h add #import <CoreGraphics/CoreGraphics.h>..
You may also need QuartzCore for some of the stuff you are doing! armv7 has nothing to do with it I dunno why they threw that in there haha!