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...
Related
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.
When creating a build archive in Xcode, get these error messages. But I can run the app in my iOS device.
Undefined symbols for architecture armv7:
"_OBJC_CLASS_$_FlutterAppDelegate", referenced from:
_OBJC_CLASS_$_AppDelegate in AppDelegate.o
"_FlutterMethodNotImplemented", referenced from:
-[FLTFirebaseAdMobPlugin handleMethodCall:result:] in libfirebase_admob.a(FirebaseAdMobPlugin.o)
-[LocationPlugin handleMethodCall:result:] in liblocation.a(LocationPlugin.o)
___52+[FLTSharedPreferencesPlugin registerWithRegistrar:]_block_invoke in libshared_preferences.a(SharedPreferencesPlugin.o)
"_OBJC_CLASS_$_FlutterError", referenced from:
objc-class-ref in libfirebase_admob.a(FirebaseAdMobPlugin.o)
"_OBJC_CLASS_$_FlutterMethodChannel", referenced from:
objc-class-ref in libfirebase_admob.a(FirebaseAdMobPlugin.o)
objc-class-ref in liblocation.a(LocationPlugin.o)
objc-class-ref in libshared_preferences.a(SharedPreferencesPlugin.o)
"_OBJC_CLASS_$_FlutterEventChannel", referenced from:
objc-class-ref in liblocation.a(LocationPlugin.o)
"_OBJC_METACLASS_$_FlutterAppDelegate", referenced from:
_OBJC_METACLASS_$_AppDelegate in AppDelegate.o
ld: symbol(s) not found for architecture armv7
clang: error: linker command failed with exit code 1 (use -v to see invocation)
It seems that you are missing armv7 support in your Flutter.framework.That's why you could run on your arm64 device but failed to archive for generic devices. Follow these instructions to produce a Flutter.framework that supports armv7. Armv7 build instructions. And take a look at this issue might help.
I am running a project in Xcode 6 ,I am facing this error can any one help to resolve the issue . I has changed valid architecture to armv7 armv7s arm64 then the issue not shown again , but i was getting other error for file while is not support for 64 bit. I am getting below errors
"_OBJC_CLASS_$_OAAsynchronousDataFetcher", referenced from:
objc-class-ref in LoginViewController.o
"_OBJC_CLASS_$_OAConsumer", referenced from:
objc-class-ref in SA_OAuthTwitterEngine.o
objc-class-ref in LoginViewController.o
"_OBJC_CLASS_$_OADataFetcher", referenced from:
objc-class-ref in SA_OAuthTwitterEngine.o
"_OBJC_CLASS_$_OAMutableURLRequest", referenced from:
objc-class-ref in SA_OAuthTwitterEngine.o
objc-class-ref in LoginViewController.o
"_OBJC_CLASS_$_OARequestParameter", referenced from:
objc-class-ref in SA_OAuthTwitterEngine.o
objc-class-ref in LoginViewController.o
"_OBJC_CLASS_$_OAToken", referenced from:
objc-class-ref in SA_OAuthTwitterEngine.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
No architectures to compile for (ONLY_ACTIVE_ARCH=YES, active arch=x86_64, VALID_ARCHS=i386).
Waiting for response.
I was facing same issue, I just Replace the Twitter Library with new Library that support arm64.
Please download the updated library from https://github.com/bengottlieb/Twitter-OAuth-iPhone/tree/master/Twitter%2BOAuth
and one more thing update library path on Buid Settings -> Library Search Path very carefully
Remember me in your prayers :)
Go to Build Settings --->Architectures--->Build Active Architectures only--->Release -->NO
I'm not sure what these errors mean or what to do about them. I moved a folder and some files around in Finder, and then added them back to my project.
Undefined symbols for architecture i386:
"_OBJC_CLASS_$_IASKSettingsReader", referenced from:
objc-class-ref in IASKAppSettingsViewController.o
"_OBJC_CLASS_$_IASKSettingsStoreUserDefaults", referenced from:
objc-class-ref in IASKAppSettingsViewController.o
"_OBJC_CLASS_$_IASKSpecifierValuesViewController", referenced from:
objc-class-ref in IASKAppSettingsViewController.o
"_OBJC_CLASS_$_IASKPSTitleValueSpecifierViewCell", referenced from:
objc-class-ref in IASKAppSettingsViewController.o
ld: symbol(s) not found for architecture i386
clang: error: linker command failed with exit code 1 (use -v to see invocation)
This is followed by these error messages (which I can't copy as text)
I had just compiled successfully before the files were moved and added.
The class IASKSettingsReader/IASKSettingsStoreUserDefaults/... is not being linked. Please check that you have it included on your Xcode project and in the Build Phases of your project under Compile Sources, if not add them.
I'm trying to compile basic plugin for firefox and linker reports following problem:
Undefined symbols for architecture i386:
"_NPN_GetValue", referenced from:
_PluginLog in main.o
"_NPN_GetStringIdentifier", referenced from:
_PluginLog in main.o
"_NPN_GetProperty", referenced from:
_PluginLog in main.o
"_NPN_Invoke", referenced from:
_PluginLog in main.o
"_NPN_ReleaseObject", referenced from:
_PluginLog in main.o
"_NPN_ReleaseVariantValue", referenced from:
_PluginLog in main.o
ld: symbol(s) not found for architecture i386
collect2: ld returned 1 exit status
have I missed to add some linked libraries?
You can't just call those functions like you would a normal function (they aren't exported by a browser, nor are you linking against a browser); you need to use the function pointers from the NPNetscapeFuncs struct passed to you by the browser.