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

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

Open
richardhuo opened this issue Dec 12, 2021 · 7 comments

Comments

@richardhuo
Copy link

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

@richardhuo
Copy link
Author

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
Copy link
Author

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

@sngyai
Copy link
Owner

sngyai commented Dec 13, 2021

TA-Lib/ta-lib-python#241 应该是这个问题,可以参考一下哈

@richardhuo
Copy link
Author

richardhuo commented Dec 13, 2021 via email

@ktyang512
Copy link

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?

@mmk909
Copy link

mmk909 commented Jan 4, 2024

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 文件后,问题得以解决。

Repository owner deleted a comment from luangkhot Jan 31, 2024
@richardhuo
Copy link
Author

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

Repository owner deleted a comment from mkproject-admin Feb 21, 2024
@github-staff github-staff deleted a comment Sep 3, 2024
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

6 participants
@sngyai @richardhuo @mmk909 @ktyang512 and others