MinGW 没有 libtclstub.a 和 libtkstub.a 库,因此 TCL 不会编译

MinGW doesn't have the libtclstub.a and libtkstub.a libraries so TCL won't compile

提问人:Zamyatin 提问时间:11/5/2023 更新时间:11/5/2023 访问量:39

问:

使用:Windows 10 64 位,在 Git Bash 上MINGW64。

我一直在尝试在 MinGW (https://sourceforge.net/projects/mingw/) 中编译一个 TCL 包(该包说要使用),但不包含 or ,因此无法编译该包。我是 MinGW 的新手,不知道如何添加它们。C:\MinGW\liblibtclstub.alibtkstub.a

当我在 Git Bash 中运行时,它只是打印:../configure

css.o:css.c:(.text+0x11): undefined reference to `tclStubsPtr'
css.o:css.c:(.text+0xcf): more undefined references to `tclStubsPtr' follow
htmldraw.o:htmldraw.c:(.text+0x965): undefined reference to `tkStubsPtr'
htmldraw.o:htmldraw.c:(.text+0x9bb): undefined reference to `tkIntXlibStubsPtr'
htmldraw.o:htmldraw.c:(.text+0x9cc): undefined reference to `tkStubsPtr'
htmldraw.o:htmldraw.c:(.text+0xab2): undefined reference to `tkStubsPtr'
htmldraw.o:htmldraw.c:(.text+0xc2b): undefined reference to `tkStubsPtr'
htmldraw.o:htmldraw.c:(.text+0xc89): undefined reference to `tkIntXlibStubsPtr'
htmldraw.o:htmldraw.c:(.text+0xc9b): undefined reference to `tkStubsPtr'
htmldraw.o:htmldraw.c:(.text+0xe22): undefined reference to `tclStubsPtr'
htmldraw.o:htmldraw.c:(.text+0xef6): undefined reference to `tclStubsPtr'
htmldraw.o:htmldraw.c:(.text+0xf08): undefined reference to `tclStubsPtr'
htmldraw.o:htmldraw.c:(.text+0xf44): undefined reference to `tkStubsPtr'
htmldraw.o:htmldraw.c:(.text+0xf8b): undefined reference to `tkIntXlibStubsPtr'
htmldraw.o:htmldraw.c:(.text+0xff7): undefined reference to `tkStubsPtr'
htmldraw.o:htmldraw.c:(.text+0x1030): undefined reference to `tkStubsPtr'
htmldraw.o:htmldraw.c:(.text+0x1088): undefined reference to `tkIntXlibStubsPtr'
htmldraw.o:htmldraw.c:(.text+0x1093): undefined reference to `tkStubsPtr'
htmldraw.o:htmldraw.c:(.text+0x12fd): undefined reference to `tkStubsPtr'
htmldraw.o:htmldraw.c:(.text+0x1388): undefined reference to `tkStubsPtr'
htmldraw.o:htmldraw.c:(.text+0x1408): undefined reference to `tclStubsPtr'
htmldraw.o:htmldraw.c:(.text+0x15e3): more undefined references to `tclStubsPtr' follow
htmldraw.o:htmldraw.c:(.text+0x19cf): undefined reference to `tkStubsPtr'
htmldraw.o:htmldraw.c:(.text+0x1a3b): undefined reference to `tkIntXlibStubsPtr'
htmldraw.o:htmldraw.c:(.text+0x1a50): undefined reference to `tkStubsPtr'
htmldraw.o:htmldraw.c:(.text+0x1b58): undefined reference to `tkStubsPtr'
htmldraw.o:htmldraw.c:(.text+0x2033): undefined reference to `tclStubsPtr'
htmldraw.o:htmldraw.c:(.text+0x275b): undefined reference to `tkStubsPtr'
htmldraw.o:htmldraw.c:(.text+0x2787): undefined reference to `tkStubsPtr'
htmldraw.o:htmldraw.c:(.text+0x27ed): undefined reference to `tkStubsPtr'
htmldraw.o:htmldraw.c:(.text+0x27f8): undefined reference to `tkStubsPtr'
htmldraw.o:htmldraw.c:(.text+0x287c): undefined reference to `tkStubsPtr'
htmldraw.o:htmldraw.c:(.text+0x28bd): undefined reference to `tkIntXlibStubsPtr'
htmldraw.o:htmldraw.c:(.text+0x28cc): undefined reference to `tkStubsPtr'
htmldraw.o:htmldraw.c:(.text+0x2a00): more undefined references to `tkStubsPtr' follow
htmldraw.o:htmldraw.c:(.text+0x310b): undefined reference to `tclStubsPtr'
htmldraw.o:htmldraw.c:(.text+0x3b85): more undefined references to `tclStubsPtr' follow
htmldraw.o:htmldraw.c:(.text+0x49ef): undefined reference to `tkStubsPtr'
htmldraw.o:htmldraw.c:(.text+0x4a37): undefined reference to `tkIntXlibStubsPtr'
htmldraw.o:htmldraw.c:(.text+0x4a93): undefined reference to `tclStubsPtr'
htmldraw.o:htmldraw.c:(.text+0x4c0a): more undefined references to `tclStubsPtr' follow
htmldraw.o:htmldraw.c:(.text+0x4cd9): undefined reference to `tkStubsPtr'
htmldraw.o:htmldraw.c:(.text+0x4e0f): undefined reference to `tclStubsPtr'
htmldraw.o:htmldraw.c:(.text+0x4e38): more undefined references to `tclStubsPtr' follow
htmldraw.o:htmldraw.c:(.text+0x55c4): undefined reference to `tkStubsPtr'
htmldraw.o:htmldraw.c:(.text+0x55d5): undefined reference to `tkStubsPtr'
htmldraw.o:htmldraw.c:(.text+0x566a): undefined reference to `tkStubsPtr'
htmldraw.o:htmldraw.c:(.text+0x5754): undefined reference to `tkStubsPtr'
htmldraw.o:htmldraw.c:(.text+0x57b8): undefined reference to `tkIntXlibStubsPtr'
htmldraw.o:htmldraw.c:(.text+0x5847): undefined reference to `tkStubsPtr'
htmldraw.o:htmldraw.c:(.text+0x58d7): more undefined references to `tkStubsPtr' follow
[etc...]
collect2.exe: error: ld returned 1 exit status
make: *** [Makefile:273: libTkhtml3.0] Error 1

我尝试从 https://github.com/git-for-windows/git-sdk-64/blob/main/mingw32/lib/libtclstub86.a 下载和下载(TK 相同),并将它们添加到 ,但随后得到:libtclstub.alibtkstub.aC:\MinGW\lib

c:/mingw/bin/../lib/gcc/mingw32/6.3.0/../../../libtclstub86.a(tclStubLib.o):(.text+0x18): undefined reference to `__stack_chk_guard'
c:/mingw/bin/../lib/gcc/mingw32/6.3.0/../../../libtclstub86.a(tclStubLib.o):(.text+0xfa): undefined reference to `__stack_chk_guard'
c:/mingw/bin/../lib/gcc/mingw32/6.3.0/../../../libtclstub86.a(tclStubLib.o):(.text+0x1b2): undefined reference to `__stack_chk_fail'
c:/mingw/bin/../lib/gcc/mingw32/6.3.0/../../../libtkstub86.a(tkStubLib.o):(.text+0x8): undefined reference to `__stack_chk_guard'
c:/mingw/bin/../lib/gcc/mingw32/6.3.0/../../../libtkstub86.a(tkStubLib.o):(.text+0x106): undefined reference to `__stack_chk_guard'
c:/mingw/bin/../lib/gcc/mingw32/6.3.0/../../../libtkstub86.a(tkStubLib.o):(.text+0x21a): undefined reference to `__stack_chk_fail'
collect2.exe: error: ld returned 1 exit status
make: *** [Makefile:273: libTkhtml3.0] Error 1

我想我还没有安装我应该拥有的东西,但我不完全确定那是什么,也不知道如何安装它。可能还有其他我不知道的文件,尽管这些文件可以与存根库一起安装。

C TCL TK-工具包 明格-W64

评论

1赞 thurizas 11/5/2023
libtclstub.a 和 libtkstub.a 都应该来自 TCL/Tk(工具命令语言/工具包),您可以通过 mingw64 和/或 msys2 附带的软件包管理器安装 tcl 和 tk(我假设您已经安装了这两个)。如果做不到这一点,您可以随时下载 tcl/tk 源码包(参见 tcl.tk/software/tcltk/download.html)并从源代码构建——尽管我敢打赌,这会出现更多缺失的库/依赖项。
0赞 Zamyatin 11/6/2023
@thurizas我已经能够使用“MinGW Installation Manager”来安装 和 ,但是编译器输出的文件在应该是文件时是“苍蝇”,并且只有(大约)它应该是的一半大小。C:\MinGW\libexec\mingw-get\guimainmingw32-tclmingw32-tk.0.dll
0赞 thurizas 11/6/2023
使用 gcc(或 mingw)编译共享库时,命令行比 .例如,将文件编译为目标文件后,可以使用类似 请参阅 ttps://www.transmissionzero.co.uk/computing/building-dlls-with-mingw/ 以获取更多信息和完整示例的命令。我不使用 VS Code,所以我不知道如何配置它的编译任务以实际生成一个动态库。gcc test.c -o testgcc -c test.c -o test.ogcc -o test.dll test.o -s -shared -Wl,--subsystem,windows

答: 暂无答案