msys2 / MINGW-packages

Package scripts for MinGW-w64 targets to build under MSYS2.
https://packages.msys2.org
BSD 3-Clause "New" or "Revised" License
2.25k stars 1.21k forks source link

endwin() function will not link #20610

Open vero-board opened 5 months ago

vero-board commented 5 months ago

Description / Steps to reproduce the issue

Just for a bit of fun I downloaded the original version of Rogue from https://github.com/Davidslv/rogue Installed every thing necessary to build it using GCC from msys2 using ming64 mingw-w64-x86_64-pdcurses. Using Eclipse created and build the project with the correct references to the pdcurses library and header, which it finds. using static linking.

The code compiles except for; main.c line 240, 241 curscr->_cury = oy; curscr->_curx = ox;

Commented the two lines out. All compiled, but failed to link because endwin() external reference can not be resolved. main.c:129:(.text+0x368): undefined reference to `endwin_x64_4400'.

also get

Description Resource Path Location Type monsters.o:C:/Users/owner/Documents/Docs/Projects/Software/rogue/Debug/../monsters.c:163: more undefined references to endwin_x64_4400' follow rogue54 C/C++ Problem undefined reference toimp_BitBlt' rogue54 line 0, external location: C:\msys64\mingw64\x86_64-w64-mingw32\bin\ld.exe: C:\msys64\mingw64\lib\libpdcurses.a(pdcscrn.o) C/C++ Problem undefined reference to `imp_ChooseFontW' rogue54 line 0, external location: C:\msys64\mingw64\x86_64-w64-mingw32\bin\ld.exe: C:\msys64\mingw64\lib\libpdcurses.a(pdcdisp.o) C/C++ Problem undefined reference to __imp_CommDlgExtendedError' rogue54 line 0, external location: C:\msys64\mingw64\x86_64-w64-mingw32\bin\ld.exe: C:\msys64\mingw64\lib\libpdcurses.a(pdcdisp.o) C/C++ Problem undefined reference toimp_CreateCompatibleBitmap' rogue54 line 0, external location: C:\msys64\mingw64\x86_64-w64-mingw32\bin\ld.exe: C:\msys64\mingw64\lib\libpdcurses.a(pdcscrn.o) C/C++ Problem undefined reference to `imp_CreateCompatibleDC' rogue54 line 0, external location: C:\msys64\mingw64\x86_64-w64-mingw32\bin\ld.exe: C:\msys64\mingw64\lib\libpdcurses.a(pdcscrn.o) C/C++ Problem undefined reference to __imp_CreateFontIndirectW' rogue54 line 0, external location: C:\msys64\mingw64\x86_64-w64-mingw32\bin\ld.exe: C:\msys64\mingw64\lib\libpdcurses.a(pdcdisp.o) C/C++ Problem undefined reference toimp_CreatePen' rogue54 line 0, external location: C:\msys64\mingw64\x86_64-w64-mingw32\bin\ld.exe: C:\msys64\mingw64\lib\libpdcurses.a(pdcdisp.o) C/C++ Problem undefined reference to `imp_DeleteObject' rogue54 line 0, external location: C:\msys64\mingw64\x86_64-w64-mingw32\bin\ld.exe: C:\msys64\mingw64\lib\libpdcurses.a(pdcdisp.o) C/C++ Problem undefined reference to __imp_DeleteObject' rogue54 line 0, external location: C:\msys64\mingw64\x86_64-w64-mingw32\bin\ld.exe: C:\msys64\mingw64\lib\libpdcurses.a(pdcscrn.o) C/C++ Problem undefined reference toimp_ExtTextOutW' rogue54 line 0, external location: C:\msys64\mingw64\x86_64-w64-mingw32\bin\ld.exe: C:\msys64\mingw64\lib\libpdcurses.a(pdcdisp.o) C/C++ Problem undefined reference to `imp_GetFontUnicodeRanges' rogue54 line 0, external location: C:\msys64\mingw64\x86_64-w64-mingw32\bin\ld.exe: C:\msys64\mingw64\lib\libpdcurses.a(pdcscrn.o) C/C++ Problem undefined reference to __imp_GetStockObject' rogue54 line 0, external location: C:\msys64\mingw64\x86_64-w64-mingw32\bin\ld.exe: C:\msys64\mingw64\lib\libpdcurses.a(pdcscrn.o) C/C++ Problem undefined reference toimp_GetTextMetricsW' rogue54 line 0, external location: C:\msys64\mingw64\x86_64-w64-mingw32\bin\ld.exe: C:\msys64\mingw64\lib\libpdcurses.a(pdcscrn.o) C/C++ Problem undefined reference to `imp_LineTo' rogue54 line 0, external location: C:\msys64\mingw64\x86_64-w64-mingw32\bin\ld.exe: C:\msys64\mingw64\lib\libpdcurses.a(pdcdisp.o) C/C++ Problem undefined reference to __imp_MoveToEx' rogue54 line 0, external location: C:\msys64\mingw64\x86_64-w64-mingw32\bin\ld.exe: C:\msys64\mingw64\lib\libpdcurses.a(pdcdisp.o) C/C++ Problem undefined reference toimp_PlaySoundW' rogue54 line 0, external location: C:\msys64\mingw64\x86_64-w64-mingw32\bin\ld.exe: C:\msys64\mingw64\lib\libpdcurses.a(pdcutil.o) C/C++ Problem undefined reference to `imp_Rectangle' rogue54 line 0, external location: C:\msys64\mingw64\x86_64-w64-mingw32\bin\ld.exe: C:\msys64\mingw64\lib\libpdcurses.a(pdcscrn.o) C/C++ Problem undefined reference to __imp_SelectObject' rogue54 line 0, external location: C:\msys64\mingw64\x86_64-w64-mingw32\bin\ld.exe: C:\msys64\mingw64\lib\libpdcurses.a(pdcdisp.o) C/C++ Problem undefined reference toimp_SelectObject' rogue54 line 0, external location: C:\msys64\mingw64\x86_64-w64-mingw32\bin\ld.exe: C:\msys64\mingw64\lib\libpdcurses.a(pdcscrn.o) C/C++ Problem undefined reference to `imp_SetBkColor' rogue54 line 0, external location: C:\msys64\mingw64\x86_64-w64-mingw32\bin\ld.exe: C:\msys64\mingw64\lib\libpdcurses.a(pdcdisp.o) C/C++ Problem undefined reference to __imp_SetTextColor' rogue54 line 0, external location: C:\msys64\mingw64\x86_64-w64-mingw32\bin\ld.exe: C:\msys64\mingw64\lib\libpdcurses.a(pdcdisp.o) C/C++ Problem undefined reference toendwin_x64_4400' rogue54 line 0, external location: main.c:129 C/C++ Problem undefined reference to endwin_x64_4400' rogue54 line 0, external location: main.c:176 C/C++ Problem undefined reference toendwin_x64_4400' rogue54 line 0, external location: main.c:222 C/C++ Problem undefined reference to endwin_x64_4400' rogue54 line 0, external location: main.c:342 C/C++ Problem undefined reference toendwin_x64_4400' rogue54 line 0, external location: main.c:362 C/C++ Problem

Updated MSYS2 09/04/24

Unable to find a way to resolve this. Google search Search did not find anything. Help.

Expected behavior

for the program to link to a .exe file

Actual behavior

Failed to link

Verification

Windows Version

MSYS_NT-10.0-19045

MINGW environments affected

Are you willing to submit a PR?

no

Biswa96 commented 5 months ago

How did you compile it?

vero-board commented 5 months ago

The problem is the package is out of date. The fix this issue I recompiled the sourses from pdcurses mod on github. Which linked without this error. I also tryed msys2 package ncurses and got the same error

On Thu, 18 Apr 2024, 6:22 am Biswapriyo Nath, @.***> wrote:

How did you compile it?

— Reply to this email directly, view it on GitHub https://github.com/msys2/MINGW-packages/issues/20610#issuecomment-2063022584, or unsubscribe https://github.com/notifications/unsubscribe-auth/AVLNYOFUYDX7TT33FXEL4JTY55KAJAVCNFSM6AAAAABGA3DEZSVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDANRTGAZDENJYGQ . You are receiving this because you authored the thread.Message ID: @.***>

vero-board commented 5 months ago

When linking against library pdcurses.a from ming64 mingw-w64-x86_64-pdcurses Compiling using mingw64 libraries Results in the following C linking error undefined reference to `endwin_x64_4400'.

Repeated the same procedure using the ncurses mingw64 package and got the same result.

To get around this problem. downloaded source from https://github.com/Bill-Gray/PDCursesMod.git compiled using mingw64 Changed reference in application to point to new library Re-compiled, without error

Conclusion MSYS PDCUSES and NCURSES packages are out of date

vero-board commented 5 months ago

Also PDCURSES and NCURSES will not link statically. this means that the .DLL have to be in the same folder of path as the application.

try it your self just download https://github.com/Davidslv/rogue and try to compile it against themsys2 pdcurses package