欲将transformer c++ demo 于windows系统下运行,做如下操作
1.下载或源码编译(vs2017)paddle预测库(paddle_inference.lib)
2.将https://github.com/PaddlePaddle/PaddleNLP/tree/develop/examples/machine_translation/transformer/deploy/cpp的demo移植到vs2017下
3.做了所有设置之后,执行生成命令,提示如下
错误 LNK1120 4 个无法解析的外部命令 transformer_e2e D:\paddle\PaddleNLP\cxx_server2\build\Release\transformer_e2e.exe 1
错误 LNK2019 无法解析的外部符号 "__declspec(dllimport) public: class std::basic_ostream<char,struct std::char_traits > & __cdecl std::basic_ostream<char,struct std::char_traits >::flush(void)" (_imp?flush@?$basic_ostream@DU?$char_traits@D@std@@@std@@QEAAAEAV12@XZ),该符号在函数 "class std::basic_ostream<char,struct std::char_traits > & __cdecl std::operator<<(class std::basic_ostream<char,struct std::char_traits > &,char const *)" (??$?6U?$char_traits@D@std@@@std@@YAAEAV?$basic_ostream@DU?$char_traits@D@std@@@0@AEAV10@PEBD@Z) 中被引用 transformer_e2e D:\paddle\PaddleNLP\cxx_server2\build\transformer_e2e.obj 1
错误 LNK2019 无法解析的外部符号 "__declspec(dllimport) public: class std::locale __cdecl std::basic_streambuf<char,struct std::char_traits >::getloc(void)const " (_imp?getloc@?$basic_streambuf@DU?$char_traits@D@std@@@std@@qeba?AVlocale@2@XZ),该符号在函数 "public: class std::basic_filebuf<char,struct std::char_traits > * __cdecl std::basic_filebuf<char,struct std::char_traits >::open(char const *,int,int)" (?open@?$basic_filebuf@DU?$char_traits@D@std@@@std@@QEAAPEAV12@PEBDHH@Z) 中被引用 transformer_e2e D:\paddle\PaddleNLP\cxx_server2\build\transformer_e2e.obj 1
错误 LNK2019 无法解析的外部符号 "__declspec(dllimport) public: int __cdecl std::basic_streambuf<char,struct std::char_traits >::snextc(void)" (_imp?snextc@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QEAAHXZ),该符号在函数 "class std::basic_istream<char,struct std::char_traits > & __cdecl std::getline<char,struct std::char_traits,class std::allocator >(class std::basic_istream<char,struct std::char_traits > &&,class std::basic_string<char,struct std::char_traits,class std::allocator > &,char)" (??$getline@DU?$char_traits@D@std@@v?$allocator@D@2@@std@@YAAEAV?$basic_istream@DU?$char_traits@D@std@@@0@$$QEAV10@AEAV?$basic_string@DU?$char_traits@D@std@@v?$allocator@D@2@@0@D@Z) 中被引用 transformer_e2e D:\paddle\PaddleNLP\cxx_server2\build\transformer_e2e.obj 1
错误 LNK2019 无法解析的外部符号 "__declspec(dllimport) public: __int64 __cdecl std::basic_streambuf<char,struct std::char_traits >::sputn(char const *,__int64)" (_imp?sputn@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QEAA_JPEBD_J@Z),该符号在函数 "class std::basic_ostream<char,struct std::char_traits > & __cdecl std::operator<<(class std::basic_ostream<char,struct std::char_traits > &,char const *)" (??$?6U?$char_traits@D@std@@@std@@YAAEAV?$basic_ostream@DU?$char_traits@D@std@@@0@AEAV10@PEBD@Z) 中被引用 transformer_e2e D:\paddle\PaddleNLP\cxx_server2\build\transformer_e2e.obj 1
请问怎么解决呢?谢谢!
2条答案
按热度按时间ss2ws0br1#
您好,我们已经收到了您的问题,会安排技术人员尽快解答您的问题,请耐心等待。请您再次检查是否提供了清晰的问题描述、复现代码、环境&版本、报错信息等。同时,您也可以通过查看官网API文档、常见问题、历史Issue、AI社区来寻求解答。祝您生活愉快~
Hi! We've received your issue and please be patient to get responded. We will arrange technicians to answer your questions as soon as possible. Please make sure that you have posted enough message to demo your request. You may also check out the API,FAQ,Github Issue and AI community to get the answer.Have a nice day!
57hvy0tb2#
您好,请参考windows预测部署示例进行设置,文档如下
https://paddle-inference.readthedocs.io/en/latest/demo_tutorial/x86_windows_demo.html
另可以检查下载文档:https://paddle-inference.readthedocs.io/en/latest/user_guides/download_lib.html#windows
查看下载库版本与下载的transformer c++ demo代码版本是否一致