对“_imp___ZN11C1394Camera10InitCameraEi”的未定义引用日食上有 1394cmu
我使用这个程序与 Opencv 和 1394cmu 从火线获取视频流。 但是当我编译该项目时,我遇到了一些错误。库在 Eclipse 中正确导入,事实上可以看到对象的方法,并且两个 ddl 也正确导入,所以我不知道问题出在这里
undefined reference to `_imp___ZN11C1394Camera10InitCameraEi'
undefined reference to `_imp___ZN11C1394Camera12AcquireImageEv'
undefined reference to `_imp___ZN11C1394Camera12SetVideoModeEm'
undefined reference to `_imp___ZN11C1394Camera14SetVideoFormatEm'
undefined reference to `_imp___ZN11C1394Camera16StopImageCaptureEv'
undefined reference to `_imp___ZN11C1394Camera17SetVideoFrameRateEm'
undefined reference to `_imp___ZN11C1394Camera21StartImageAcquisitionEv'
undefined reference to `_imp___ZN11C1394Camera6getRGBEPhm'
undefined reference to `_imp___ZN11C1394Camera9CheckLinkEv'
undefined reference to `_imp___ZN11C1394CameraC1Ev'
#include "1394Camera.h"
// adjust parameters to your needs
#define CAM_RES_WIDTH 640
#define CAM_RES_HEIGHT 480
#define CAM_RES_CHANNELS 3
//camera object of the 1394CMU driver
C1394Camera Camera;
int main( int argc, char** argv )
{
// several checks if camera is connected and can be initialized as well as setting
// of camera properties and starting of image aquisition
if(Camera.CheckLink() != CAM_SUCCESS)
{
printf("\nNo Link.");
return -1;
}
if(Camera.InitCamera() != CAM_SUCCESS)
{
printf("\nInitialization failed.");
return -1;
}
if(Camera.SetVideoFormat(0) != CAM_SUCCESS)
{
printf("\nCould not set video format.");
return -1;
}
if(Camera.SetVideoMode(5) != CAM_SUCCESS)
{
printf("\nCould not set video mode.");
return -1;
}
if(Camera.SetVideoFrameRate(4) != CAM_SUCCESS)
{
printf("\nCould not set frame rate.");
return -1;
}
if(Camera.StartImageAcquisition() != CAM_SUCCESS)
{
printf("\nCould not start image acquisation.");
return -1;
}
//give camera a chance to inititalize and adjust before starting frame aquisition
cvWaitKey(1000);
cvNamedWindow( "Source",1);
IplImage *Image = cvCreateImage( cvSize(CAM_RES_WIDTH, CAM_RES_HEIGHT), 8, CAM_RES_CHANNELS);
//aquire frame from camera
if(Camera.AcquireImage() != CAM_SUCCESS)
{
printf("\nCould not acquire image.");
return 1;
}
//read frame from internal CMU1394 storage to buffer
Camera01.getRGB((unsigned char*)(Image->imageData), (CAM_RES_WIDTH*CAM_RES_HEIGHT*3));
cvShowImage("Source", Image);
cvWaitKey(0);
Camera.StopImageCapture();
cvReleaseImage(&Image);
cvDestroyWindow("Source");
}
I'm using this program with Opencv and 1394cmu to grab a video stream from firewire.
but when I compile the project I get some errors. the libraries are correctly imported in eclipse in fact the object's method are seen and the two ddl are also correctly imported so I have no idea qhere is the problem
undefined reference to `_imp___ZN11C1394Camera10InitCameraEi'
undefined reference to `_imp___ZN11C1394Camera12AcquireImageEv'
undefined reference to `_imp___ZN11C1394Camera12SetVideoModeEm'
undefined reference to `_imp___ZN11C1394Camera14SetVideoFormatEm'
undefined reference to `_imp___ZN11C1394Camera16StopImageCaptureEv'
undefined reference to `_imp___ZN11C1394Camera17SetVideoFrameRateEm'
undefined reference to `_imp___ZN11C1394Camera21StartImageAcquisitionEv'
undefined reference to `_imp___ZN11C1394Camera6getRGBEPhm'
undefined reference to `_imp___ZN11C1394Camera9CheckLinkEv'
undefined reference to `_imp___ZN11C1394CameraC1Ev'
#include "1394Camera.h"
// adjust parameters to your needs
#define CAM_RES_WIDTH 640
#define CAM_RES_HEIGHT 480
#define CAM_RES_CHANNELS 3
//camera object of the 1394CMU driver
C1394Camera Camera;
int main( int argc, char** argv )
{
// several checks if camera is connected and can be initialized as well as setting
// of camera properties and starting of image aquisition
if(Camera.CheckLink() != CAM_SUCCESS)
{
printf("\nNo Link.");
return -1;
}
if(Camera.InitCamera() != CAM_SUCCESS)
{
printf("\nInitialization failed.");
return -1;
}
if(Camera.SetVideoFormat(0) != CAM_SUCCESS)
{
printf("\nCould not set video format.");
return -1;
}
if(Camera.SetVideoMode(5) != CAM_SUCCESS)
{
printf("\nCould not set video mode.");
return -1;
}
if(Camera.SetVideoFrameRate(4) != CAM_SUCCESS)
{
printf("\nCould not set frame rate.");
return -1;
}
if(Camera.StartImageAcquisition() != CAM_SUCCESS)
{
printf("\nCould not start image acquisation.");
return -1;
}
//give camera a chance to inititalize and adjust before starting frame aquisition
cvWaitKey(1000);
cvNamedWindow( "Source",1);
IplImage *Image = cvCreateImage( cvSize(CAM_RES_WIDTH, CAM_RES_HEIGHT), 8, CAM_RES_CHANNELS);
//aquire frame from camera
if(Camera.AcquireImage() != CAM_SUCCESS)
{
printf("\nCould not acquire image.");
return 1;
}
//read frame from internal CMU1394 storage to buffer
Camera01.getRGB((unsigned char*)(Image->imageData), (CAM_RES_WIDTH*CAM_RES_HEIGHT*3));
cvShowImage("Source", Image);
cvWaitKey(0);
Camera.StopImageCapture();
cvReleaseImage(&Image);
cvDestroyWindow("Source");
}
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您如何编译以及如何链接您的程序?您可能在链接时忘记了一些库,例如
-lopencv
之类的东西。库的顺序很重要。How do you compile and how do you link your program? You probably have forgotten some library at link time, e.g. something like
-lopencv
or whatever. Order of libraries matters.