Note that there are some explanatory texts on larger screens.

plurals
  1. POApple Mach-O Linker (id) Error, with SketchUp C SLAPI
    text
    copied!<p>I am trying to manipulate SketchUp .skp file using provided SketchUp SLAPI framework. I've just included the entire framework file into X-code Project, but it continuously fail to build.. Is this problem coming from the path?</p> <p>The entire source code is the provided example from the SketchUp API:</p> <pre><code>#include "main.h" #include &lt;slapi/slapi.h&gt; #include &lt;slapi/geometry.h&gt; #include &lt;slapi/initialize.h&gt; #include &lt;slapi/unicodestring.h&gt; #include &lt;slapi/model/model.h&gt; #include &lt;slapi/model/entities.h&gt; #include &lt;slapi/model/face.h&gt; #include &lt;slapi/model/edge.h&gt; #include &lt;slapi/model/vertex.h&gt; #include &lt;vector&gt; int main() { // Always initialize the API before using it SUInitialize(); // Load the model from a file SUModelRef model = SU_INVALID; SUResult res = SUModelCreateFromFile(&amp;model, "model.skp"); // It's best to always check the return code from each SU function call. // Only showing this check once to keep this example short. if (res != SU_ERROR_NONE) return 1; // Get the entity container of the model. SUEntitiesRef entities = SU_INVALID; SUModelGetEntities(model, &amp;entities); // Get all the faces from the entities object size_t faceCount = 0; SUEntitiesGetNumFaces(entities, &amp;faceCount); if (faceCount &gt; 0) { std::vector&lt;SUFaceRef&gt; faces(faceCount); SUEntitiesGetFaces(entities, faceCount, &amp;faces[0], &amp;faceCount); // Get all the edges in this face for (size_t i = 0; i &lt; faceCount; i++) { size_t edgeCount = 0; SUFaceGetNumEdges(faces[i], &amp;edgeCount); if (edgeCount &gt; 0) { std::vector&lt;SUEdgeRef&gt; edges(edgeCount); SUFaceGetEdges(faces[i], edgeCount, &amp;edges[0], &amp;edgeCount); // Get the vertex positions for each edge for (size_t j = 0; j &lt; edgeCount; j++) { SUVertexRef startVertex = SU_INVALID; SUVertexRef endVertex = SU_INVALID; SUEdgeGetStartVertex(edges[j], &amp;startVertex); SUEdgeGetEndVertex(edges[j], &amp;endVertex); SUPoint3D start; SUPoint3D end; SUVertexGetPosition(startVertex, &amp;start); SUVertexGetPosition(endVertex, &amp;end); // Now do something with the point data } } } } // Get model name SUStringRef name = SU_INVALID; SUStringCreate(&amp;name); SUModelGetName(model, &amp;name); size_t name_length = 0; SUStringGetUTF8Length(name, &amp;name_length); char* name_utf8 = new char[name_length + 1]; SUStringGetUTF8(name, name_length + 1, name_utf8, &amp;name_length); // Now we have the name in a form we can use SUStringRelease(&amp;name); delete []name_utf8; // Must release the model or there will be memory leaks SUModelRelease(&amp;model); // Always terminate the API when done using it SUTerminate(); return 0; } </code></pre> <p>Warning look like</p> <pre><code> ld: warning: ignoring file /Users/qubick/Desktop/Test/slapi.framework/slapi, file was built for unsupported file format ( 0xce 0xfa 0xed 0xfe 0x 7 0x 0 0x 0 0x 0 0x 3 0x 0 0x 0 0x 0 0x 6 0x 0 0x 0 0x 0 ) which is not the architecture being linked (x86_64): /Users/qubick/Desktop/Test/slapi.framework/slapi Undefined symbols for architecture x86_64: "_SUEdgeGetEndVertex", referenced from: _main in main.o "_SUEdgeGetStartVertex", referenced from: _main in main.o "_SUEntitiesGetFaces", referenced from: _main in main.o "_SUEntitiesGetNumFaces", referenced from: _main in main.o "_SUFaceGetEdges", referenced from: _main in main.o "_SUFaceGetNumEdges", referenced from: _main in main.o "_SUInitialize", referenced from: _main in main.o "_SUModelCreateFromFile", referenced from: _main in main.o "_SUModelGetEntities", referenced from: _main in main.o "_SUModelGetName", referenced from: _main in main.o "_SUModelRelease", referenced from: _main in main.o "_SUStringCreate", referenced from: _main in main.o "_SUStringGetUTF8", referenced from: _main in main.o "_SUStringGetUTF8Length", referenced from: _main in main.o "_SUStringRelease", referenced from: _main in main.o "_SUTerminate", referenced from: _main in main.o "_SUVertexGetPosition", referenced from: _main in main.o ld: symbol(s) not found for architecture x86_64 clang: error: linker command failed with exit code 1 (use -v to see invocation) </code></pre> <p>screenshot: <a href="https://docs.google.com/file/d/0B-JhSq_7buRkWlE2Z294ZlRXZjQ/edit" rel="nofollow">https://docs.google.com/file/d/0B-JhSq_7buRkWlE2Z294ZlRXZjQ/edit</a></p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload