0

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 :

Compiler messages

And of my links :

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 !

Benoît Lahoz
  • 1,270
  • 1
  • 18
  • 43

1 Answers1

0

Well, after some "esoteric" research, I finally found what was wrong : XCode was just not automatically including the c files in the target membership...

Dan D.
  • 73,243
  • 15
  • 104
  • 123
Benoît Lahoz
  • 1,270
  • 1
  • 18
  • 43
  • Could you elaborate? I'm having a similar problem. I include the -I arguments in XCode's Other C Flags section, and If I create for example a GList pointer, I have no problem, but the compiler throws an error if I call any GLib function, such as g_list_append() – acib708 Sep 14 '13 at 03:59
  • I don't know what's happening for you exactly. But, for me, it was only that all my projects files wren't with the .mm extension ; and, the GLib source files weren't added automatically in the Target Membership (right XCode panel). – Benoît Lahoz Sep 14 '13 at 17:18