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

VS 2015 pro 下,cpp_infer编译不过 #1023

Closed
MikeDai2020 opened this issue Oct 27, 2020 · 8 comments
Closed

VS 2015 pro 下,cpp_infer编译不过 #1023

MikeDai2020 opened this issue Oct 27, 2020 · 8 comments

Comments

@MikeDai2020
Copy link

1>LINK : warning LNK4098: defaultlib 'LIBCMTD' conflicts with use of other libs; use /NODEFAULTLIB:library
1>libcpmtd.lib(locale.obj) : error LNK2001: unresolved external symbol _calloc_dbg
1>libcpmtd.lib(wlocale.obj) : error LNK2001: unresolved external symbol _calloc_dbg
1>libcpmtd.lib(xlocale.obj) : error LNK2001: unresolved external symbol _calloc_dbg
1>clipper.obj : error LNK2001: unresolved external symbol _calloc_dbg
1>main.obj : error LNK2001: unresolved external symbol _calloc_dbg
1>ocr_rec.obj : error LNK2001: unresolved external symbol _calloc_dbg
1>libcpmtd.lib(_tolower.obj) : error LNK2001: unresolved external symbol _calloc_dbg
1>libcpmtd.lib(xwcsxfrm.obj) : error LNK2001: unresolved external symbol _free_dbg
1>libcpmtd.lib(StlCompareStringA.obj) : error LNK2001: unresolved external symbol _free_dbg
1>libcpmtd.lib(StlLCMapStringA.obj) : error LNK2001: unresolved external symbol _free_dbg
1>libcpmtd.lib(locale.obj) : error LNK2001: unresolved external symbol _free_dbg
1>libcpmtd.lib(wlocale.obj) : error LNK2001: unresolved external symbol _free_dbg
1>libcpmtd.lib(xlocale.obj) : error LNK2001: unresolved external symbol _free_dbg
1>utility.obj : error LNK2001: unresolved external symbol _free_dbg
1>libcpmtd.lib(locale0.obj) : error LNK2001: unresolved external symbol _free_dbg
1>libcpmtd.lib(cout.obj) : error LNK2001: unresolved external symbol _free_dbg
1>libcpmtd.lib(cerr.obj) : error LNK2001: unresolved external symbol _free_dbg
1>clipper.obj : error LNK2001: unresolved external symbol _free_dbg
1>config.obj : error LNK2001: unresolved external symbol _free_dbg
1>main.obj : error LNK2001: unresolved external symbol _free_dbg
1>ocr_rec.obj : error LNK2001: unresolved external symbol _free_dbg
1>libcpmtd.lib(xwcsxfrm.obj) : error LNK2001: unresolved external symbol _malloc_dbg
1>libcpmtd.lib(StlCompareStringA.obj) : error LNK2001: unresolved external symbol _malloc_dbg
1>libcpmtd.lib(StlLCMapStringA.obj) : error LNK2001: unresolved external symbol _malloc_dbg
1>libcpmtd.lib(locale.obj) : error LNK2001: unresolved external symbol _malloc_dbg
1>libcpmtd.lib(wlocale.obj) : error LNK2001: unresolved external symbol _malloc_dbg
1>libcpmtd.lib(xlocale.obj) : error LNK2001: unresolved external symbol _malloc_dbg
1>utility.obj : error LNK2001: unresolved external symbol _malloc_dbg
1>libcpmtd.lib(locale0.obj) : error LNK2001: unresolved external symbol _malloc_dbg
1>libcpmtd.lib(cout.obj) : error LNK2001: unresolved external symbol _malloc_dbg
1>libcpmtd.lib(cerr.obj) : error LNK2001: unresolved external symbol _malloc_dbg
1>clipper.obj : error LNK2001: unresolved external symbol _malloc_dbg
1>config.obj : error LNK2001: unresolved external symbol _malloc_dbg
1>main.obj : error LNK2001: unresolved external symbol _malloc_dbg
1>ocr_rec.obj : error LNK2001: unresolved external symbol _malloc_dbg
1>libcpmtd.lib(xlocale.obj) : error LNK2019: unresolved external symbol _CrtDbgReportW referenced in function "void * __cdecl std::_Allocate(unsigned __int64,unsigned __int64,bool)" (?_Allocate@std@@YAPEAX_K0_N@Z)
1>libcpmtd.lib(xmbtowc.obj) : error LNK2001: unresolved external symbol _CrtDbgReportW
1>libcpmtd.lib(StlCompareStringA.obj) : error LNK2001: unresolved external symbol _CrtDbgReportW
1>libcpmtd.lib(cerr.obj) : error LNK2001: unresolved external symbol _CrtDbgReportW
1>libcpmtd.lib(StlLCMapStringA.obj) : error LNK2001: unresolved external symbol _CrtDbgReportW
1>libcpmtd.lib(locale.obj) : error LNK2001: unresolved external symbol _CrtDbgReportW
1>libcpmtd.lib(wlocale.obj) : error LNK2001: unresolved external symbol _CrtDbgReportW
1>utility.obj : error LNK2001: unresolved external symbol _CrtDbgReportW
1>libcpmtd.lib(stdthrow.obj) : error LNK2001: unresolved external symbol _CrtDbgReportW
1>libcpmtd.lib(syserror.obj) : error LNK2001: unresolved external symbol _CrtDbgReportW
1>libcpmtd.lib(cout.obj) : error LNK2001: unresolved external symbol _CrtDbgReportW
1>ocr_det.obj : error LNK2001: unresolved external symbol _CrtDbgReportW
1>ocr_rec.obj : error LNK2001: unresolved external symbol _CrtDbgReportW
1>postprocess_op.obj : error LNK2001: unresolved external symbol _CrtDbgReportW
1>preprocess_op.obj : error LNK2001: unresolved external symbol _CrtDbgReportW
1>clipper.obj : error LNK2001: unresolved external symbol _CrtDbgReportW
1>config.obj : error LNK2001: unresolved external symbol _CrtDbgReportW
1>main.obj : error LNK2001: unresolved external symbol _CrtDbgReportW
1>ocr_cls.obj : error LNK2001: unresolved external symbol _CrtDbgReportW
1>libcpmtd.lib(_tolower.obj) : error LNK2019: unresolved external symbol _wcsdup_dbg referenced in function _Getctype
1>libcpmtd.lib(xstrcoll.obj) : error LNK2001: unresolved external symbol _wcsdup_dbg
1>libcpmtd.lib(locale.obj) : error LNK2019: unresolved external symbol _realloc_dbg referenced in function "private: static void __cdecl std::locale::_Locimp::_Locimp_Addfac(class std::locale::_Locimp *,class std::locale::facet *,unsigned __int64)" (?_Locimp_Addfac@_Locimp@locale@std@@CAXPEAV123@PEAVfacet@23@_K@Z)
1>D:\python_pro\PaddleOCR\deploy\cpp_infer\Debug\ocr_system.exe : fatal error LNK1120: 6 unresolved externals

另外编译paddle,debug模式下也会出现链接错误,然而可以生成paddle_fluid.dll:
18>libprotobuf.lib(descriptor.pb.obj) : error LNK2038: mismatch detected for '_ITERATOR_DEBUG_LEVEL': value '0' doesn't match value '2' in executor.obj
18>libprotobuf.lib(descriptor.pb.obj) : error LNK2038: mismatch detected for 'RuntimeLibrary': value 'MT_StaticRelease' doesn't match value 'MTd_StaticDebug' in executor.obj
18>libprotobuf.lib(dynamic_message.obj) : error LNK2038: mismatch detected for '_ITERATOR_DEBUG_LEVEL': value '0' doesn't match value '2' in executor.obj
18>libprotobuf.lib(dynamic_message.obj) : error LNK2038: mismatch detected for 'RuntimeLibrary': value 'MT_StaticRelease' doesn't match value 'MTd_StaticDebug' in executor.obj
18>libprotobuf.lib(text_format.obj) : error LNK2038: mismatch detected for '_ITERATOR_DEBUG_LEVEL': value '0' doesn't match value '2' in executor.obj
18>libprotobuf.lib(text_format.obj) : error LNK2038: mismatch detected for 'RuntimeLibrary': value 'MT_StaticRelease' doesn't match value 'MTd_StaticDebug' in executor.obj
18>libprotobuf.lib(strtod.obj) : error LNK2038: mismatch detected for '_ITERATOR_DEBUG_LEVEL': value '0' doesn't match value '2' in executor.obj
18>libprotobuf.lib(strtod.obj) : error LNK2038: mismatch detected for 'RuntimeLibrary': value 'MT_StaticRelease' doesn't match value 'MTd_StaticDebug' in executor.obj
18>libprotobuf.lib(tokenizer.obj) : error LNK2038: mismatch detected for '_ITERATOR_DEBUG_LEVEL': value '0' doesn't match value '2' in executor.obj
18>libprotobuf.lib(tokenizer.obj) : error LNK2038: mismatch detected for 'RuntimeLibrary': value 'MT_StaticRelease' doesn't match value 'MTd_StaticDebug' in executor.obj
18>libprotobuf.lib(substitute.obj) : error LNK2038: mismatch detected for '_ITERATOR_DEBUG_LEVEL': value '0' doesn't match value '2' in executor.obj
18>libprotobuf.lib(substitute.obj) : error LNK2038: mismatch detected for 'RuntimeLibrary': value 'MT_StaticRelease' doesn't match value 'MTd_StaticDebug' in executor.obj
18>libprotobuf.lib(extension_set_heavy.obj) : error LNK2038: mismatch detected for '_ITERATOR_DEBUG_LEVEL': value '0' doesn't match value '2' in executor.obj
18>libprotobuf.lib(extension_set_heavy.obj) : error LNK2038: mismatch detected for 'RuntimeLibrary': value 'MT_StaticRelease' doesn't match value 'MTd_StaticDebug' in executor.obj
18>libprotobuf.lib(extension_set.obj) : error LNK2038: mismatch detected for '_ITERATOR_DEBUG_LEVEL': value '0' doesn't match value '2' in executor.obj
18>libprotobuf.lib(extension_set.obj) : error LNK2038: mismatch detected for 'RuntimeLibrary': value 'MT_StaticRelease' doesn't match value 'MTd_StaticDebug' in executor.obj
18>libprotobuf.lib(any.obj) : error LNK2038: mismatch detected for '_ITERATOR_DEBUG_LEVEL': value '0' doesn't match value '2' in executor.obj
18>libprotobuf.lib(any.obj) : error LNK2038: mismatch detected for 'RuntimeLibrary': value 'MT_StaticRelease' doesn't match value 'MTd_StaticDebug' in executor.obj
18>D:\cuda\Paddle\build\paddle\fluid\framework\Debug\paddle_framework.dll : fatal error LNK1319: 70 mismatches detected

@LDOUBLEV
Copy link
Collaborator

建议用VS2019

@MikeDai2020
Copy link
Author

@LDOUBLEV ,release版本下是可以编译过的,只不过debug模式下不过

@LDOUBLEV
Copy link
Collaborator

@LDOUBLEV ,release版本下是可以编译过的,只不过debug模式下不过

👍

@ybxbupt
Copy link

ybxbupt commented Nov 11, 2020

@LDOUBLEV ,release版本下是可以编译过的,只不过debug模式下不过

能否把你能运行识别的cpp版本在gitee上分享一下?

@lensea
Copy link

lensea commented Jan 26, 2021

image

@lensea
Copy link

lensea commented Jan 26, 2021

release 下改成多线程mt 可以编译程序。我想问下 md方式下怎么才能编译呢?因为其他的工程是md方式下的。

@smileformylove
Copy link

@lensea 请问解决了吗,遇到了同样的问题,其他工程时md的

@jakclisky
Copy link

我也遇到一样的问题

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

7 participants