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

Windows 10: gmake fails with: make (e=2): The system cannot find the file specified. #166

Open
hakonhagland opened this issue Jun 13, 2021 · 8 comments

Comments

@hakonhagland
Copy link
Contributor

On Windows 10, raku version 2021.05, Strawberry perl version 5.30.1 : After applying the fix in #165,

> raku configure.pl6
> gmake
cl -Wall p5helper.c   -s -L"C:\STRAWB~1\perl\lib\CORE" -L"C:\STRAWB~1\c\lib"  "C:\STRAWB~1\perl\lib\CORE\libperl530.a" "C:\STRAWB~1\c\x86_64-w64-mingw32\lib\libmoldname.a" "C:\STRAWB~1\c\x86_64-w64-mingw32\lib\libkernel32.a" "C:\STRAWB~1\c\x86_64-w64-mingw32\lib\libuser32.a" "C:\STRAWB~1\c\x86_64-w64-mingw32\lib\libgdi32.a" "C:\STRAWB~1\c\x86_64-w64-mingw32\lib\libwinspool.a" "C:\STRAWB~1\c\x86_64-w64-mingw32\lib\libcomdlg32.a" "C:\STRAWB~1\c\x86_64-w64-mingw32\lib\libadvapi32.a" "C:\STRAWB~1\c\x86_64-w64-mingw32\lib\libshell32.a" "C:\STRAWB~1\c\x86_64-w64-mingw32\lib\libole32.a" "C:\STRAWB~1\c\x86_64-w64-mingw32\lib\liboleaut32.a" "C:\STRAWB~1\c\x86_64-w64-mingw32\lib\libnetapi32.a" "C:\STRAWB~1\c\x86_64-w64-mingw32\lib\libuuid.a" "C:\STRAWB~1\c\x86_64-w64-mingw32\lib\libws2_32.a" "C:\STRAWB~1\c\x86_64-w64-mingw32\lib\libmpr.a" "C:\STRAWB~1\c\x86_64-w64-mingw32\lib\libwinmm.a" "C:\STRAWB~1\c\x86_64-w64-mingw32\lib\libversion.a" "C:\STRAWB~1\c\x86_64-w64-mingw32\lib\libodbc32.a" "C:\STRAWB~1\c\x86_64-w64-mingw32\lib\libodbccp32.a" "C:\STRAWB~1\c\x86_64-w64-mingw32\lib\libcomctl32.a"  -s -O2 -DWIN32 -DWIN64 -DCONSERVATIVE -D__USE_MINGW_ANSI_STDIO -DPERL_TEXTMODE_SCRIPTS -DPERL_IMPLICIT_CONTEXT -DPERL_IMPLICIT_SYS -DUSE_PERLIO -fwrapv -fno-strict-aliasing -mms-bitfields  -I"C:\STRAWB~1\perl\lib\CORE"  -shared -o "resources\libraries\p5helper.dll" -fPIC -g
process_begin: CreateProcess(NULL, cl -Wall p5helper.c -s -LC:\STRAWB~1\perl\lib\CORE -LC:\STRAWB~1\c\lib C:\STRAWB~1\perl\lib\CORE\libperl530.a C:\STRAWB~1\c\x86_64-w64-mingw32\lib\libmoldname.a C:\STRAWB~1\c\x86_64-w64-mingw32\lib\libkernel32.a C:\STRAWB~1\c\x86_64-w64-mingw32\lib\libuser32.a C:\STRAWB~1\c\x86_64-w64-mingw32\lib\libgdi32.a C:\STRAWB~1\c\x86_64-w64-mingw32\lib\libwinspool.a C:\STRAWB~1\c\x86_64-w64-mingw32\lib\libcomdlg32.a C:\STRAWB~1\c\x86_64-w64-mingw32\lib\libadvapi32.a C:\STRAWB~1\c\x86_64-w64-mingw32\lib\libshell32.a C:\STRAWB~1\c\x86_64-w64-mingw32\lib\libole32.a C:\STRAWB~1\c\x86_64-w64-mingw32\lib\liboleaut32.a C:\STRAWB~1\c\x86_64-w64-mingw32\lib\libnetapi32.a C:\STRAWB~1\c\x86_64-w64-mingw32\lib\libuuid.a C:\STRAWB~1\c\x86_64-w64-mingw32\lib\libws2_32.a C:\STRAWB~1\c\x86_64-w64-mingw32\lib\libmpr.a C:\STRAWB~1\c\x86_64-w64-mingw32\lib\libwinmm.a C:\STRAWB~1\c\x86_64-w64-mingw32\lib\libversion.a C:\STRAWB~1\c\x86_64-w64-mingw32\lib\libodbc32.a C:\STRAWB~1\c\x86_64-w64-mingw32\lib\libodbccp32.a C:\STRAWB~1\c\x86_64-w64-mingw32\lib\libcomctl32.a -s -O2 -DWIN32 -DWIN64 -DCONSERVATIVE -D__USE_MINGW_ANSI_STDIO -DPERL_TEXTMODE_SCRIPTS -DPERL_IMPLICIT_CONTEXT -DPERL_IMPLICIT_SYS -DUSE_PERLIO -fwrapv -fno-strict-aliasing -mms-bitfields -IC:\STRAWB~1\perl\lib\CORE -shared -o resources\libraries\p5helper.dll -fPIC -g, ...) failed.
make (e=2): The system cannot find the file specified.
gmake: *** [Makefile:12: resources\libraries\p5helper.dll] Error 2
@hakonhagland
Copy link
Contributor Author

This seems to be caused by compiling with cl.exe instead of gcc.exe. If I change CC = cl to CC = gcc in the generated Makefile and then rerun gmake it compiles:

> gmake
gcc -Wall p5helper.c   -s -L"C:\STRAWB~1\perl\lib\CORE" -L"C:\STRAWB~1\c\lib"  "C:\STRAWB~1\perl\lib\CORE\libperl530.a" "C:\STRAWB~1\c\x86_64-w64-mingw32\lib\libmoldname.a" "C:\STRAWB~1\c\x86_64-w64-mingw32\lib\libkernel32.a" "C:\STRAWB~1\c\x86_64-w64-mingw32\lib\libuser32.a" "C:\STRAWB~1\c\x86_64-w64-mingw32\lib\libgdi32.a" "C:\STRAWB~1\c\x86_64-w64-mingw32\lib\libwinspool.a" "C:\STRAWB~1\c\x86_64-w64-mingw32\lib\libcomdlg32.a" "C:\STRAWB~1\c\x86_64-w64-mingw32\lib\libadvapi32.a" "C:\STRAWB~1\c\x86_64-w64-mingw32\lib\libshell32.a" "C:\STRAWB~1\c\x86_64-w64-mingw32\lib\libole32.a" "C:\STRAWB~1\c\x86_64-w64-mingw32\lib\liboleaut32.a" "C:\STRAWB~1\c\x86_64-w64-mingw32\lib\libnetapi32.a" "C:\STRAWB~1\c\x86_64-w64-mingw32\lib\libuuid.a" "C:\STRAWB~1\c\x86_64-w64-mingw32\lib\libws2_32.a" "C:\STRAWB~1\c\x86_64-w64-mingw32\lib\libmpr.a" "C:\STRAWB~1\c\x86_64-w64-mingw32\lib\libwinmm.a" "C:\STRAWB~1\c\x86_64-w64-mingw32\lib\libversion.a" "C:\STRAWB~1\c\x86_64-w64-mingw32\lib\libodbc32.a" "C:\STRAWB~1\c\x86_64-w64-mingw32\lib\libodbccp32.a" "C:\STRAWB~1\c\x86_64-w64-mingw32\lib\libcomctl32.a"  -s -O2 -DWIN32 -DWIN64 -DCONSERVATIVE -D__USE_MINGW_ANSI_STDIO -DPERL_TEXTMODE_SCRIPTS -DPERL_IMPLICIT_CONTEXT -DPERL_IMPLICIT_SYS -DUSE_PERLIO -fwrapv -fno-strict-aliasing -mms-bitfields  -I"C:\STRAWB~1\perl\lib\CORE"  -shared -o "resources\libraries\p5helper.dll" -fPIC -g
p5helper.c: In function 'p5_call_gv_two_args':
p5helper.c:1040:36: warning: format '%d' expects argument of type 'int', but argument 3 has type 'I32' {aka 'long int'} [-Wformat=]
             fprintf(stderr, "err: %d\n", *err);
                                   ~^     ~~~~
                                   %ld
p5helper.c: In function 'p5_scalar_call_gv_two_args':
p5helper.c:1078:36: warning: format '%d' expects argument of type 'int', but argument 3 has type 'I32' {aka 'long int'} [-Wformat=]
             fprintf(stderr, "err: %d\n", *err);
                                   ~^     ~~~~
                                   %ld


hakonhagland added a commit to hakonhagland/Inline-Perl5 that referenced this issue Jun 14, 2021
@niner
Copy link
Owner

niner commented Jul 4, 2021

How did you install Rakudo? Did you compile it yourself or did you use a precompiled package?

@Heptite
Copy link

Heptite commented Oct 16, 2022

I can confirm I had to change "cl" to "gcc" to get it to compile for me under Windows. I have Strawberry Perl installed and I installed Raku from an installer executable I found on the Raku website.

I still couldn't get Inline::Perl5 to install until I removed a couple of lines from one of the files involved in installing--I should've created a separate issue for it before I removed the cloned directory tree. Sorry.

@raiph
Copy link

raiph commented Oct 16, 2022

Pasting from @Heptite's reddit comment:

However, once I did get Inline::Perl5 installed, Tk fails to work under Windows. Once I run the MainLoop the program silently exits--it could be crashing, but I'm not sure how to tell.

I did try a couple of small Perl5 modules such as Digest::MD5 and they did work.

@Heptite Is that silently failing Raku code the same as what worked on Linux Mint?

@Heptite
Copy link

Heptite commented Oct 16, 2022

Yeah. I still plan on trying something more extensive using Tk with Inline::Perl5 under Mint to see whether I can get it to fail, but my main computer is Windows based so it will take me a little time.

@raiph
Copy link

raiph commented Oct 17, 2022

@Heptite

I still plan on trying something more extensive using Tk with Inline::Perl5

Putting that aside for now, please confirm (or correct) what I write below. TIA.

use Digest::MD5:from<Perl5>;
says md5_hex('abc');

Works on both your Linux Mint and Windows systems.

use Tk:from<Perl5>;
$top = Tk::MainWindow.new;
say 'OK1';
Tk::MainLoop;
say 'OK2';

Works on your Linux Mint system but says nothing, just silently failing on your Windows system.

@Heptite
Copy link

Heptite commented Oct 17, 2022

@Heptite

I still plan on trying something more extensive using Tk with Inline::Perl5

Putting that aside for now, please confirm (or correct) what I write below. TIA.

use Digest::MD5:from<Perl5>;
says md5_hex('abc');

Works on both your Linux Mint and Windows systems.

Yes.

use Tk:from<Perl5>;
$top = Tk::MainWindow.new;
say 'OK1';
Tk::MainLoop;
say 'OK2';

Works on your Linux Mint system but says nothing, just silently failing on your Windows system.

I have to add a "my" to the code to get it to compile, but that aside, it prints "OK1" on Windows, but fails to do anything else there; I assume it crashes at the point of trying to open a Tk toplevel window but I don't know how to tell.

On Mint it prints "OK1", opens a blank Tk toplevel window, and waits for me to close it before it then prints "OK2".

@Heptite
Copy link

Heptite commented Oct 17, 2022

Okay, I finally had a chance to try to build an actual Tk application using Inline::Perl5, but I get a crash when I try to create, for example, a button. I don't even have a chance to try to add the button to the toplevel window or anything. I just get an instant segfault.

So, in short, even simple Tk applications aren't possible even on Linux Mint.

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

4 participants