Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Using VS2013+OPENCV3.1.0 compile this,will error: >main.obj : error LNK2019: 无法解析的外部符号 "void __cdecl cv::fastFree(void *)" (?fastFree@cv@@YAXPAX@Z),该符号在函数 "public: __thiscall cv::Mat::~Mat(void)" (??1Mat@cv@@QAE@XZ) 中被引用 #10

Closed
angelanf5 opened this issue Jul 24, 2016 · 1 comment

Comments

@angelanf5
Copy link

configuration list:
VS2013
PC win7x64
opencv 3.1.0
boost boost_1_61_0

i guess whether opencv 3.1 is too high, so it fails. is it ?
waiting for your help:) thank u!

vs2013 set: property--linker--input-- opencv_world310d.lib;%(AdditionalDependencies)
default

compile it ,it will:
1>------ 已启动全部重新生成: 项目: mnisten, 配置: Debug Win32 ------
1> main.cpp
1>d:\opencv\build\include\opencv2\core\mat.hpp(1965): warning C4819: 该文件包含不能在当前代码页(936)中表示的字符。请将该文件保存为 Unicode 格式以防止数据丢失
1>d:\opencv\build\include\opencv2\core\persistence.hpp : warning C4819: 该文件包含不能在当前代码页(936)中表示的字符。请将该文件保存为 Unicode 格式以防止数据丢失
1>d:\opencv\build\include\opencv2\core\utility.hpp : warning C4819: 该文件包含不能在当前代码页(936)中表示的字符。请将该文件保存为 Unicode 格式以防止数据丢失
1>k:\同步文件夹\桌面-angelanf5\mnisten-master\mnisten-master\include\cmdline.h(724): warning C4101: “e”: 未引用的局部变量
1> k:\同步文件夹\桌面-angelanf5\mnisten-master\mnisten-master\include\cmdline.h(719): 编译类 模板 成员函数“bool cmdline::parser::option_with_value::set(const std::string &)”时
1> with
1> [
1> T=std::string
1> ]
1> k:\同步文件夹\桌面-angelanf5\mnisten-master\mnisten-master\include\cmdline.h(365): 参见对正在编译的类 模板 实例化“cmdline::parser::option_with_value”的引用
1> with
1> [
1> T=std::string
1> ]
1> k:\同步文件夹\桌面-angelanf5\mnisten-master\mnisten-master\src\main.cpp(169): 参见对正在编译的函数 模板 实例化“const T &cmdline::parser::getstd::string(const std::string &) const”的引用
1> with
1> [
1> T=std::string
1> ]
1>main.obj : error LNK2019: 无法解析的外部符号 "void __cdecl cv::fastFree(void *)" (?fastFree@cv@@YAXPAX@Z),该符号在函数 "public: __thiscall cv::Mat::~Mat(void)" (??1Mat@cv@@QAE@XZ) 中被引用
1>main.obj : error LNK2019: 无法解析的外部符号 "private: char * __thiscall cv::String::allocate(unsigned int)" (?allocate@String@cv@@AAEPADI@Z),该符号在函数 "public: __thiscall cv::String::String(class std::basic_string<char,struct std::char_traits,class std::allocator > const &)" (??0String@cv@@QAE@ABV?$basic_string@DU?$char_traits@D@std@@v?$allocator@D@2@@std@@@z) 中被引用
1>main.obj : error LNK2019: 无法解析的外部符号 "private: void __thiscall cv::String::deallocate(void)" (?deallocate@String@cv@@AAEXXZ),该符号在函数 "public: __thiscall cv::String::~String(void)" (??1String@cv@@QAE@XZ) 中被引用
1>main.obj : error LNK2019: 无法解析的外部符号 "void _cdecl cv::error(int,class cv::String const &,char const *,char const *,int)" (?error@cv@@YAXHABVString@1@PBD1H@Z),该符号在函数 "public: class cv::MatIterator _thiscall cv::Mat::begin(void)" (??$begin@E@Mat@cv@@QAE?AV?$MatIterator@e@1@XZ) 中被引用
1>main.obj : error LNK2019: 无法解析的外部符号 "public: void __thiscall cv::Mat::deallocate(void)" (?deallocate@Mat@cv@@QAEXXZ),该符号在函数 "public: void __thiscall cv::Mat::release(void)" (?release@Mat@cv@@QAEXXZ) 中被引用
1>main.obj : error LNK2019: 无法解析的外部符号 "public: void __thiscall cv::Mat::copySize(class cv::Mat const &)" (?copySize@Mat@cv@@QAEXABV12@@z),该符号在函数 "public: __thiscall cv::Mat::Mat(class cv::Mat const &)" (??0Mat@cv@@QAE@ABV01@@z) 中被引用
1>main.obj : error LNK2019: 无法解析的外部符号 "public: void __thiscall cv::MatConstIterator::seek(int,bool)" (?seek@MatConstIterator@cv@@QAEXH_N@Z),该符号在函数 "public: class cv::MatConstIterator & __thiscall cv::MatConstIterator::operator++(void)" (??EMatConstIterator@cv@@QAEAAV01@XZ) 中被引用
1>main.obj : error LNK2019: 无法解析的外部符号 "public: void __thiscall cv::MatConstIterator::seek(int const *,bool)" (?seek@MatConstIterator@cv@@QAEXPBH_N@Z),该符号在函数 "public: __thiscall cv::MatConstIterator::MatConstIterator(class cv::Mat const *)" (??0MatConstIterator@cv@@QAE@PBVMat@1@@z) 中被引用
1>main.obj : error LNK2019: 无法解析的外部符号 "void __cdecl cv::resize(class cv::InputArray const &,class cv::OutputArray const &,class cv::Size,double,double,int)" (?resize@cv@@YAXABV_InputArray@1@ABV_OutputArray@1@V?$Size@h@1@NNH@Z),该符号在函数 "int __cdecl read_images(class boost::filesystem::path const &,unsigned char,class std::vector<struct image,class std::allocator > &,int,int)" (?read_images@@YAHABVpath@filesystem@boost@@EAAV?$vector@Uimage@@v?$allocator@Uimage@@@std@@@std@@hh@Z) 中被引用
1>main.obj : error LNK2019: 无法解析的外部符号 "class cv::Mat __cdecl cv::imread(class cv::String const &,int)" (?imread@cv@@ya?AVMat@1@ABVString@1@H@Z),该符号在函数 "int __cdecl read_images(class boost::filesystem::path const &,unsigned char,class std::vector<struct image,class std::allocator > &,int,int)" (?read_images@@YAHABVpath@filesystem@boost@@EAAV?$vector@Uimage@@v?$allocator@Uimage@@@std@@@std@@hh@Z) 中被引用
1>K:\同步文件夹\桌面-angelanf5\mnisten-master\mnisten-master\vc\Debug\mnisten.exe : fatal error LNK1120: 10 个无法解析的外部命令
========== 全部重新生成: 成功 0 个,失败 1 个,跳过 0 个 ==========

@angelanf5
Copy link
Author

angelanf5 commented Jul 24, 2016

I have solve it by myself.
the reason is that when on X64 PC to compile boost, i should use Native Tools Command Prompt X64 to build it . type these:"b2 --build-type=complete toolset=msvc-12.0 threading=multi link=static address-model=64 ".
then set some path in visual studio :boost_1_61_0\boost_1_61_0\stage\lib, boost_1_61_0\boost_1_61_0.
and type "libboost_filesystem-vc120-mt-sgd-1_61.lib" in property.
Set 项目属性->配置属性->C/C++->代码生成,选择“运行库”为“多线程 (/MT)”(如选择“多线程 DLL (/MD)”,则为动态链接 Boost 库)。(sorry , i use chinese at this)
And use X64 debug to compile it . it will success.
more information we can look at this link:
http://blog.csdn.net/gyy930324/article/details/51556694

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant