AndyObtiva / glimmer-dsl-tk

Glimmer DSL for Tk (Ruby Tk Desktop Development GUI Library)
MIT License
30 stars 5 forks source link

Compilation on Windows fails : missing development tools #8

Closed badal closed 3 years ago

badal commented 3 years ago

On Windows 64 bits Installation fails. Missing development tools. mkmf.log says: "gcc -o conftest.exe -IC:/Ruby30/include/ruby-3.0.0/x64-mingw32 -IC:/Ruby30/include/ruby-3.0.0/ruby/backward -IC:/Ruby30/include/ruby-3.0.0 -I. -DUSE_MINGW_ANSI_STDIO=1 -DFD_SETSIZE=2048 -D_WIN32_WINNT=0x0600 -DMINGW_USE_VC2005_COMPAT -D_FILE_OFFSET_BITS=64 -O3 -fno-fast-math -fstack-protector-strong conftest.c -L. -LC:/Ruby30/lib -L. -pipe -s -fstack-protector-strong -m64 -lx64-msvcrt-ruby300 -lshell32 -lws2_32 -liphlpapi -limagehlp -lshlwapi " checked program was: / begin / 1: #include "ruby.h" 2: 3: #include 4: #include 5: int main(int argc, char *argv) 6: { 7: return !!argv[argc]; 8: } / end */

AndyObtiva commented 3 years ago

I do not use Tk on Windows through compilation of Ruby.

Instead, I follow the instructions over here: https://tkdocs.com/tutorial/install.html

Specifically, the following:

Please let me know if that works for you.

If you insist on compilation, then I am sorry, but this would not be my project's concern, yet the concern of the Ruby project. Let me know if that is what you prefer so that I'd close this ticket while advising you to open a ticket in ruby/ruby instead. Otherwise, I would look forward to hearing how the instructions above work out for you.

Cheers.

badal commented 3 years ago

Thanks for the fast answer. Yes I did what you wrote.

And 'gem install qt' fails. Visibly, MSYS needs some extra ---with- ... . I tried to add tcl and tk lib and include directories 👍

gem install tk -- \ --with-tcltkversion="$latest_version" \ --with-tcl-lib="C:\ActiveTcl\lib" \ --with-tk-lib="C:\ActiveTcl\lib" \ --with-tcl-include="C:\ActiveTcl\include" \ --with-tk-include="C:\ActiveTcl\include"

But nothing changed.

It has nothing to do with 'glimmer' itself, but only with 'tk'.

Such troubles are quite common with MSYS compiling. (This is under ruby3).

So you may close the ticket. Cheers, badal

AndyObtiva commented 3 years ago

If you follow the instructions I recommended for Windows, you would not need to add "--with-tcl-include" and "--with-tk-include" when installing the tk gem, yet only gem install tk. That is because it assumes you followed the previous steps relating to copying tcl86t.dll and tk86t.dll to "C:\RubyPath\bin" and setup of environment variables TCL_LIBRARY=C:\ActiveTcl\lib\tcl8.6 & TK_LIBRARY=C:\ActiveTcl\lib\tk8.6 (you do that in Windows from the Control Panel -> System Properties -> Advanced tab). By the way, I do have Tk working in Windows 10 x64 with Ruby 3.0.2. So, it is definitely possible.

badal commented 3 years ago

Yes, both dll are in C:\Ruby30\bin. Yes, both environment variables are set. ... SystemRoot=C:\WINDOWS TCL_LIBRARY=C:\ActiveTcl\lib\tcl8.6 TEMP=C:\Users\Michel\AppData\Local\Temp TK_LIBRARY=C:\ActiveTcl\lib\tk8.6 TMP=C:\Users\Michel\AppData\Local\Temp ... And, yes, 'gem install tk' fails, with the same diagnostic :

C:/Ruby30/lib/ruby/3.0.0/mkmf.rb:471:in `try_do': The compiler failed to generate an executable file. (RuntimeError) You have to install development tools first.

There is not the first time I see a file ***.h missing.

AndyObtiva commented 3 years ago

OK, perhaps you could also try the newer Ruby 3.0.2 x64. If you do, I would recommend you uninstall and delete Ruby 3.0.0 completely if possible and then install the version of Ruby+Devkit 3.0.2 x64 from https://rubyinstaller.org/downloads/ not the vanilla one without devkit.

badal commented 3 years ago

Yes, I just saw there exists a problem since two days ago in the PGP signatures.µ

I'll do that and report.

AndyObtiva commented 3 years ago

BTW, when installing Ruby+Devkit, it usually asks you to run a command in the end to setup MSYS and MINGW (giving 3 options of installation when run), I would follow/install all options one by one.

badal commented 3 years ago

WORKS !

There was an error in the PGP keyring in MSYS2. Many thanks for your patience ! Best wishes for glimmer !!!