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

Error while installing on Windows #4

Open
ricardosdl opened this issue Jul 30, 2019 · 4 comments
Open

Error while installing on Windows #4

ricardosdl opened this issue Jul 30, 2019 · 4 comments

Comments

@ricardosdl
Copy link

ricardosdl commented Jul 30, 2019

Hello!
I'm getting the error bellow when I try to install the lib on windows 10-64 bit, perl version:5.28.0 / MSWin32-x64-multi-thread, Strawberry Perl.

# Failed test 'xs'
# at t/init.t line 15.
#   ExtUtils::CBuilder->compile failed
#     error building xs.dll file from 'testalienpts0M/test.c' at C:/Users/ricardo/strawberry-perl-5.28.0.1-64bit-PDL/perl/lib/ExtUtils/CBuilder/Platform/Windows.pm line 128.
#     gcc -c -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:/Users/ricardo/STRAWB~1.1-6/data/.cpanm/work/1564450435.10880/Alien-raylib-0.023/blib/lib/auto/share/dist/Alien-raylib/include -s -O2 -I"C:\Users\ricardo\strawberry-perl-5.28.0.1-64bit-PDL\perl\lib\CORE" -I"C:\Users\ricardo\strawberry-perl-5.28.0.1-64bit-PDL\c\include" -o "testalienpts0M\test.o" "testalienpts0M\test.c"
#     In file included from testalienpts0M/test.xs:5:0:
#     C:/Users/ricardo/STRAWB~1.1-6/data/.cpanm/work/1564450435.10880/Alien-raylib-0.023/blib/lib/auto/share/dist/Alien-raylib/include/raylib.h:200:3: error: 'Rectangle' redeclared as different kind of symbol
#      } Rectangle;
#        ^~~~~~~~~
#     In file included from C:/Users/ricardo/strawberry-perl-5.28.0.1-64bit-PDL/c/x86_64-w64-mingw32/include/windows.h:71:0,
#                      from C:\Users\ricardo\strawberry-perl-5.28.0.1-64bit-PDL\perl\lib\CORE/win32.h:150,
#                      from C:\Users\ricardo\strawberry-perl-5.28.0.1-64bit-PDL\perl\lib\CORE/win32thread.h:4,
#                      from C:\Users\ricardo\strawberry-perl-5.28.0.1-64bit-PDL\perl\lib\CORE/perl.h:2906,
#                      from testalienpts0M/test.xs:3:
#     C:/Users/ricardo/strawberry-perl-5.28.0.1-64bit-PDL/c/x86_64-w64-mingw32/include/wingdi.h:3049:28: note: previous declaration of 'Rectangle' was here
#        WINGDIAPI WINBOOL WINAPI Rectangle(HDC hdc,int left,int top,int right,int bottom);
#                                 ^~~~~~~~~
#     In file included from testalienpts0M/test.xs:5:0:
#     C:/Users/ricardo/STRAWB~1.1-6/data/.cpanm/work/1564450435.10880/Alien-raylib-0.023/blib/lib/auto/share/dist/Alien-raylib/include/raylib.h:839:12: error: conflicting types for 'CloseWindow'
#      RLAPI void CloseWindow(void);                                     // Close window and unload OpenGL context
#                 ^~~~~~~~~~~
#     In file included from C:/Users/ricardo/strawberry-perl-5.28.0.1-64bit-PDL/c/x86_64-w64-mingw32/include/windows.h:72:0,
#                      from C:\Users\ricardo\strawberry-perl-5.28.0.1-64bit-PDL\perl\lib\CORE/win32.h:150,
#                      from C:\Users\ricardo\strawberry-perl-5.28.0.1-64bit-PDL\perl\lib\CORE/win32thread.h:4,
#                      from C:\Users\ricardo\strawberry-perl-5.28.0.1-64bit-PDL\perl\lib\CORE/perl.h:2906,
#                      from testalienpts0M/test.xs:3:
#     C:/Users/ricardo/strawberry-perl-5.28.0.1-64bit-PDL/c/x86_64-w64-mingw32/include/winuser.h:2210:29: note: previous declaration of 'CloseWindow' was here
#        WINUSERAPI WINBOOL WINAPI CloseWindow (HWND hWnd);
#                                  ^~~~~~~~~~~
#     In file included from testalienpts0M/test.xs:5:0:
#     C:/Users/ricardo/STRAWB~1.1-6/data/.cpanm/work/1564450435.10880/Alien-raylib-0.023/blib/lib/auto/share/dist/Alien-raylib/include/raylib.h:863:12: error: conflicting types for 'ShowCursor'
#      RLAPI void ShowCursor(void);                                      // Shows cursor
#                 ^~~~~~~~~~
#     In file included from C:/Users/ricardo/strawberry-perl-5.28.0.1-64bit-PDL/c/x86_64-w64-mingw32/include/windows.h:72:0,
#                      from C:\Users\ricardo\strawberry-perl-5.28.0.1-64bit-PDL\perl\lib\CORE/win32.h:150,
#                      from C:\Users\ricardo\strawberry-perl-5.28.0.1-64bit-PDL\perl\lib\CORE/win32thread.h:4,
#                      from C:\Users\ricardo\strawberry-perl-5.28.0.1-64bit-PDL\perl\lib\CORE/perl.h:2906,
#                      from testalienpts0M/test.xs:3:
#     C:/Users/ricardo/strawberry-perl-5.28.0.1-64bit-PDL/c/x86_64-w64-mingw32/include/winuser.h:3609:25: note: previous declaration of 'ShowCursor' was here
#        WINUSERAPI int WINAPI ShowCursor(WINBOOL bShow);
#                              ^~~~~~~~~~
#     In file included from C:/Users/ricardo/strawberry-perl-5.28.0.1-64bit-PDL/c/x86_64-w64-mingw32/include/winnt.h:9:0,
#                      from C:/Users/ricardo/strawberry-perl-5.28.0.1-64bit-PDL/c/x86_64-w64-mingw32/include/minwindef.h:163,
#                      from C:/Users/ricardo/strawberry-perl-5.28.0.1-64bit-PDL/c/x86_64-w64-mingw32/include/windef.h:8,
#                      from C:/Users/ricardo/strawberry-perl-5.28.0.1-64bit-PDL/c/x86_64-w64-mingw32/include/windows.h:69,
#                      from C:\Users\ricardo\strawberry-perl-5.28.0.1-64bit-PDL\perl\lib\CORE/win32.h:150,
#                      from C:\Users\ricardo\strawberry-perl-5.28.0.1-64bit-PDL\perl\lib\CORE/win32thread.h:4,
#                      from C:\Users\ricardo\strawberry-perl-5.28.0.1-64bit-PDL\perl\lib\CORE/perl.h:2906,
#                      from testalienpts0M/test.xs:3:
#     C:/Users/ricardo/STRAWB~1.1-6/data/.cpanm/work/1564450435.10880/Alien-raylib-0.023/blib/lib/auto/share/dist/Alien-raylib/include/raylib.h:1041:13: error: conflicting types for 'LoadImageA'
#      RLAPI Image LoadImage(const char *fileName);                                                             // Load image from file into CPU memory (RAM)
#                  ^
#     In file included from C:/Users/ricardo/strawberry-perl-5.28.0.1-64bit-PDL/c/x86_64-w64-mingw32/include/windows.h:72:0,
#                      from C:\Users\ricardo\strawberry-perl-5.28.0.1-64bit-PDL\perl\lib\CORE/win32.h:150,
#                      from C:\Users\ricardo\strawberry-perl-5.28.0.1-64bit-PDL\perl\lib\CORE/win32thread.h:4,
#                      from C:\Users\ricardo\strawberry-perl-5.28.0.1-64bit-PDL\perl\lib\CORE/perl.h:2906,
#                      from testalienpts0M/test.xs:3:
#     C:/Users/ricardo/strawberry-perl-5.28.0.1-64bit-PDL/c/x86_64-w64-mingw32/include/winuser.h:4039:28: note: previous declaration of 'LoadImageA' was here
#        WINUSERAPI HANDLE WINAPI LoadImageA(HINSTANCE hInst,LPCSTR name,UINT type,int cx,int cy,UINT fuLoad);
#                                 ^~~~~~~~~~
#     In file included from C:/Users/ricardo/strawberry-perl-5.28.0.1-64bit-PDL/c/x86_64-w64-mingw32/include/winnt.h:9:0,
#                      from C:/Users/ricardo/strawberry-perl-5.28.0.1-64bit-PDL/c/x86_64-w64-mingw32/include/minwindef.h:163,
#                      from C:/Users/ricardo/strawberry-perl-5.28.0.1-64bit-PDL/c/x86_64-w64-mingw32/include/windef.h:8,
#                      from C:/Users/ricardo/strawberry-perl-5.28.0.1-64bit-PDL/c/x86_64-w64-mingw32/include/windows.h:69,
#                      from C:\Users\ricardo\strawberry-perl-5.28.0.1-64bit-PDL\perl\lib\CORE/win32.h:150,
#                      from C:\Users\ricardo\strawberry-perl-5.28.0.1-64bit-PDL\perl\lib\CORE/win32thread.h:4,
#                      from C:\Users\ricardo\strawberry-perl-5.28.0.1-64bit-PDL\perl\lib\CORE/perl.h:2906,
#                      from testalienpts0M/test.xs:3:
#     C:/Users/ricardo/STRAWB~1.1-6/data/.cpanm/work/1564450435.10880/Alien-raylib-0.023/blib/lib/auto/share/dist/Alien-raylib/include/raylib.h:1131:12: error: conflicting types for 'DrawTextA'
#      RLAPI void DrawText(const char *text, int posX, int posY, int fontSize, Color color);       // Draw text (using default font)
#                 ^
#     In file included from C:/Users/ricardo/strawberry-perl-5.28.0.1-64bit-PDL/c/x86_64-w64-mingw32/include/windows.h:72:0,
#                      from C:\Users\ricardo\strawberry-perl-5.28.0.1-64bit-PDL\perl\lib\CORE/win32.h:150,
#                      from C:\Users\ricardo\strawberry-perl-5.28.0.1-64bit-PDL\perl\lib\CORE/win32thread.h:4,
#                      from C:\Users\ricardo\strawberry-perl-5.28.0.1-64bit-PDL\perl\lib\CORE/perl.h:2906,
#                      from testalienpts0M/test.xs:3:
#     C:/Users/ricardo/strawberry-perl-5.28.0.1-64bit-PDL/c/x86_64-w64-mingw32/include/winuser.h:3332:25: note: previous declaration of 'DrawTextA' was here
#        WINUSERAPI int WINAPI DrawTextA(HDC hdc,LPCSTR lpchText,int cchText,LPRECT lprc,UINT format);
#                              ^~~~~~~~~
#     In file included from C:/Users/ricardo/strawberry-perl-5.28.0.1-64bit-PDL/c/x86_64-w64-mingw32/include/winnt.h:9:0,
#                      from C:/Users/ricardo/strawberry-perl-5.28.0.1-64bit-PDL/c/x86_64-w64-mingw32/include/minwindef.h:163,
#                      from C:/Users/ricardo/strawberry-perl-5.28.0.1-64bit-PDL/c/x86_64-w64-mingw32/include/windef.h:8,
#                      from C:/Users/ricardo/strawberry-perl-5.28.0.1-64bit-PDL/c/x86_64-w64-mingw32/include/windows.h:69,
#                      from C:\Users\ricardo\strawberry-perl-5.28.0.1-64bit-PDL\perl\lib\CORE/win32.h:150,
#                      from C:\Users\ricardo\strawberry-perl-5.28.0.1-64bit-PDL\perl\lib\CORE/win32thread.h:4,
#                      from C:\Users\ricardo\strawberry-perl-5.28.0.1-64bit-PDL\perl\lib\CORE/perl.h:2906,
#                      from testalienpts0M/test.xs:3:
#     C:/Users/ricardo/STRAWB~1.1-6/data/.cpanm/work/1564450435.10880/Alien-raylib-0.023/blib/lib/auto/share/dist/Alien-raylib/include/raylib.h:1132:12: error: conflicting types for 'DrawTextExA'
#      RLAPI void DrawTextEx(Font font, const char *text, Vector2 position, float fontSize, float spacing, Color tint);                // Draw text using font and additional parameters
#                 ^
#     In file included from C:/Users/ricardo/strawberry-perl-5.28.0.1-64bit-PDL/c/x86_64-w64-mingw32/include/windows.h:72:0,
#                      from C:\Users\ricardo\strawberry-perl-5.28.0.1-64bit-PDL\perl\lib\CORE/win32.h:150,
#                      from C:\Users\ricardo\strawberry-perl-5.28.0.1-64bit-PDL\perl\lib\CORE/win32thread.h:4,
#                      from C:\Users\ricardo\strawberry-perl-5.28.0.1-64bit-PDL\perl\lib\CORE/perl.h:2906,
#                      from testalienpts0M/test.xs:3:
#     C:/Users/ricardo/strawberry-perl-5.28.0.1-64bit-PDL/c/x86_64-w64-mingw32/include/winuser.h:3334:25: note: previous declaration of 'DrawTextExA' was here
#        WINUSERAPI int WINAPI DrawTextExA(HDC hdc,LPSTR lpchText,int cchText,LPRECT lprc,UINT format,LPDRAWTEXTPARAMS lpdtp);
#                              ^~~~~~~~~~~

Apparently there are conflicts with the windows API. Any ideas on how to overcome this?
Thank you.

@a3f
Copy link
Member

a3f commented Jul 30, 2019

Hello @ricardosdl,

I'm getting the error bellow when I try to install the lib on windows 10-64 bit, perl version:5.28.0 / MSWin32-x64-multi-thread, Strawberry Perl.

Thanks for testing this on Windows!

Apparently there are conflicts with the windows API. Any ideas on how to overcome this?

I've just pushed Alien::raylib v0.025, which contains two workarounds for Alien::raylib:

  • If you install normally, it should just use the C declaration directly on Windows and not use the header (commit: athreef/Alien-raylib@21e3c62)
  • If you define ALIEN_RAYLIB_FORCE_TEST_HEADER=1 in the environment prior to running it, it should run an additonal test that tries to include windows.h, but while skipping most of its unneeded declarations. This is untested however, could you try it out? (commit: athreef/Alien-raylib@034920f)

You might run into the same issue while building Graphics::Raylib. If so, please file a bug report.

Cheers

@a3f a3f closed this as completed Jul 30, 2019
@a3f a3f reopened this Jul 30, 2019
@ricardosdl
Copy link
Author

Hi again!
I tried installing it wihtout defining ALIEN_RAYLIB_FORCE_TEST_HEADER=1, it failed and this is the ending of build.log:

# Failed test 'xs'
# at t/init.t line 15.
#   ExtUtils::CBuilder->link failed
#     Generating script 'testalien9dHqD\Raylib.lds'
#     dlltool --def "testalien9dHqD\Raylib.def" --output-exp "testalien9dHqD\Raylib.exp"
#     g++.exe -o "testalien9dHqD\Raylib.xs.dll" -Wl,--base-file,"testalien9dHqD\Raylib.base" -Wl,--image-base,0x3b030000 -LC:/Users/ricardo/STRAWB~1.1-6/data/.cpanm/work/1564533009.7148/Alien-raylib-0.025/blib/lib/auto/share/dist/Alien-raylib/lib -mdll -s -L"C:\Users\ricardo\strawberry-perl-5.28.0.1-64bit-PDL\perl\lib\CORE" -L"C:\Users\ricardo\strawberry-perl-5.28.0.1-64bit-PDL\c\lib" "testalien9dHqD\Raylib.lds" -lraylib -lgdi32 "testalien9dHqD\Raylib.exp"
#     C:/Users/ricardo/strawberry-perl-5.28.0.1-64bit-PDL/c/bin/../lib/gcc/x86_64-w64-mingw32/7.1.0/../../../../x86_64-w64-mingw32/bin/ld.exe: cannot find -lraylib
#     collect2.exe: error: ld returned 1 exit status
#     dlltool --def "testalien9dHqD\Raylib.def" --output-exp "testalien9dHqD\Raylib.exp" --base-file "testalien9dHqD\Raylib.base"
#     g++.exe -o "testalien9dHqD\Raylib.xs.dll" -Wl,--image-base,0x3b030000 -LC:/Users/ricardo/STRAWB~1.1-6/data/.cpanm/work/1564533009.7148/Alien-raylib-0.025/blib/lib/auto/share/dist/Alien-raylib/lib -mdll -s -L"C:\Users\ricardo\strawberry-perl-5.28.0.1-64bit-PDL\perl\lib\CORE" -L"C:\Users\ricardo\strawberry-perl-5.28.0.1-64bit-PDL\c\lib" "testalien9dHqD\Raylib.lds" -lraylib -lgdi32 "testalien9dHqD\Raylib.exp"
#     C:/Users/ricardo/strawberry-perl-5.28.0.1-64bit-PDL/c/bin/../lib/gcc/x86_64-w64-mingw32/7.1.0/../../../../x86_64-w64-mingw32/bin/ld.exe: cannot find -lraylib
#     collect2.exe: error: ld returned 1 exit status
t/init.t ............... 
Dubious, test returned 1 (wstat 256, 0x100)
Failed 1/3 subtests 
# LIBS: -LC:/Users/ricardo/STRAWB~1.1-6/data/.cpanm/work/1564533009.7148/Alien-raylib-0.025/blib/lib/auto/share/dist/Alien-raylib/lib -lraylib
t/libs.t ............... ok

Test Summary Report
-------------------
t/init.t             (Wstat: 256 Tests: 3 Failed: 1)
  Failed test:  2
  Non-zero exit status: 1
Files=5, Tests=7, 11 wallclock secs ( 0.03 usr +  0.03 sys =  0.06 CPU)
Result: FAIL
Failed 1/5 test programs. 1/7 subtests failed.
gmake: *** [Makefile:923: test_dynamic] Error 255
-> FAIL Installing Alien::raylib failed. See C:\Users\ricardo\STRAWB~1.1-6\data\.cpanm\work\1564533009.7148\build.log for details. Retry with --force to force install it.
-> FAIL Installing the dependencies failed: Module 'Alien::raylib' is not installed
-> FAIL Bailing out the installation for Graphics-Raylib-0.025.
1 distribution installed

Thank you for the attention!

@a3f
Copy link
Member

a3f commented Aug 1, 2019

That's strange.. What's inside
C:/Users/ricardo/STRAWB~1.1-6/data/.cpanm/work/1564533009.7148/Alien-raylib-0.025/blib/lib/auto/share/dist/Alien-raylib/lib(The name doesn't stay the same, run the test again and open the directory prefixed with -L)

@ricardosdl
Copy link
Author

I only see these:
cmake - directory
libraylib_static.a - file
pkgconfig - directory

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

2 participants