Closed hologenics closed 3 years ago
Unsure if this is supported or an overlooked edge case... .
Using getopts with -mcrt=nix20
Code Example (does not do anything but demos the linker issue).
Compile with
amiga-g++ -mcrt=nix20 test.cpp
#include <stdio.h> #include <unistd.h> int main(int argc, char ** args) { // Start from parsing command line arguments while(true) { int c = getopt(argc, args, "?hCLc:s:X"); switch(c) { case -1: goto args_done; case 's': break; case 'X': break; case '?': case 'h': default: if (optopt == 'c') { printf("Unnown Cables\n"); exit(1); } } } args_done: return 0; }
What happens...
/opt/amiga/lib/gcc/m68k-amigaos/6.5.0b/../../../../m68k-amigaos/bin/ld: /tmp/ccjgC7wT.o:/tmp/ccjgC7wT.o:(.text+0x166): undefined reference to `optopt'
Possibly unpublished extern int optopt?
Confirmed fixed.
Unsure if this is supported or an overlooked edge case... .
Using getopts with -mcrt=nix20
Code Example (does not do anything but demos the linker issue).
Compile with
amiga-g++ -mcrt=nix20 test.cpp
What happens...
/opt/amiga/lib/gcc/m68k-amigaos/6.5.0b/../../../../m68k-amigaos/bin/ld: /tmp/ccjgC7wT.o:/tmp/ccjgC7wT.o:(.text+0x166): undefined reference to `optopt'
Possibly unpublished extern int optopt?