From d47be2dd9e11f4ed8a1fa2b8e63945e55ba6d75c Mon Sep 17 00:00:00 2001 From: nobuh Date: Wed, 7 Jun 2023 23:08:33 +0900 Subject: [PATCH] fix make: multiple definition of nrow and ncol make fail by the error /usr/bin/ld: main.o:(.bss+0x0): multiple definition of `nrow'; memory.o:(.bss+0x0): first defined here /usr/bin/ld: main.o:(.bss+0x4): multiple definition of `ncol'; memory.o:(.bss+0x4): first defined here fix definition of the global variables nrow and ncol. --- src/screen.c | 2 ++ src/screen.h | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/screen.c b/src/screen.c index 629acbc..3113604 100644 --- a/src/screen.c +++ b/src/screen.c @@ -36,6 +36,8 @@ static int indexX, indexY; static WINDOW *screen; static long long interval_start; /* interval start time in u sec */ +int nrow, ncol; + char getch_screen(void) { return (char)wgetch(screen); diff --git a/src/screen.h b/src/screen.h index 88bdbb3..3324fad 100644 --- a/src/screen.h +++ b/src/screen.h @@ -25,5 +25,5 @@ void outputDsp(unsigned char dsp); char getch_screen(void); void select_screen(void); -int nrow, ncol; +extern int nrow, ncol;