Open thorstenkampe opened 6 years ago
GCC is version 6.4.0. Do you need more information?
Nope. Thanks for testing. :)
Since this occurs on Cygwin can someone of the community please do this? I am not having the tool chain setup for debugging the same.
Bump. I am also getting the same error!
@thunderactual mind helping :) ?
Same error here - what can I do to fix this?
➜ cmatrix git:(master) make make all-am make[1]: Entering directory '/home/rk/cmatrix' gcc -DHAVE_CONFIG_H -I. -g -O2 -MT cmatrix.o -MD -MP -MF .deps/cmatrix.Tpo - c -o cmatrix.o cmatrix.c cmatrix.c: In function ‘resize_screen’: cmatrix.c:252:10: error: lvalue required as left operand of assignment COLS = win.ws_col; ^ cmatrix.c:253:11: error: lvalue required as left operand of assignment LINES = win.ws_row; ^ cmatrix.c:256:15: error: lvalue required as left operand of assignment LINES = 10; ^ cmatrix.c:259:14: error: lvalue required as left operand of assignment COLS = 10; ^ make[1]: [Makefile:425: cmatrix.o] Error 1 make[1]: Leaving directory '/home/rk/cmatrix' make: [Makefile:315: all] Error 2
@thorstenkampe @thunderactual if you delete lines 252–260 in cmatrix.c before ./configure, you can compile without problems on cygwin.
Downside: if you resize screen, you have to restart cmartix.
This also happens on Linux.
@FliegendeWurst really? If so can you state your software stack? I meant, the os, and other details that couldd help to investigate such a case?
I'm using Opensuse Tumbleweed (update 20180925) and
gcc version 8.2.1 20180831 [gcc-8-branch revision 264010].
The same problem on OpenSuSE 15 gcc (SUSE Linux) 7.3.1 20180323 [gcc-7-branch revision 258812]
cpp on cmatrix.c changes COLS to _nc_COLS() . You shoud not assign to COLS and ROWS.
I made a temporary patch.
diff --git a/cmatrix.c b/cmatrix.c
index 73e069f..c1d846e 100644
--- a/cmatrix.c
+++ b/cmatrix.c
@@ -239,6 +239,7 @@ void sighandler(int s) {
#endif
void resize_screen(void) {
+ int lines, cols;
#ifdef _WIN32
BOOL result;
HANDLE hStdHandle;
@@ -261,8 +262,8 @@ void resize_screen(void) {
result = GetConsoleScreenBufferInfo(hStdHandle, &csbiInfo);
if(!result)
return;
- LINES = csbiInfo.dwSize.Y;
- COLS = csbiInfo.dwSize.X;
+ lines = csbiInfo.dwSize.Y;
+ cols = csbiInfo.dwSize.X;
#else
}
fd = open(tty, O_RDWR);
@@ -274,21 +275,21 @@ void resize_screen(void) {
return;
}
- COLS = win.ws_col;
- LINES = win.ws_row;
+ cols = win.ws_col;
+ lines = win.ws_row;
#endif
- if(LINES <10){
- LINES = 10;
+ if(lines <10){
+ lines = 10;
}
- if(COLS <10){
- COLS = 10;
+ if(cols <10){
+ cols = 10;
}
#ifdef HAVE_RESIZETERM
- resizeterm(LINES, COLS);
+ resizeterm(lines, cols);
#ifdef HAVE_WRESIZE
- if (wresize(stdscr, LINES, COLS) == ERR) {
+ if (wresize(stdscr, lines, cols) == ERR) {
c_die("Cannot resize window!");
}
#endif /* HAVE_WRESIZE */
diff --git a/configure.ac b/configure.ac
index 1078f14..8499cce 100644
--- a/configure.ac
+++ b/configure.ac
@@ -7,7 +7,7 @@ AM_INIT_AUTOMAKE
AC_CANONICAL_HOST
case $host in
- *mingw*)
+ *mingw*|*cygwin*)
;;
*)
native_windows=no
For guys running openSUSI, can you please try compiling by using $(ncursesw6-config --libs)
or -L/usr/lib64/ncurses6 -lncursesw -ltinfo
instead of -lncurses
?
Reference: https://bugzilla.opensuse.org/show_bug.cgi?id=918553 https://forums.opensuse.org/showthread.php/522834-compilation-issue-with-cdk-library-and-LEAP-42-1
CC: @sallyx @FliegendeWurst
I kinda have a patch for Cygwin but before that can you make sure you have curses installed and is accessible by Cygwin? @fd00 @thorstenkampe @thunderactual as LINES and COLS are defined in curses.h
I made a temporary patch.
Hey, it might work but clearly, we have to give up resizing here which is not acceptable :P
Hi @abishekvashok! I tried compiling cmatrix today on MSYS2. It does complain about curses.h
even after installing ncurses-devel package so doing this helps:
diff --git a/cmatrix.c b/cmatrix.c
index d1f6b98..26d0648 100644
--- a/cmatrix.c
+++ b/cmatrix.c
@@ -48,7 +48,7 @@
#ifdef HAVE_NCURSES_H
#include <ncurses.h>
#else
-#include <curses.h>
+#include <ncurses/curses.h>
#endif
#ifdef HAVE_SYS_IOCTL_H
(This should ideally be wrapped under an ifdef
for MSYS/Cygwin).
The project compiles, but while running cmatrix.exe, I get this
Error opening terminal: xterm-256color
No terminal seems to work - mintty, Windows Terminal, Console Host etc.
@rashil2000 thanks for trying out! This seems like a terminfo issue, can you try installing ncurses-term
and then retrying?
@abishekvashok
My terminal emulator was setting the TERM
variable to xterm-256color
. Unsetting that fixes the issue - cmatrix works now!
Hmm interesting. Thanks for staying with this. I will take a dig at this later this day/tomorrow.
Hi @abishekvashok , any chance you can explain where to make this change? I've tried in a couple of places in the Makefile, and CMakeCache, etc (tried both cmake and ./configure routes) Thanks
For guys running openSUSI, can you please try compiling by using
$(ncursesw6-config --libs)
or-L/usr/lib64/ncurses6 -lncursesw -ltinfo
instead of-lncurses
?
GCC is version 6.4.0. Do you need more information?