Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Windows MSYS2 and TEA extensions

68 views
Skip to first unread message

Luc Moulinier

unread,
Jul 31, 2018, 10:00:38 AM7/31/18
to
Dear All, at least whose still working despite this hot summer ...

I have to make some 32- and 64-bits compilations on Windows, so I installed MSYS2. I first compiled Tcl/Tk 8.6.7 without any problem.

I now want to compile TEA extensions. I'm training using the >sampleextension<. However it doesn't work.

1) Using TclTk compiled with MSYS2 :
./configure --with-tcl=/c/TclTk8.6.7/lib
make clean ; make
gcc -shared -o sample05.dll sample.o tclsample.o "/c/TclTk8.6.7/lib/libtclstub86.a" -static-libgcc

C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/7.3.0/../..//../x86_64-w64-mingw32/bin/ld.exe: tclsample.o:tclsample.c:(.tex0xb15): undefined reference to `Tcl_InitStubs'

Note that /c/TclTk8.6.7/lib/libtclstub86.a does exist.

2) Using ActiveState :
./configure --with-tcl=/c/ActiveTcl/lib
make clean ; make
gcc -shared -o sample05.dll sample.o tclsample.o "/c/ActiveTcl/lib/tclstub86.lib" -static-libgcc

C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/7.3.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:/ActiveTcl/lib/tclstub86.lib: error adding symbols: file format not recognized

Again, /c/ActiveTcl/lib/tclstub86.lib does exist.

Any idea ?
Thanks in advance !
Luc

Christian Gollwitzer

unread,
Jul 31, 2018, 10:29:15 AM7/31/18
to
Am 31.07.18 um 16:00 schrieb Luc Moulinier:
> I have to make some 32- and 64-bits compilations on Windows, so I installed MSYS2. I first compiled Tcl/Tk 8.6.7 without any problem.
>
> I now want to compile TEA extensions. I'm training using the >sampleextension<. However it doesn't work.
>
> 1) Using TclTk compiled with MSYS2 :
> ./configure --with-tcl=/c/TclTk8.6.7/lib
> make clean ; make
> gcc -shared -o sample05.dll sample.o tclsample.o "/c/TclTk8.6.7/lib/libtclstub86.a" -static-libgcc
>
> C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/7.3.0/../..//../x86_64-w64-mingw32/bin/ld.exe: tclsample.o:tclsample.c:(.tex0xb15): undefined reference to `Tcl_InitStubs'
>
> Note that /c/TclTk8.6.7/lib/libtclstub86.a does exist.

Seems like a 32/64 bit mismatch to me. You can check it with the "file"
command, it should tell you on the .o and .a files, which platform they
were made for.

Christian

Brad Lanam

unread,
Jul 31, 2018, 10:49:22 AM7/31/18
to
Double check to make sure *sample.o were compiled with the -fPIC flag.
And with -DUSE_TCL_STUBS.

I have the equivalent of:
-L/c/TclTk8.6.7/lib -ltclstub86
rather than specifying the .a file.
I also pass the -m64 or -m32 flag to gcc (both for compile and link) to make sure I am getting the correct mode.

Luis Alejandro Muzzachiodi

unread,
Jul 31, 2018, 5:59:31 PM7/31/18
to

Georgios Petasis

unread,
Aug 1, 2018, 9:53:19 AM8/1/18
to
Just out of curiosity, does tkdnd build in your setting?
I have spent so much time in the build system, and it has been tested
with msys2 with both gcc and visual studio (through msys2).
If it works in your setting, you can re-use its configure.ac

(There is also a helper: tclsh tcl-conf)

George

Paul Obermeier

unread,
Aug 1, 2018, 2:25:08 PM8/1/18
to
Hi Luc,

you might try my BAWT framework at http://www.bawt.tcl3d.org.

It has everything needed to compile Tcl/Tk and Tcl extensions using the
MSys/MinGW combination.

If you do not want to use the framework itself, you can just download
one of the MSys/MinGW packages from the download page
http://www.bawt.tcl3d.org/download.html.

Note also, that the BAWT manual contains a chapter (#8) on how to setup
MSys/MinGW on your own, see
http://www.bawt.tcl3d.org/download/BawtManual-0.8.0.pdf

Best regards,
Paul
0 new messages