不能得到Flandmarks工作,C ++,错误LNK2019,未解决的外部符号 [英] Cant get Flandmarks to work, C++, Error LNK2019, Unresolved external symbol

查看:300
本文介绍了不能得到Flandmarks工作,C ++,错误LNK2019,未解决的外部符号的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想测试Flandmarks的人脸检测
http:// cmp。 felk.cvut.cz/~uricamic/flandmark/ 但我不能让它工作。



我已经工作了大概10个小时。
我在opencv.org上要求帮助( http:/ /answers.opencv.org/question/16956/eye-detection-is-jumping/ ,问题首先是关于别的,如果你想阅读关于这个问题的话,看评论)和得到一些帮助但是问题仍然存在。



计算机:64位,windows 7,Visual studio 2010。



已尝试:



由于这个问题,我被要求尝试一个空项目,所以我这样做。



我在Visual Studio c ++ 2010中启动了一个空项目。
属性管理器 - >在C / C ++下添加 - >其他包括目录:

  * C:\Program Files(x86)\opencv\build\include 
* C:\Program Files(x86)\opencv\build\include\ opencv
* C:\Program Files(x86)\opencv\build\include\opencv2


b $ b

属性管理器 - > LInker - >其他包含目录 - >

  * C:\Program Files x86)\opencv\build\x64\vc10\lib; 
* C:\Program Files(x86)\opencv\build\x64\vc10\bin;
*%(AdditionalLibraryDirectories)



属性管理器 - >链接器 - >输入 - >其他依赖 - >

  * opencv_calib3d244d.lib 
* opencv_contrib244d.lib
* opencv_core244d.lib
* opencv_features2d244d.lib
* opencv_flann244d.lib
* opencv_gpu244d.lib
* opencv_haartraining_engined.lib
* opencv_highgui244d.lib
* opencv_imgproc244d.lib
* opencv_legacy244d .lib
* opencv_ml244d.lib
* opencv_nonfree244d.lib
* opencv_objdetect244d.lib
* opencv_photo244d.lib
* opencv_stitching244d.lib
* opencv_ts244d.lib
* opencv_video244d.lib
* opencv_videostab244d.lib

属性管理器 - >配置经理 - > ACtive解决方案平台 - >




  • 从win32更改为new,我从Itanium更改为x64。从win32中复制设置



从您可以在flandmarks首页下载的zip文件,我复制文件夹 libflandmark。到我的项目文件夹。我还将dat文件复制到项目文件夹。

  * flandmark_detector.cpp 
* flandmark_detector.h
* liblbp.cpp
* liblbp.h
* msvc-compat.h
* flandmark_model.dat

我创建了一个main.cpp,我添加了:

  #includestdio .h
#includeflandmark_detector.h


int main(int argc,char * argv [])
{
printf测试);
FLANDMARK_Model * model = flandmark_init(flandmark_model.dat);

return 0;
}

之后,错误是:

  1>所有输出都是最新的。 
1> main.obj:error LNK2019:在函数main中引用的未解析的外部符号struct model_struct * __cdecl flandmark_init(char const *)(?flandmark_init @@ YAPEAUmodel_struct @@ PEBD @ Z) C:\projects\test_projects\flandmarks_empty\x64\Debug\flandmarks_empty.exe:致命错误LNK1120:1未解决的外部
1>
1>构建失败。
1>
1>时间已过00:00:04.47
==========版本:0成功,1失败,0最新,0跳过====== ====

感谢您阅读!

解决方案

编译器正在查找flandmart_init(char const *)。您需要包括定义此函数的头文件。如果你已经包含了它的头文件,那么编译器不能找到函数flandmart_init()的定义。现在如果你有flandmark_detector.cpp和flandmark_model.cpp,因为这看起来像一个第三方代码。包括它们的头文件,然后包括在你的项目flandmark_model.cpp和flandmark_model.cpp,无论定义函数flandmart_init(char const *)。确保它编译。将它们与您的.cpp文件一起添加。您可以右键单击项目的源文件,然后单击; Add->现有项目。


I want to test Flandmarks for face detection http://cmp.felk.cvut.cz/~uricamic/flandmark/ But I cant get it to work.

I've been working on this for probably 10 hours. I asked for help on opencv.org (http://answers.opencv.org/question/16956/eye-detection-is-jumping/ , the question were first about something else, see comments if you want to read what was said about this problem) And got some help but the problem is still there.

Computer: 64bit, windows 7, Visual studio 2010.

What I've tried:

Due to this problem i was asked to try with an empty project so I did that.

I started an empty project in visual studio c++ 2010. Property manager-> Added under C/C++ -> Additional include directories:

* C:\Program Files (x86)\opencv\build\include
* C:\Program Files (x86)\opencv\build\include\opencv
* C:\Program Files (x86)\opencv\build\include\opencv2

Property manager-> LInker -> Additional include directories ->

* C:\Program Files (x86)\opencv\build\x64\vc10\lib;
* C:\Program Files (x86)\opencv\build\x64\vc10\bin; 
* %(AdditionalLibraryDirectories)

Property Manager -> Linker -> Input -> Additional dependencies ->

* opencv_calib3d244d.lib
* opencv_contrib244d.lib
* opencv_core244d.lib
* opencv_features2d244d.lib
* opencv_flann244d.lib
* opencv_gpu244d.lib
* opencv_haartraining_engined.lib
* opencv_highgui244d.lib
* opencv_imgproc244d.lib
* opencv_legacy244d.lib
* opencv_ml244d.lib
* opencv_nonfree244d.lib
* opencv_objdetect244d.lib
* opencv_photo244d.lib
* opencv_stitching244d.lib
* opencv_ts244d.lib
* opencv_video244d.lib
* opencv_videostab244d.lib

Property manager -> COnfiguration manager -> ACtive Solution platform ->

  • Changed from win32 to "new", where I changed from Itanium To x64. Copy settings from "win32"

From the zip-file that you can download at flandmarks homepage, I copy the files in the folder "libflandmark". to my project folder. And I also copy the dat-file to the project folder.

* flandmark_detector.cpp
* flandmark_detector.h
* liblbp.cpp
* liblbp.h
* msvc-compat.h
* flandmark_model.dat

I created a main.cpp where I added:

#include "stdio.h"
#include "flandmark_detector.h"


int main(int argc, char * argv[]) 
{ 
    printf("test");
    FLANDMARK_Model * model = flandmark_init("flandmark_model.dat");

    return 0;
}

After this the error is:

1>  All outputs are up-to-date.
1>main.obj : error LNK2019: unresolved external symbol "struct model_struct * __cdecl flandmark_init(char const *)" (?flandmark_init@@YAPEAUmodel_struct@@PEBD@Z) referenced in function main
1>C:\projects\test_projects\flandmarks_empty\x64\Debug\flandmarks_empty.exe : fatal error LNK1120: 1 unresolved externals
1>
1>Build FAILED.
1>
1>Time Elapsed 00:00:04.47
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========

Thanks for reading!

解决方案

The compiler is looking for flandmart_init(char const *). You need to include the header file that defined this function. If you have already included its header file then the compiler cannot find where the function flandmart_init() was defined. Now if you have flandmark_detector.cpp and flandmark_model.cpp as this looks like a third party code. Include both their header files and after that include on your project flandmark_model.cpp and flandmark_model.cpp, whichever defined the function flandmart_init(char const *). Make sure it compiles. Add them together with your .cpp files. You can right click the Source Files on your project, then click; Add->Existing Item.

这篇关于不能得到Flandmarks工作,C ++,错误LNK2019,未解决的外部符号的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆