chadvoegele / textadept-mac

Instructions to build textadept on macOS.
0 stars 0 forks source link

CDK error #1

Closed rgieseke closed 7 years ago

rgieseke commented 7 years ago

Hi, excellent effort, I had tried to build the Curses version a couple of times on OS X but never managed to get it right. With your patch I get

clang -c -mdynamic-no-pic -D_DARWIN_C_SOURCE -I/usr/local/Cellar/ncurses/6.0_3/include -I/usr/local/Cellar/ncurses/6.0_3/include/ncursesw -O2 -D_GNU_SOURCE -Itermkey -Icdk  cdk/traverse.c \
        -o cdk-traverse.o
cdk/traverse.c:84:9: warning: implicit declaration of function 'injectCDKMenu' is invalid in C99 [-Wimplicit-function-declaration]
         (void)injectCDKMenu ((CDKMENU *)menu, (chtype)key);
               ^
cdk/traverse.c:84:34: error: expected expression
         (void)injectCDKMenu ((CDKMENU *)menu, (chtype)key);
                                        ^
cdk/traverse.c:84:25: error: use of undeclared identifier 'CDKMENU'; did you mean 'vMENU'?
         (void)injectCDKMenu ((CDKMENU *)menu, (chtype)key);
                               ^~~~~~~
                               vMENU
cdk/cdk.h:170:4: note: 'vMENU' declared here
                ,vMENU
                 ^
cdk/traverse.c:89:36: error: expected expression
         done = (injectCDKMenu ((CDKMENU *)menu, (chtype)key) >= 0);
                                          ^
cdk/traverse.c:89:27: error: use of undeclared identifier 'CDKMENU'; did you mean 'vMENU'?
         done = (injectCDKMenu ((CDKMENU *)menu, (chtype)key) >= 0);
                                 ^~~~~~~
                                 vMENU
cdk/cdk.h:170:4: note: 'vMENU' declared here
                ,vMENU
                 ^
1 warning and 4 errors generated.
make: *** [cdk-traverse.o] Error 1

Any ideas what might cause this?

chadvoegele commented 7 years ago

Yes! I had that error.

Err, looks like I just commented out a few lines in cdk/traverse.c (82-90, the KEY_ESC and default cases). I think I had intended to come back to this but forgot.

Btw, thanks for your work on textredux. It's excellent!

On May 31, 2017 11:33 AM, "Robert Gieseke" notifications@github.com wrote:

Hi, excellent effort, I had tried to build the Curses version a couple of times on OS X but never managed to get it right. With your patch I get

clang -c -mdynamic-no-pic -D_DARWIN_C_SOURCE -I/usr/local/Cellar/ncurses/6.0_3/include -I/usr/local/Cellar/ncurses/6.0_3/include/ncursesw -O2 -D_GNU_SOURCE -Itermkey -Icdk cdk/traverse.c \ -o cdk-traverse.o cdk/traverse.c:84:9: warning: implicit declaration of function 'injectCDKMenu' is invalid in C99 [-Wimplicit-function-declaration] (void)injectCDKMenu ((CDKMENU )menu, (chtype)key); ^ cdk/traverse.c:84:34: error: expected expression (void)injectCDKMenu ((CDKMENU )menu, (chtype)key); ^ cdk/traverse.c:84:25: error: use of undeclared identifier 'CDKMENU'; did you mean 'vMENU'? (void)injectCDKMenu ((CDKMENU )menu, (chtype)key); ^~~ vMENU cdk/cdk.h:170:4: note: 'vMENU' declared here ,vMENU ^ cdk/traverse.c:89:36: error: expected expression done = (injectCDKMenu ((CDKMENU )menu, (chtype)key) >= 0); ^ cdk/traverse.c:89:27: error: use of undeclared identifier 'CDKMENU'; did you mean 'vMENU'? done = (injectCDKMenu ((CDKMENU *)menu, (chtype)key) >= 0); ^~~ vMENU cdk/cdk.h:170:4: note: 'vMENU' declared here ,vMENU ^ 1 warning and 4 errors generated. make: *** [cdk-traverse.o] Error 1

Any ideas what might cause this?

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/chadvoegele/textadept-mac/issues/1, or mute the thread https://github.com/notifications/unsubscribe-auth/AG_-_rChI7WmL6vt4RwtbBAFnHdT10RQks5r_bKPgaJpZM4NsBV2 .

rgieseke commented 7 years ago

Progress, many thanks!

With

make textadept-curses MAKE=make CURSES_LIBS=-lncurses LDFLAGS="-rdynamic -Wl, -liconv"

and commenting out the lines you mentioned in CDK I got a compiled version!

Would be nice to clean this up, feed back changes into Mitchell's version and turn this into a Homebrew formula!

The GUI version is already available as a cask, but I had always thought it should be possible to build the curses version standalone ...

chadvoegele commented 7 years ago

Great!

I've updated the instructions to reflect our discussion.

A homebrew formula would be nice! We'll need to take care merging these upstream. Mitchell has the Makefile set up to cross-compile from Linux. Perhaps we can propose adding osx-native targets in the Makefile.

rgieseke commented 7 years ago

True, detecting "darwin" should be possible and there are already cases for BSD, so maybe no need for extra target ...

chadvoegele commented 7 years ago

Indeed detecting darwin was quite easy. I've updated the repo.

I also resolved the CDKMENU error by only including ncurses rather than both ncurses and ncursesw. I did not test the impacts on wide character support.