Note that there are some explanatory texts on larger screens.

plurals
  1. POTrying to run the sample MacOSX FaceTracker program in XCode using OpenCV-2.3.1 installed via cmake
    text
    copied!<p>Ok. I followed the "Using CMake to build" set of instructions on this site: <a href="http://opencv.willowgarage.com/wiki/Mac_OS_X_OpenCV_Port" rel="nofollow">http://opencv.willowgarage.com/wiki/Mac_OS_X_OpenCV_Port</a></p> <p>I made a "build" folder. I generated "Unix Makefiles" using cmake. I ran make -j8 and sudo make install. Everything should be where it needs to be, right? Wrong. I opened the FaceTracker.xcodeproj file, clicked "Run", and here's what I got:</p> <blockquote> <p>The run destination My Mac 64-bit is not valid for Running the scheme 'FaceTracker'.</p> <p>The scheme 'FaceTracker' contains no buildables that can be built for the SDKs supported by > the run destination My Mac 64-bit. Make sure your targets all specify SDKs that are supported by this version of Xcode.</p> </blockquote> <p>What should I do to get this to work? I'm scared to use the precompiled OpenCV packages on Lion considered how old they are. I'm also new to Xcode. </p> <p>Edit: December 14th, 7:05 PM:</p> <p>I made a helloworld program</p> <pre><code>//////////////////////////////////////////////////////////////////////// // // hello-world.cpp // // This is a simple, introductory OpenCV program. The program reads an // image from a file, inverts it, and displays the result. // //////////////////////////////////////////////////////////////////////// #include &lt;stdlib.h&gt; #include &lt;stdio.h&gt; #include &lt;math.h&gt; #include &lt;cv.h&gt; #include &lt;highgui.h&gt; int main(int argc, char *argv[]) { IplImage* img = 0; int height,width,step,channels; uchar *data; int i,j,k; if(argc&lt;2){ printf("Usage: main &lt;image-file-name&gt;\n\7"); exit(0); } // load an image img=cvLoadImage(argv[1]); if(!img){ printf("Could not load image file: %s\n",argv[1]); exit(0); } // get the image data height = img-&gt;height; width = img-&gt;width; step = img-&gt;widthStep; channels = img-&gt;nChannels; data = (uchar *)img-&gt;imageData; printf("Processing a %dx%d image with %d channels\n",height,width,channels); // create a window cvNamedWindow("mainWin", CV_WINDOW_AUTOSIZE); cvMoveWindow("mainWin", 100, 100); // invert the image for(i=0;i&lt;height;i++) for(j=0;j&lt;width;j++) for(k=0;k&lt;channels;k++) data[i*step+j*channels+k]=255-data[i*step+j*channels+k]; // show the image cvShowImage("mainWin", img ); // wait for a key cvWaitKey(0); // release the image cvReleaseImage(&amp;img ); return 0; } </code></pre> <p>I tried compiling it with gcc:</p> <pre><code>gcc helloworld.cpp helloworld.cpp:12:16: error: cv.h: No such file or directory helloworld.cpp:13:21: error: highgui.h: No such file or directory helloworld.cpp: In function ‘int main(int, char**)’: helloworld.cpp:18: error: ‘IplImage’ was not declared in this scope helloworld.cpp:18: error: ‘img’ was not declared in this scope helloworld.cpp:20: error: ‘uchar’ was not declared in this scope helloworld.cpp:20: error: ‘data’ was not declared in this scope helloworld.cpp:29: error: ‘cvLoadImage’ was not declared in this scope helloworld.cpp:40: error: expected primary-expression before ‘)’ token helloworld.cpp:40: error: expected `;' before ‘img’ helloworld.cpp:44: error: ‘CV_WINDOW_AUTOSIZE’ was not declared in this scope helloworld.cpp:44: error: ‘cvNamedWindow’ was not declared in this scope helloworld.cpp:45: error: ‘cvMoveWindow’ was not declared in this scope helloworld.cpp:52: error: ‘cvShowImage’ was not declared in this scope helloworld.cpp:55: error: ‘cvWaitKey’ was not declared in this scope helloworld.cpp:58: error: ‘cvReleaseImage’ was not declared in this scope Jesse:testing jessebikman$ g++ helloworld.cpp helloworld.cpp:12:16: error: cv.h: No such file or directory helloworld.cpp:13:21: error: highgui.h: No such file or directory helloworld.cpp: In function ‘int main(int, char**)’: helloworld.cpp:18: error: ‘IplImage’ was not declared in this scope helloworld.cpp:18: error: ‘img’ was not declared in this scope helloworld.cpp:20: error: ‘uchar’ was not declared in this scope helloworld.cpp:20: error: ‘data’ was not declared in this scope helloworld.cpp:29: error: ‘cvLoadImage’ was not declared in this scope helloworld.cpp:40: error: expected primary-expression before ‘)’ token helloworld.cpp:40: error: expected `;' before ‘img’ helloworld.cpp:44: error: ‘CV_WINDOW_AUTOSIZE’ was not declared in this scope helloworld.cpp:44: error: ‘cvNamedWindow’ was not declared in this scope helloworld.cpp:45: error: ‘cvMoveWindow’ was not declared in this scope helloworld.cpp:52: error: ‘cvShowImage’ was not declared in this scope helloworld.cpp:55: error: ‘cvWaitKey’ was not declared in this scope helloworld.cpp:58: error: ‘cvReleaseImage’ was not declared in this scope </code></pre> <p>It seems like my problem is with the installed libs, but I am not really sure where to find them considering that my platform is not Linux, but OS X, and I didn't use Macports or Home Brew, I used the recommended method of installation, CMake. Do you know how I would set up PKG_CONFIG_PATH on my mac using the locations used by CMake? The installation instructions are extremely confusing, and it doesn't seem as though I would be able to use CMake to uninstall OpenCV, which is also quite confusing. </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