用C使用利尔吉斯特描述C code ++ [英] Lear Gist Descriptor C code used with C++
问题描述
我用的李尔的实现主旨描述符的一种能在这里找到一个项目:的http://利尔。 inrialpes.fr/software 。
I am using Lear's implementation of the Gist descriptor for a project which can be found here: http://lear.inrialpes.fr/software.
我写在C ++应用程序,我想使用这个库。我有虽与makefile的问题和一般的链接。
I am writing an application in c++ and I want to use this library. I am having issues though with the makefile and linking in general.
这些命令给我任何错误:
These commands give me no errors:
g++ -c standalone_image.c -o standalone_image.o
g++ -c gist.c -o gist.o
不过,此行
g++ compute_gist.c `pkg-config --cflags --libs opencv`
给我下面的错误
Undefined symbols for architecture x86_64:
"color_gist_scaletab(color_image_t*, int, int, int const*)", referenced from:
_main in ccMFYbAU.o
"color_image_delete(color_image_t*)", referenced from:
_main in ccMFYbAU.o
"color_image_new(int, int)", referenced from:
load_ppm(char const*)in ccMFYbAU.o
ld: symbol(s) not found for architecture x86_64
collect2: ld returned 1 exit status
我在不同的目录马赛克C ++ code。我也试图编译要点和单独standalone_image,复制到马赛克目录,并编译马赛克code。
这给了我以下错误:
I have the Mosaic c++ code in a different directory. I also tried to compile gist and standalone_image seperately, copy into the mosaic directory, and compile the Mosaic code. Which gives me the following error:
Undefined symbols for architecture x86_64:
"color_gist_scaletab(color_image_t*, int, int, int const*)", referenced from:
_main in main.o
ld: symbol(s) not found for architecture x86_64
collect2: ld returned 1 exit status
make: *** [mosaic] Error 1
我真的希望在我的项目使用这个库,但我不能想出一个办法来整合它在我的C ++。
I really want to use this library in my project, but I can't figure out a way to incorporate it in my c++.
任何帮助是极大AP preciated!谢谢!
Any help is GREATLY appreciated! Thanks!
编辑:我使用的是Mac狮子:
I am using Mac Lion with:
gcc + g++ version: i686-apple-darwin11-llvm-gcc-4.2 (GCC) 4.2.1 (Based on Apple Inc. build 5658) (LLVM build 2336.1.00)
李尔库还采用了FFTW3库,应与C和C ++的工作。
The lear library also uses the FFTW3 library that should work with C and C++.
推荐答案
问题是,我需要周围的要旨的extern包括,但那是在Makefile做链接是也是错误的。它的工作原理吧。 :)
The problem was that I needed the extern around the gist include, but the linking that was done in the Makefile was also wrong. It works now. :)
这篇关于用C使用利尔吉斯特描述C code ++的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!