lostcaggy
unread,Apr 17, 2012, 5:25:23 PM4/17/12Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to beagl...@googlegroups.com
I'm using Netbeans on Mac os x, compiling remotely on the beaglebone. Angstrom image from the 9th April 2012.
the code is
#include <stdio.h>
#include <opencv/cvaux.h>
#include <opencv/highgui.h>
#include <opencv/cxcore.h>
int main(int argc, char* argv[])
{
CvCapture* camera = cvCreateCameraCapture(-1); // Use the default camera
IplImage* frame = 0;
IplImage img;
frame = cvQueryFrame(camera); //need to capture at least one extra frame
frame = cvQueryFrame(camera);
if (frame != NULL) {
printf("got frame\n\r");
cvSaveImage("webcam.jpg", frame);
} else {
printf("Null frame\n\r");
}
cvReleaseCapture(&camera);
return 0;
}
but I keep getting the following error message. I'm new to this type of programming so could really do with some pointers.
"/usr/bin/make" -f nbproject/Makefile-Debug.mk QMAKE= SUBPROJECTS= .build-conf
make[1]: Entering directory `/testanapp'
"/usr/bin/make" -f nbproject/Makefile-Debug.mk dist/Debug/GNU-Linux-x86/testanapp
make[2]: Entering directory `/testanapp'
mkdir -p build/Debug/GNU-Linux-x86
rm -f build/Debug/GNU-Linux-x86/main.o.d
g++ -c -g -I../usr/include -I../usr/lib -MMD -MP -MF build/Debug/GNU-Linux-x86/main.o.d -o build/Debug/GNU-Linux-x86/main.o main.cpp
mkdir -p dist/Debug/GNU-Linux-x86
g++ -o dist/Debug/GNU-Linux-x86/testanapp build/Debug/GNU-Linux-x86/main.o -L../usr/include -L../usr/lib
build/Debug/GNU-Linux-x86/main.o: In function `main':
/testanapp/main.cpp:14: undefined reference to `cvCreateCameraCapture'
/testanapp/main.cpp:19: undefined reference to `cvQueryFrame'
/testanapp/main.cpp:20: undefined reference to `cvQueryFrame'
/testanapp/main.cpp:23: undefined reference to `cvSaveImage'
/testanapp/main.cpp:27: undefined reference to `cvReleaseCapture'
collect2: ld returned 1 exit status
make[2]: *** [dist/Debug/GNU-Linux-x86/testanapp] Error 1
make[1]: *** [.build-conf] Error 2
make: *** [.build-impl] Error 2
make[2]: Leaving directory `/testanapp'
make[1]: Leaving directory `/testanapp'
BUILD FAILED (exit value 2, total time: 14s)