Sequoia icon indicating copy to clipboard operation
Sequoia copied to clipboard

编译ta-lib出错。 error LNK2001,感觉是VS2022版本太高,这个选择什么版本比较好?

Open richardhuo opened this issue 2 years ago • 8 comments

我觉得应该要降VS版本试试

richardhuo avatar Dec 12 '21 12:12 richardhuo

C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.29.30133\bin\HostX86\x64\link.exe /nologo /INCREMENTAL:NO /LTCG /DLL /MANIFEST:EMBED,ID=2 /MANIFESTUAC:NO /LIBPATH:c:\ta-lib\c\lib /LIBPATH:c:\users\richa\appdata\local\programs\python\python38\libs /LIBPATH:c:\users\richa\appdata\local\programs\python\python38\PCbuild\amd64 "/LIBPATH:C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.29.30133\ATLMFC\lib\x64" "/LIBPATH:C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.29.30133\lib\x64" "/LIBPATH:C:\Program Files (x86)\Windows Kits\NETFXSDK\4.8\lib\um\x64" "/LIBPATH:C:\Program Files (x86)\Windows Kits\10\lib\10.0.20348.0\ucrt\x64" "/LIBPATH:C:\Program Files (x86)\Windows Kits\10\lib\10.0.20348.0\um\x64" ta_libc_cdr.lib /EXPORT:PyInit__ta_lib build\temp.win-amd64-3.8\Release\talib/_ta_lib.obj /OUT:build\lib.win-amd64-3.8\talib\_ta_lib.cp38-win_amd64.pyd /IMPLIB:build\temp.win-amd64-3.8\Release\talib\_ta_lib.cp38-win_amd64.lib
  正在创建库 build\temp.win-amd64-3.8\Release\talib\_ta_lib.cp38-win_amd64.lib 和对象 build\temp.win-amd64-3.8\Release\talib\_ta_lib.cp38-win_amd64.exp
_ta_lib.obj : error LNK2001: 无法解析的外部符号 TA_CDLBREAKAWAY_Lookback
_ta_lib.obj : error LNK2001: 无法解析的外部符号 TA_CDLEVENINGSTAR
_ta_lib.obj : error LNK2001: 无法解析的外部符号 TA_CDLSEPARATINGLINES_Lookback
_ta_lib.obj : error LNK2001: 无法解析的外部符号 TA_CDLDRAGONFLYDOJI
_ta_lib.obj : error LNK2001: 无法解析的外部符号 TA_SetOptInputParamReal
_ta_lib.obj : error LNK2001: 无法解析的外部符号 TA_CDLMORNINGDOJISTAR_Lookback

; ; _ta_lib.obj : error LNK2001: 无法解析的外部符号 TA_GetVersionString build\lib.win-amd64-3.8\talib_ta_lib.cp38-win_amd64.pyd : fatal error LNK1120: 339 个无法解析的外部命令 error: command 'C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.29.30133\bin\HostX86\x64\link.exe' failed with exit status 1120 ---------------------------------------- ERROR: Command errored out with exit status 1: 'c:\users\richa\appdata\local\programs\python\python38\python.exe' -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\Users\richa\AppData\Local\Temp\pip-install-nerzog2w\ta-lib_ef2a66da96b7428c9d023ad55d994b2f\setup.py'"'"'; file='"'"'C:\Users\richa\AppData\Local\Temp\pip-install-nerzog2w\ta-lib_ef2a66da96b7428c9d023ad55d994b2f\setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(file) if os.path.exists(file) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, file, '"'"'exec'"'"'))' install --record 'C:\Users\richa\AppData\Local\Temp\pip-record-gmysnlm0\install-record.txt' --single-version-externally-managed --compile --install-headers 'c:\users\richa\appdata\local\programs\python\python38\Include\TA-Lib' Check the logs for full command output.

richardhuo avatar Dec 12 '21 14:12 richardhuo

VS 降版本到2019 community也是同样错误

richardhuo avatar Dec 12 '21 14:12 richardhuo

https://github.com/mrjbq7/ta-lib/issues/241 应该是这个问题,可以参考一下哈

sngyai avatar Dec 13 '21 06:12 sngyai

的确,重新 nmake 了一下就link 完成了。

非常感谢!

从 Windows 版邮件https://go.microsoft.com/fwlink/?LinkId=550986发送

发件人: @.> 发送时间: 2021年12月13日 14:06 收件人: @.> 抄送: @.>; @.> 主题: Re: [sngyai/Sequoia] 编译ta-lib出错。 error LNK2001,感觉是VS2022版本太高,这个选择什么版本比较好? (Issue #34)

mrjbq7/ta-lib#241https://github.com/mrjbq7/ta-lib/issues/241 应该是这个问题,可以参考一下哈

― You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://github.com/sngyai/Sequoia/issues/34#issuecomment-992137855, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AA3QY3RTSEQVBLVPAFKF3RLUQWEOJANCNFSM5J4GVKUA. Triage notifications on the go with GitHub Mobile for iOShttps://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Androidhttps://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

richardhuo avatar Dec 13 '21 13:12 richardhuo

Thanks for the above discussion. I'm facing the same problem and tried running nmake but ta-lib still can't be installed through pip method. So is there anything else I need to do?

ktyang512 avatar Oct 16 '23 07:10 ktyang512

looks like the ta-lib binding is basing on vs2015, so higher version may cause this problem, after using the .obj files build by old version, it was fixed. 看起来 TA-Lib 绑定是基于 VS2015 的,所以更高版本可能会引起这个问题,使用由旧版本构建的 .obj 文件后,问题得以解决。

mmk909 avatar Jan 04 '24 15:01 mmk909

talib installation instruction for linux:

  1. download talib source file, someting like ta-lib.x.x.tar.gz
  2. unzip the file: tar -xzf ta-lib.x.xtar.gz
  3. go to the unzip folder: cd ta-lib- ./configure make sudo make install

python setup.py install

richardhuo avatar Feb 16 '24 10:02 richardhuo