gpt4 book ai didi

c++ - VS2010如何搭建Interactive Brokers API C++测试socket客户端

转载 作者:塔克拉玛干 更新时间:2023-11-03 06:57:22 27 4
gpt4 key购买 nike

已按照此处给出的说明进行操作 http://www.interactivebrokers.com/php/apiUsersGuide/apiguide.htm#apiguide/c/using_the_c__testsocketclient_sample_program.htm在 Visual Studio Professional 2010 下,c++ 项目总是给出以下输出:

1>  Generating Code...
1>LIBCMT.lib(invarg.obj) : error LNK2005: __initp_misc_invarg already defined in libcmtd.lib(invarg.obj)
1>LIBCMT.lib(invarg.obj) : error LNK2005: __call_reportfault already defined in libcmtd.lib(invarg.obj)
1>LIBCMT.lib(invarg.obj) : error LNK2005: __set_invalid_parameter_handler already defined in libcmtd.lib(invarg.obj)
1>LIBCMT.lib(invarg.obj) : error LNK2005: __get_invalid_parameter_handler already defined in libcmtd.lib(invarg.obj)
1>LIBCMT.lib(invarg.obj) : error LNK2005: __invoke_watson already defined in libcmtd.lib(invarg.obj)
1>LIBCMT.lib(invarg.obj) : error LNK2005: "void __cdecl _invoke_watson(unsigned short const *,unsigned short const *,unsigned short const *,unsigned int,unsigned int)" (?_invoke_watson@@YAXPBG00II@Z) already defined in libcmtd.lib(invarg.obj)
1>LIBCMT.lib(invarg.obj) : error LNK2005: __invalid_parameter already defined in libcmtd.lib(invarg.obj)
1>LIBCMT.lib(invarg.obj) : error LNK2005: "void __cdecl _invalid_parameter(unsigned short const *,unsigned short const *,unsigned short const *,unsigned int,unsigned int)" (?_invalid_parameter@@YAXPBG00II@Z) already defined in libcmtd.lib(invarg.obj)
1>LIBCMT.lib(invarg.obj) : error LNK2005: ___pInvalidArgHandler already defined in libcmtd.lib(invarg.obj)
1> Creating library C:\Syncing\VCPlusPlus\IBTestSocketClientVS2010\Debug\SampleSocketClient.lib and object C:\Syncing\VCPlusPlus\IBTestSocketClientVS2010\Debug\SampleSocketClient.exp
1>LINK : warning LNK4098: defaultlib 'LIBCMT' conflicts with use of other libs; use /NODEFAULTLIB:library
1>C:\Syncing\VCPlusPlus\IBTestSocketClientVS2010\Debug\SampleSocketClient.exe : fatal error LNK1169: one or more multiply defined symbols found
1>
1>Build FAILED.
1>
1>Time Elapsed 00:01:30.63
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========

如果有人有这方面的经验或了解如何修复此错误,将不胜感激!

最佳答案

我想我已经为您找到了答案。我遵循了错误 LNK2005 描述的指示,它表明幕后发生了一些双重链接。

您唯一需要做的就是更改项目配置的属性:

Properties->Linker->Input->Ignore Specific Default Libraries

在这里,您应该设置您想忽略的库,即 libcmt.lib。设置完成后,您应该会看到Ignore Specific Default Libraries 的值是:

libcmt.lib;%(IgnoreSpecificDefaultLibraries)

然后构建,binggo~~~~请尝试一下。

关于c++ - VS2010如何搭建Interactive Brokers API C++测试socket客户端,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7875586/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com