我正準備在Mac OS 10.9/XCode5上使用libdc1394進行相機捕獲,並且正在運行Apple Mach-O鏈接程序錯誤。我正在努力解決libdc1394和XCode的instructions問題,併成功地找到了libdc1394.dylib,其中包括和進入hello world,這應該意味着所有內容都已正確連接。在XCode/Mac OS 10.9中使用libdc1394會導致鏈接器錯誤 - 針對體系結構x86_64的未定義符號
我是Xcode開發新手,所以請儘可能在您的答案中詳細說明!我知道這可能與構建的目標有關。
下一步是建立一個簡單的例子(grab_color_image.c),但我得到一噸的鏈接錯誤的,從什麼在void cleanup_and_exit(dc1394camera_t *camera)
,我註釋掉:
void cleanup_and_exit(dc1394camera_t *camera)
{
// dc1394_video_set_transmission(camera, DC1394_OFF);
// dc1394_capture_stop(camera);
// dc1394_camera_free(camera);
// exit(1);
}
對於例如,取消註釋上面的第一行給出: *架構x86_64的未定義符號: 「_dc1394_video_set_transmission」,引用自:cleanup_and_exit(__ dc1394_camera **)in main.o ld:symbol(s)not found fo R體系結構同時x86_64的鏗鏘:錯誤:連接命令失敗,退出代碼1(使用-v看看調用)
下面我試圖在節目中繼續移動,留下上面的東西註釋掉...
下面的程序給出在d = dc1394_new();
類似的錯誤:爲架構x86_64的未定義符號: 「_dc1394_new」,從引用:在main.o中 LD _main:符號(多個)未找到架構x86_64的 鐺:錯誤:連接器命令,退出代碼爲1(使用-v看看調用)
#include <iostream>
#include <dc1394/dc1394.h>
#include <stdio.h>
#include <stdint.h>
#include <dc1394/dc1394.h>
#include <stdlib.h>
#include <inttypes.h>
#ifndef _WIN32
#include <unistd.h>
#endif
#define IMAGE_FILE_NAME "image.ppm"
/*-----------------------------------------------------------------------
* Releases the cameras and exits
*-----------------------------------------------------------------------*/
void cleanup_and_exit(dc1394camera_t *camera)
{
// dc1394_video_set_transmission(camera, DC1394_OFF);
// dc1394_capture_stop(camera);
// dc1394_camera_free(camera);
// exit(1);
}
int main(int argc, const char * argv[])
{
FILE* imagefile;
dc1394camera_t *camera;
unsigned int width, height;
dc1394video_frame_t *frame=NULL;
//dc1394featureset_t features;
dc1394_t * d;
dc1394camera_list_t * list;
dc1394error_t err;
d = dc1394_new(); // <-- THIS gives a linker error, the above stuff is fine
// if (!d)
// return 1;
// err=dc1394_camera_enumerate (d, &list);
// DC1394_ERR_RTN(err,"Failed to enumerate cameras");
// insert code here...
std::cout << "Hello, World!\n";
return 0;
}
正如我前面提到的,我完全新Xcode開發,並懷疑它可能有一些做了「構建失敗目標「,但並不完全明顯。以下是一些基本信息的快照(對不起,它有點模糊):