tasknc icon indicating copy to clipboard operation
tasknc copied to clipboard

Can't compile on Cygwin windows

Open duckpuppy opened this issue 13 years ago • 4 comments

In the ncurses_init method in tasknc.c, there's an attempt to assign to stdscr:

if ((stdscr = initscr()) == NULL )

This won't work, as stdscr is #defined to a function in the current ncurses implementation in Cygwin, which is not a valid lvalue (and the resulting error is a complaint that the left side of an assignment is not an lvalue).

duckpuppy avatar Nov 06 '12 21:11 duckpuppy

Hi, At the moment, I cannot test in cygwin. Hopefully I will be able to soon. Would you be able to create a patch that would fix this? Thanks for trying tasknc! -mjheagle On Nov 6, 2012 3:36 PM, "Patrick Aikens" [email protected] wrote:

In the ncurses_init method in tasknc.c, there's an attempt to assign to stdscr:

if ((stdscr = initscr()) == NULL )

This won't work, as stdscr is #defined to a function in the current ncurses implementation in Cygwin, which is not a valid lvalue (and the resulting error is a complaint that the left side of an assignment is not an lvalue).

— Reply to this email directly or view it on GitHubhttps://github.com/mjheagle8/tasknc/issues/13.

mjheagle8 avatar Nov 08 '12 23:11 mjheagle8

I was able to fix this in Cygwin by simply changing the variable name and declaring it. I want to test these changes on my laptop running Arch Linux first before submitting a patch (I want to make sure this doesn't unintentionally break something else on a non-Cygwin system, but I doubt it will).

In the meantime, git diff between my local branch and the remote branch is below:

diff --git a/src/tasknc.c b/src/tasknc.c
index d0c83bd..0f1479b 100644
--- a/src/tasknc.c
+++ b/src/tasknc.c
@@ -590,8 +590,8 @@ void ncurses_init() /* {{{ */

        /* initialize screen */
        tnc_fprintf(stdout, LOG_DEBUG, "starting ncurses...");
-       stdscr = initscr();
-       if (stdscr == NULL )
+       int stdscrn = initscr();
+       if (stdscrn == NULL )
        {
            fprintf(stderr, "Error initialising ncurses.\n");
            exit(EXIT_FAILURE);

realchrisolin avatar Oct 17 '13 15:10 realchrisolin

I take this back. It will compile successfully, but the program itself isn't working. It keeps 'ending abnormally'. I think this is happening somewhere in configure().

I'll try to keep working on this and if I can fix it, I'll submit a patch.

realchrisolin avatar Oct 17 '13 15:10 realchrisolin

With mjheagle8's blessing, I'm taking over maintenance of this project. If you still care about this issue, please reopen it over at my fork.

lharding avatar Oct 05 '15 08:10 lharding