Clearly is a macro definition missing somewhere.
I am not sure if the problem is because I am using cygwin or something else.
Code: Select all
$ make
gcc "src/MINEM68K.c" -o "bld/MINEM68K.o" -c -Wall -Wmissing-prototypes -Wno-uninitialized -Wundef -Wstrict-prototypes -Icfg/ -Isrc/ -Os
gcc "src/OSGLUWIN.c" -o "bld/OSGLUWIN.o" -c -Wall -Wmissing-prototypes -Wno-uninitialized -Wundef -Wstrict-prototypes -Icfg/ -Isrc/ -Os
src/OSGLUWIN.c: In function ‘GetAppDir’:
src/OSGLUWIN.c:153:47: error: ‘_MAX_PATH’ undeclared (first use in this function); did you mean ‘MAX_PATH’?
153 | if (GetModuleFileName(AppInstance, pathName, _MAX_PATH) == 0) {
| ^~~~~~~~~
| MAX_PATH
However, since it is a Windows host, now I have problems to link the object code.
Code: Select all
gcc "src/MINEM68K.c" -o "bld/MINEM68K.o" -c -Wall -Wmissing-prototypes -Wno-uninitialized -Wundef -Wstrict-prototypes -mno-cygwin -Icfg/ -Isrc/ -Os
gcc: error: unrecognized command line option ‘-mno-cygwin’; did you mean ‘-mno-clwb’?
make: *** [Makefile:18: bld/MINEM68K.o] Error 1
Code: Select all
$ make
gcc "src/MINEM68K.c" -o "bld/MINEM68K.o" -c -Wall -Wmissing-prototypes -Wno-uninitialized -Wundef -Wstrict-prototypes -Icfg/ -Isrc/ -Os
gcc "src/OSGLUWIN.c" -o "bld/OSGLUWIN.o" -c -Wall -Wmissing-prototypes -Wno-uninitialized -Wundef -Wstrict-prototypes -Icfg/ -Isrc/ -Os
src/OSGLUWIN.c: In function ‘MyGetKeyboardLayoutHex’:
src/OSGLUWIN.c:1631:14: warning: implicit declaration of function ‘_tcslen’ [-Wimplicit-function-declaration]
1631 | size_t n = _tcslen(s);
| ^~~~~~~
src/OSGLUWIN.c: In function ‘GetWndTitle’:
src/OSGLUWIN.c:2821:4: warning: implicit declaration of function ‘_tcscpy’ [-Wimplicit-function-declaration]
2821 | _tcscpy(WndTitle, fd.cFileName);
| ^~~~~~~
src/OSGLUWIN.c: In function ‘FileIsLink’:
src/OSGLUWIN.c:4557:7: warning: implicit declaration of function ‘_tcscmp’ [-Wimplicit-function-declaration]
4557 | if (_tcscmp(p, TEXT("lnk")) == 0) {
| ^~~~~~~
src/OSGLUWIN.c: In function ‘ResolveNamedChild0’:
src/OSGLUWIN.c:4610:3: warning: implicit declaration of function ‘_tcscat’ [-Wimplicit-function-declaration]
4610 | _tcscat(pathName, TEXT("\\"));
| ^~~~~~~
src/OSGLUWIN.c: At top level:
src/OSGLUWIN.c:6196:12: warning: no previous prototype for ‘_tWinMain’ [-Wmissing-prototypes]
6196 | int WINAPI _tWinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance,
| ^~~~~~~~~
gcc "src/GLOBGLUE.c" -o "bld/GLOBGLUE.o" -c -Wall -Wmissing-prototypes -Wno-uninitialized -Wundef -Wstrict-prototypes -Icfg/ -Isrc/ -Os
gcc "src/M68KITAB.c" -o "bld/M68KITAB.o" -c -Wall -Wmissing-prototypes -Wno-uninitialized -Wundef -Wstrict-prototypes -Icfg/ -Isrc/ -Os
gcc "src/VIAEMDEV.c" -o "bld/VIAEMDEV.o" -c -Wall -Wmissing-prototypes -Wno-uninitialized -Wundef -Wstrict-prototypes -Icfg/ -Isrc/ -Os
gcc "src/IWMEMDEV.c" -o "bld/IWMEMDEV.o" -c -Wall -Wmissing-prototypes -Wno-uninitialized -Wundef -Wstrict-prototypes -Icfg/ -Isrc/ -Os
gcc "src/SCCEMDEV.c" -o "bld/SCCEMDEV.o" -c -Wall -Wmissing-prototypes -Wno-uninitialized -Wundef -Wstrict-prototypes -Icfg/ -Isrc/ -Os
gcc "src/RTCEMDEV.c" -o "bld/RTCEMDEV.o" -c -Wall -Wmissing-prototypes -Wno-uninitialized -Wundef -Wstrict-prototypes -Icfg/ -Isrc/ -Os
gcc "src/ROMEMDEV.c" -o "bld/ROMEMDEV.o" -c -Wall -Wmissing-prototypes -Wno-uninitialized -Wundef -Wstrict-prototypes -Icfg/ -Isrc/ -Os
gcc "src/SCSIEMDV.c" -o "bld/SCSIEMDV.o" -c -Wall -Wmissing-prototypes -Wno-uninitialized -Wundef -Wstrict-prototypes -Icfg/ -Isrc/ -Os
gcc "src/SONYEMDV.c" -o "bld/SONYEMDV.o" -c -Wall -Wmissing-prototypes -Wno-uninitialized -Wundef -Wstrict-prototypes -Icfg/ -Isrc/ -Os
gcc "src/SCRNEMDV.c" -o "bld/SCRNEMDV.o" -c -Wall -Wmissing-prototypes -Wno-uninitialized -Wundef -Wstrict-prototypes -Icfg/ -Isrc/ -Os
gcc "src/MOUSEMDV.c" -o "bld/MOUSEMDV.o" -c -Wall -Wmissing-prototypes -Wno-uninitialized -Wundef -Wstrict-prototypes -Icfg/ -Isrc/ -Os
gcc "src/KBRDEMDV.c" -o "bld/KBRDEMDV.o" -c -Wall -Wmissing-prototypes -Wno-uninitialized -Wundef -Wstrict-prototypes -Icfg/ -Isrc/ -Os
gcc "src/SNDEMDEV.c" -o "bld/SNDEMDEV.o" -c -Wall -Wmissing-prototypes -Wno-uninitialized -Wundef -Wstrict-prototypes -Icfg/ -Isrc/ -Os
gcc "src/PROGMAIN.c" -o "bld/PROGMAIN.o" -c -Wall -Wmissing-prototypes -Wno-uninitialized -Wundef -Wstrict-prototypes -Icfg/ -Isrc/ -Os
windres.exe -i "cfg/main.rc" --input-format=rc -o "bld/main.res" -O coff --include-dir SRC
gcc \
-o "minivmac.exe" \
bld/MINEM68K.o bld/OSGLUWIN.o bld/GLOBGLUE.o bld/M68KITAB.o bld/VIAEMDEV.o bld/IWMEMDEV.o bld/SCCEMDEV.o bld/RTCEMDEV.o bld/ROMEMDEV.o bld/SCSIEMDV.o bld/SONYEMDV.o bld/SCRNEMDV.o bld/MOUSEMDV.o bld/KBRDEMDV.o bld/SNDEMDEV.o bld/PROGMAIN.o "bld/main.res" -mwindows -lwinmm -lole32 -luuid
/usr/lib/gcc/x86_64-pc-cygwin/9.3.0/../../../../x86_64-pc-cygwin/bin/ld: bld/OSGLUWIN.o:OSGLUWIN.c:(.text+0x2104): undefined reference to `_tcslen'
bld/OSGLUWIN.o:OSGLUWIN.c:(.text+0x2104): relocation truncated to fit: R_X86_64_PC32 against undefined symbol `_tcslen'
/usr/lib/gcc/x86_64-pc-cygwin/9.3.0/../../../../x86_64-pc-cygwin/bin/ld: bld/OSGLUWIN.o:OSGLUWIN.c:(.text+0x2144): undefined reference to `_tcscpy'
bld/OSGLUWIN.o:OSGLUWIN.c:(.text+0x2144): relocation truncated to fit: R_X86_64_PC32 against undefined symbol `_tcscpy'
/usr/lib/gcc/x86_64-pc-cygwin/9.3.0/../../../../x86_64-pc-cygwin/bin/ld: bld/OSGLUWIN.o:OSGLUWIN.c:(.text+0x22fe): undefined reference to `_tcscmp'
bld/OSGLUWIN.o:OSGLUWIN.c:(.text+0x22fe): relocation truncated to fit: R_X86_64_PC32 against undefined symbol `_tcscmp'
/usr/lib/gcc/x86_64-pc-cygwin/9.3.0/../../../../x86_64-pc-cygwin/bin/ld: bld/OSGLUWIN.o:OSGLUWIN.c:(.text+0x2e68): undefined reference to `_tcslen'
bld/OSGLUWIN.o:OSGLUWIN.c:(.text+0x2e68): relocation truncated to fit: R_X86_64_PC32 against undefined symbol `_tcslen'
/usr/lib/gcc/x86_64-pc-cygwin/9.3.0/../../../../x86_64-pc-cygwin/bin/ld: bld/OSGLUWIN.o:OSGLUWIN.c:(.text+0x377f): undefined reference to `_tcscpy'
bld/OSGLUWIN.o:OSGLUWIN.c:(.text+0x377f): relocation truncated to fit: R_X86_64_PC32 against undefined symbol `_tcscpy'
/usr/lib/gcc/x86_64-pc-cygwin/9.3.0/../../../../x86_64-pc-cygwin/bin/ld: bld/OSGLUWIN.o:OSGLUWIN.c:(.text+0x379d): undefined reference to `_tcscpy'
bld/OSGLUWIN.o:OSGLUWIN.c:(.text+0x379d): relocation truncated to fit: R_X86_64_PC32 against undefined symbol `_tcscpy'
/usr/lib/gcc/x86_64-pc-cygwin/9.3.0/../../../../x86_64-pc-cygwin/bin/ld: bld/OSGLUWIN.o:OSGLUWIN.c:(.text+0x38b4): undefined reference to `_tcslen'
bld/OSGLUWIN.o:OSGLUWIN.c:(.text+0x38b4): relocation truncated to fit: R_X86_64_PC32 against undefined symbol `_tcslen'
/usr/lib/gcc/x86_64-pc-cygwin/9.3.0/../../../../x86_64-pc-cygwin/bin/ld: bld/OSGLUWIN.o:OSGLUWIN.c:(.text+0x38bf): undefined reference to `_tcslen'
bld/OSGLUWIN.o:OSGLUWIN.c:(.text+0x38bf): relocation truncated to fit: R_X86_64_PC32 against undefined symbol `_tcslen'
/usr/lib/gcc/x86_64-pc-cygwin/9.3.0/../../../../x86_64-pc-cygwin/bin/ld: bld/OSGLUWIN.o:OSGLUWIN.c:(.text+0x38e4): undefined reference to `_tcscat'
bld/OSGLUWIN.o:OSGLUWIN.c:(.text+0x38e4): relocation truncated to fit: R_X86_64_PC32 against undefined symbol `_tcscat'
/usr/lib/gcc/x86_64-pc-cygwin/9.3.0/../../../../x86_64-pc-cygwin/bin/ld: bld/OSGLUWIN.o:OSGLUWIN.c:(.text+0x38ef): undefined reference to `_tcscat'
bld/OSGLUWIN.o:OSGLUWIN.c:(.text+0x38ef): relocation truncated to fit: R_X86_64_PC32 against undefined symbol `_tcscat'
/usr/lib/gcc/x86_64-pc-cygwin/9.3.0/../../../../x86_64-pc-cygwin/bin/ld: bld/OSGLUWIN.o:OSGLUWIN.c:(.text+0x3923): undefined reference to `_tcscat'
bld/OSGLUWIN.o:OSGLUWIN.c:(.text+0x3923): additional relocation overflows omitted from the output
/usr/lib/gcc/x86_64-pc-cygwin/9.3.0/../../../../x86_64-pc-cygwin/bin/ld: bld/OSGLUWIN.o:OSGLUWIN.c:(.text+0x3d66): undefined reference to `_tcslen'
/usr/lib/gcc/x86_64-pc-cygwin/9.3.0/../../../../x86_64-pc-cygwin/bin/ld: bld/OSGLUWIN.o:OSGLUWIN.c:(.text+0x572c): undefined reference to `_tcscpy'
/usr/lib/gcc/x86_64-pc-cygwin/9.3.0/../../../../x86_64-pc-cygwin/bin/ld: bld/OSGLUWIN.o:OSGLUWIN.c:(.text+0x57fe): undefined reference to `_tcscpy'
/usr/lib/gcc/x86_64-pc-cygwin/9.3.0/../../../../x86_64-pc-cygwin/bin/ld: bld/OSGLUWIN.o:OSGLUWIN.c:(.text+0x5806): undefined reference to `_tcslen'
/usr/lib/gcc/x86_64-pc-cygwin/9.3.0/../../../../x86_64-pc-cygwin/bin/ld: bld/OSGLUWIN.o:OSGLUWIN.c:(.rdata$.refptr.IID_IPersistFile[.refptr.IID_IPersistFile]+0x0): undefined reference to `IID_IPersistFile'
/usr/lib/gcc/x86_64-pc-cygwin/9.3.0/../../../../x86_64-pc-cygwin/bin/ld: bld/OSGLUWIN.o:OSGLUWIN.c:(.rdata$.refptr.IID_IShellLinkA[.refptr.IID_IShellLinkA]+0x0): undefined reference to `IID_IShellLinkA'
/usr/lib/gcc/x86_64-pc-cygwin/9.3.0/../../../../x86_64-pc-cygwin/bin/ld: /usr/lib/gcc/x86_64-pc-cygwin/9.3.0/../../../../lib/libcygwin.a(libcmain.o): in function `main':
/usr/src/debug/cygwin-3.1.5-1/winsup/cygwin/lib/libcmain.c:37: undefined reference to `WinMain'
collect2: error: ld returned 1 exit status
make: *** [Makefile:68: minivmac.exe] Error 1
But, I cannot believe that building Mini vMac on Windows can be so complex.
What am I doing wrong?