写dll时出现2019错误,求救啊

while1988 2010-05-19 06:50:53
>------ Build started: Project: stmp, Configuration: Debug Win32 ------
1>Build started 2010/5/19 18:44:48.
1>InitializeBuildStatus:
1> Touching "Debug\stmp.unsuccessfulbuild".
1>ClCompile:
1> All outputs are up-to-date.
1>ManifestResourceCompile:
1> All outputs are up-to-date.
1>stmp.def(4): warning LNK4017: LIBRARY statement not supported for the target platform; ignored
1> Creating library C:\Users\ffg\Documents\Visual Studio 2010\Projects\stmp\Debug\stmp.lib and object C:\Users\ffg\Documents\Visual Studio 2010\Projects\stmp\Debug\stmp.exp
1>SMailer.obj : error LNK2019: unresolved external symbol __imp__connect@12 referenced in function "private: void __thiscall SMailer::MailSender::conn(void)" (?conn@MailSender@SMailer@@AAEXXZ)
1>SMailer.obj : error LNK2019: unresolved external symbol __imp__htons@4 referenced in function "private: void __thiscall SMailer::MailSender::conn(void)" (?conn@MailSender@SMailer@@AAEXXZ)
1>SMailer.obj : error LNK2019: unresolved external symbol __imp__socket@12 referenced in function "private: void __thiscall SMailer::MailSender::conn(void)" (?conn@MailSender@SMailer@@AAEXXZ)
1>SMailer.obj : error LNK2019: unresolved external symbol __imp__gethostbyname@4 referenced in function "private: void __thiscall SMailer::MailSender::conn(void)" (?conn@MailSender@SMailer@@AAEXXZ)
1>SMailer.obj : error LNK2019: unresolved external symbol __imp__gethostname@8 referenced in function "private: void __thiscall SMailer::MailSender::hello(void)" (?hello@MailSender@SMailer@@AAEXXZ)
1>SMailer.obj : error LNK2019: unresolved external symbol __imp__closesocket@4 referenced in function "private: void __thiscall SMailer::MailSender::quit(void)" (?quit@MailSender@SMailer@@AAEXXZ)
1>SMailer.obj : error LNK2019: unresolved external symbol __imp__recv@16 referenced in function "private: void __thiscall SMailer::MailSender::rcvResponse(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >)" (?rcvResponse@MailSender@SMailer@@AAEXV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@Z)
1>SMailer.obj : error LNK2019: unresolved external symbol __imp__send@16 referenced in function "private: void __thiscall SMailer::MailSender::sendRequest(enum SMailer::MailSender::Operaion,class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >)" (?sendRequest@MailSender@SMailer@@AAEXW4Operaion@12@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@Z)
1>C:\Users\ffg\Documents\Visual Studio 2010\Projects\stmp\Debug\stmp.dll : fatal error LNK1120: 8 unresolved externals
1>
1>Build FAILED.
1>
1>Time Elapsed 00:00:00.93
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
要怎么办啊
...全文
512 10 打赏 收藏 转发到动态 举报
写回复
用AI写文章
10 条回复
切换为时间正序
请发表友善的回复…
发表回复
snaker198904 2010-12-23
  • 打赏
  • 举报
回复
#pragma comment(lib,"wpcap.lib")
#pragma comment(lib,"ws2_32.lib")

应该加上与上面类似的东西,我今天遇到了就这样子解决得
bszANDdc 2010-10-29
  • 打赏
  • 举报
回复
[Quote=引用 8 楼 js_gary 的回复:]
引用 2 楼 while1988 的回复:
use32.lib我加了但加yours.lib出现
LINK : fatal error LNK1104: cannot open file 'yours.lib'


I don't know how to say!
[/Quote]

哈哈 楼主真的很单纯!!
  • 打赏
  • 举报
回复
[Quote=引用 2 楼 while1988 的回复:]
use32.lib我加了但加yours.lib出现
LINK : fatal error LNK1104: cannot open file 'yours.lib'
[/Quote]

I don't know how to say!
你妹的特盗不 2010-05-19
  • 打赏
  • 举报
回复
恭喜楼主
while1988 2010-05-19
  • 打赏
  • 举报
回复
终于找到了,要用wsock32.lib
while1988 2010-05-19
  • 打赏
  • 举报
回复
[Quote=引用 3 楼 schlafenhamster 的回复:]
关键是:1>stmp.def(4): warning LNK4017: LIBRARY statement not supported for the target platform; ignored
这一句。把它先搞掉
[/Quote]
搞掉了现在是这样
Creating library C:\Users\ffg\Documents\Visual Studio 2010\Projects\stmp\Debug\stmp.lib and object C:\Users\ffg\Documents\Visual Studio 2010\Projects\stmp\Debug\stmp.exp
1>SMailer.obj : error LNK2019: unresolved external symbol __imp__connect@12 referenced in function "private: void __thiscall SMailer::MailSender::conn(void)" (?conn@MailSender@SMailer@@AAEXXZ)
1>SMailer.obj : error LNK2019: unresolved external symbol __imp__htons@4 referenced in function "private: void __thiscall SMailer::MailSender::conn(void)" (?conn@MailSender@SMailer@@AAEXXZ)
1>SMailer.obj : error LNK2019: unresolved external symbol __imp__socket@12 referenced in function "private: void __thiscall SMailer::MailSender::conn(void)" (?conn@MailSender@SMailer@@AAEXXZ)
1>SMailer.obj : error LNK2019: unresolved external symbol __imp__gethostbyname@4 referenced in function "private: void __thiscall SMailer::MailSender::conn(void)" (?conn@MailSender@SMailer@@AAEXXZ)
1>SMailer.obj : error LNK2019: unresolved external symbol __imp__gethostname@8 referenced in function "private: void __thiscall SMailer::MailSender::hello(void)" (?hello@MailSender@SMailer@@AAEXXZ)
1>SMailer.obj : error LNK2019: unresolved external symbol __imp__closesocket@4 referenced in function "private: void __thiscall SMailer::MailSender::quit(void)" (?quit@MailSender@SMailer@@AAEXXZ)
1>SMailer.obj : error LNK2019: unresolved external symbol __imp__recv@16 referenced in function "private: void __thiscall SMailer::MailSender::rcvResponse(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >)" (?rcvResponse@MailSender@SMailer@@AAEXV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@Z)
1>SMailer.obj : error LNK2019: unresolved external symbol __imp__send@16 referenced in function "private: void __thiscall SMailer::MailSender::sendRequest(enum SMailer::MailSender::Operaion,class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >)" (?sendRequest@MailSender@SMailer@@AAEXW4Operaion@12@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@Z)
1>stmp.obj : error LNK2019: unresolved external symbol __imp__WSACleanup@0 referenced in function "public: __thiscall MUtils::WinSockHelper::WinSockHelper(void)" (??0WinSockHelper@MUtils@@QAE@XZ)
1>stmp.obj : error LNK2019: unresolved external symbol __imp__WSAStartup@8 referenced in function "public: __thiscall MUtils::WinSockHelper::WinSockHelper(void)" (??0WinSockHelper@MUtils@@QAE@XZ)
1>C:\Users\ffg\Documents\Visual Studio 2010\Projects\stmp\Debug\stmp.dll : fatal error LNK1120: 10 unresolved externals
尹成 2010-05-19
  • 打赏
  • 举报
回复
我也遇到过一样的错误,解决方法是:添加连接文件。先到msdn中查一下除了要include ca_mergex20.h以外还有没有要link的文件,如果有就点击菜单project->setting里的link页在object/library modules框中添加连接文件名,oleaut32.lib ole32.lib 把这两个LIB加进去。
另外不要忘了初始化COM,不然还要报错。
schlafenhamster 2010-05-19
  • 打赏
  • 举报
回复
关键是:1>stmp.def(4): warning LNK4017: LIBRARY statement not supported for the target platform; ignored
这一句。把它先搞掉
while1988 2010-05-19
  • 打赏
  • 举报
回复
use32.lib我加了但加yours.lib出现
LINK : fatal error LNK1104: cannot open file 'yours.lib'
redsunxin 2010-05-19
  • 打赏
  • 举报
回复
link error ,是不是某个lib没引用啊,
#pragma comment(lib,"yours.lib")
加上看看

15,471

社区成员

发帖
与我相关
我的任务
社区描述
VC/MFC 进程/线程/DLL
社区管理员
  • 进程/线程/DLL社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧