Opened 16 years ago

Closed 16 years ago

Last modified 15 years ago

#13116 closed defect (duplicate)

ettercap-ng fails to build on Mac OS X 10.5 Leopard

Reported by: neetocin@… Owned by: macports-tickets@…
Priority: Normal Milestone:
Component: ports Version: 1.5.0
Keywords: Cc: ultrix@…
Port:

Description (last modified by jmpp@…)

When one tries to install ettercap-ng by "sudo port install ettercap-ng" the compilation fails with a message:

--->  Building ettercap-ng with target all
Error: Target org.macports.build returned: shell command " cd "/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_ports_net_ettercap-ng/work/ettercap-NG-0.7.3" && make all " returned error 2
Command output: wdg.c:821: error: dereferencing pointer to incomplete type
wdg.c:821: error: dereferencing pointer to incomplete type
wdg.c:823: error: dereferencing pointer to incomplete type
wdg.c:824: error: dereferencing pointer to incomplete type
wdg.c:826: error: dereferencing pointer to incomplete type
wdg.c:826: error: dereferencing pointer to incomplete type
wdg.c: In function 'wdg_get_ncols':
wdg.c:837: error: dereferencing pointer to incomplete type
wdg.c:838: error: dereferencing pointer to incomplete type
wdg.c:840: error: dereferencing pointer to incomplete type
wdg.c:840: error: dereferencing pointer to incomplete type
wdg.c:842: error: dereferencing pointer to incomplete type
wdg.c:843: error: dereferencing pointer to incomplete type
wdg.c:845: error: dereferencing pointer to incomplete type
wdg.c:845: error: dereferencing pointer to incomplete type
wdg.c: In function 'wdg_get_begin_x':
wdg.c:855: error: dereferencing pointer to incomplete type
wdg.c:856: error: dereferencing pointer to incomplete type
wdg.c:858: error: dereferencing pointer to incomplete type
wdg.c:858: error: dereferencing pointer to incomplete type
wdg.c: In function 'wdg_get_begin_y':
wdg.c:865: error: dereferencing pointer to incomplete type
wdg.c:866: error: dereferencing pointer to incomplete type
wdg.c:868: error: dereferencing pointer to incomplete type
wdg.c:868: error: dereferencing pointer to incomplete type
make[4]: *** [libwdg_a-wdg.o] Error 1
make[3]: *** [all-recursive] Error 1
make[2]: *** [all-recursive] Error 1
make[1]: *** [all-recursive] Error 1
make: *** [all-recursive] Error 1

Commentary:

Upon brief analysis of this code, I think the reason why this is happening is because a "typedef unsigned char u_char" got removed somewhere. Here are the patches to fix it:

--- ettercap-NG-0.7.3.old/src/interfaces/curses/widgets/wdg.c   2004-03-18 09:22:19.000000000 -0500
+++ ettercap-NG-0.7.3.new/src/interfaces/curses/widgets/wdg.c   2007-11-03 01:43:01.000000000 -0400
@@ -78,9 +78,9 @@
 void wdg_set_size(struct wdg_object *wo, int x1, int y1, int x2, int y2);
 void wdg_draw_object(struct wdg_object *wo);
 size_t wdg_get_type(struct wdg_object *wo);
-void wdg_init_color(u_char pair, u_char fg, u_char bg);
-void wdg_set_color(wdg_t *wo, size_t part, u_char pair);
-void wdg_screen_color(u_char pair);
+void wdg_init_color(unsigned char pair, unsigned char fg, unsigned char bg);
+void wdg_set_color(wdg_t *wo, size_t part, unsigned char pair);
+void wdg_screen_color(unsigned char pair);
 
 size_t wdg_get_nlines(struct wdg_object *wo);
 size_t wdg_get_ncols(struct wdg_object *wo);
@@ -753,7 +753,7 @@
 /* 
  * set the color of an object
  */
-void wdg_set_color(wdg_t *wo, size_t part, u_char pair)
+void wdg_set_color(wdg_t *wo, size_t part, unsigned char pair)
 {
    switch (part) {
       case WDG_COLOR_SCREEN:
@@ -780,7 +780,7 @@
 /*
  * init a color pair
  */
-void wdg_init_color(u_char pair, u_char fg, u_char bg)
+void wdg_init_color(unsigned char pair, unsigned char fg, unsigned char bg)
 {
    init_pair(pair, fg, bg);
 }
@@ -788,7 +788,7 @@
 /*
  * erase the screen with the specified color
  */
-void wdg_screen_color(u_char pair)
+void wdg_screen_color(unsigned char pair)
 {
    wbkgd(stdscr, COLOR_PAIR(pair));
    erase();

-----------------------------------------------------------------------

--- ettercap-NG-0.7.3.old/src/interfaces/curses/widgets/wdg.h   2004-09-28 09:50:37.000000000 -0400
+++ ettercap-NG-0.7.3.new/src/interfaces/curses/widgets/wdg.h   2007-11-03 01:43:38.000000000 -0400
@@ -186,12 +186,12 @@
    int x1, y1, x2, y2;
 
    /* object colors */
-   u_char screen_color;
-   u_char border_color;
-   u_char focus_color;
-   u_char title_color;
-   u_char window_color;
-   u_char select_color;
+   unsigned char screen_color;
+   unsigned char border_color;
+   unsigned char focus_color;
+   unsigned char title_color;
+   unsigned char window_color;
+   unsigned char select_color;
 
    /* title */
    char *title;
@@ -301,15 +301,15 @@
 extern size_t wdg_get_type(wdg_t *wo);
 extern void wdg_set_focus(wdg_t *wo);
 extern void wdg_set_title(wdg_t *wo, char *title, size_t align);
-extern void wdg_init_color(u_char pair, u_char fg, u_char bg);
-extern void wdg_set_color(wdg_t *wo, size_t part, u_char pair);
+extern void wdg_init_color(unsigned char pair, unsigned char fg, unsigned char bg);
+extern void wdg_set_color(wdg_t *wo, size_t part, unsigned char pair);
    #define WDG_COLOR_SCREEN   0
    #define WDG_COLOR_TITLE    1
    #define WDG_COLOR_BORDER   2
    #define WDG_COLOR_FOCUS    3
    #define WDG_COLOR_WINDOW   4
    #define WDG_COLOR_SELECT   5
-extern void wdg_screen_color(u_char pair);
+extern void wdg_screen_color(unsigned char pair);
 
 /* object size */
 extern size_t wdg_get_nlines(wdg_t *wo);

Since this is my first bug report, I'm sorry if I breached some mysterious protocol that I don't know about or I botched up the diff files since it's my first time.

Change History (11)

comment:1 Changed 16 years ago by neetocin@…

--- ettercap-NG-0.7.3.old/src/interfaces/curses/widgets/wdg.h   2004-09-28 09:50:37.000000000 -0400
+++ ettercap-NG-0.7.3.new/src/interfaces/curses/widgets/wdg.h   2007-11-03 01:43:38.000000000 -0400
@@ -186,12 +186,12 @@
    int x1, y1, x2, y2;
 
    /* object colors */
-   u_char screen_color;
-   u_char border_color;
-   u_char focus_color;
-   u_char title_color;
-   u_char window_color;
-   u_char select_color;
+   unsigned char screen_color;
+   unsigned char border_color;
+   unsigned char focus_color;
+   unsigned char title_color;
+   unsigned char window_color;
+   unsigned char select_color;
 
    /* title */
    char *title;
@@ -301,15 +301,15 @@
 extern size_t wdg_get_type(wdg_t *wo);
 extern void wdg_set_focus(wdg_t *wo);
 extern void wdg_set_title(wdg_t *wo, char *title, size_t align);
-extern void wdg_init_color(u_char pair, u_char fg, u_char bg);
-extern void wdg_set_color(wdg_t *wo, size_t part, u_char pair);
+extern void wdg_init_color(unsigned char pair, unsigned char fg, unsigned char bg);
+extern void wdg_set_color(wdg_t *wo, size_t part, unsigned char pair);
    #define WDG_COLOR_SCREEN   0
    #define WDG_COLOR_TITLE    1
    #define WDG_COLOR_BORDER   2
    #define WDG_COLOR_FOCUS    3
    #define WDG_COLOR_WINDOW   4
    #define WDG_COLOR_SELECT   5
-extern void wdg_screen_color(u_char pair);
+extern void wdg_screen_color(unsigned char pair);
 
 /* object size */
 extern size_t wdg_get_nlines(wdg_t *wo);



--- ettercap-NG-0.7.3.old/src/interfaces/curses/widgets/wdg.c   2004-03-18 09:22:19.000000000 -0500
+++ ettercap-NG-0.7.3.new/src/interfaces/curses/widgets/wdg.c   2007-11-03 01:43:01.000000000 -0400
@@ -78,9 +78,9 @@
 void wdg_set_size(struct wdg_object *wo, int x1, int y1, int x2, int y2);
 void wdg_draw_object(struct wdg_object *wo);
 size_t wdg_get_type(struct wdg_object *wo);
-void wdg_init_color(u_char pair, u_char fg, u_char bg);
-void wdg_set_color(wdg_t *wo, size_t part, u_char pair);
-void wdg_screen_color(u_char pair);
+void wdg_init_color(unsigned char pair, unsigned char fg, unsigned char bg);
+void wdg_set_color(wdg_t *wo, size_t part, unsigned char pair);
+void wdg_screen_color(unsigned char pair);
 
 size_t wdg_get_nlines(struct wdg_object *wo);
 size_t wdg_get_ncols(struct wdg_object *wo);
@@ -753,7 +753,7 @@
 /* 
  * set the color of an object
  */
-void wdg_set_color(wdg_t *wo, size_t part, u_char pair)
+void wdg_set_color(wdg_t *wo, size_t part, unsigned char pair)
 {
    switch (part) {
       case WDG_COLOR_SCREEN:
@@ -780,7 +780,7 @@
 /*
  * init a color pair
  */
-void wdg_init_color(u_char pair, u_char fg, u_char bg)
+void wdg_init_color(unsigned char pair, unsigned char fg, unsigned char bg)
 {
    init_pair(pair, fg, bg);
 }
@@ -788,7 +788,7 @@
 /*
  * erase the screen with the specified color
  */
-void wdg_screen_color(u_char pair)
+void wdg_screen_color(unsigned char pair)
 {
    wbkgd(stdscr, COLOR_PAIR(pair));
    erase();

comment:2 Changed 16 years ago by neetocin@…

--->  Fetching ettercap-ng
--->  Verifying checksum(s) for ettercap-ng
--->  Extracting ettercap-ng
--->  Applying patches to ettercap-ng
--->  Configuring ettercap-ng
--->  Building ettercap-ng with target all
Error: Target org.macports.build returned: shell command " cd "/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_ports_net_ettercap-ng/work/ettercap-NG-0.7.3" && make all " returned error 2
Command output: wdg.c:821: error: dereferencing pointer to incomplete type
wdg.c:821: error: dereferencing pointer to incomplete type
wdg.c:823: error: dereferencing pointer to incomplete type
wdg.c:824: error: dereferencing pointer to incomplete type
wdg.c:826: error: dereferencing pointer to incomplete type
wdg.c:826: error: dereferencing pointer to incomplete type
wdg.c: In function 'wdg_get_ncols':
wdg.c:837: error: dereferencing pointer to incomplete type
wdg.c:838: error: dereferencing pointer to incomplete type
wdg.c:840: error: dereferencing pointer to incomplete type
wdg.c:840: error: dereferencing pointer to incomplete type
wdg.c:842: error: dereferencing pointer to incomplete type
wdg.c:843: error: dereferencing pointer to incomplete type
wdg.c:845: error: dereferencing pointer to incomplete type
wdg.c:845: error: dereferencing pointer to incomplete type
wdg.c: In function 'wdg_get_begin_x':
wdg.c:855: error: dereferencing pointer to incomplete type
wdg.c:856: error: dereferencing pointer to incomplete type
wdg.c:858: error: dereferencing pointer to incomplete type
wdg.c:858: error: dereferencing pointer to incomplete type
wdg.c: In function 'wdg_get_begin_y':
wdg.c:865: error: dereferencing pointer to incomplete type
wdg.c:866: error: dereferencing pointer to incomplete type
wdg.c:868: error: dereferencing pointer to incomplete type
wdg.c:868: error: dereferencing pointer to incomplete type
make[4]: *** [libwdg_a-wdg.o] Error 1
make[3]: *** [all-recursive] Error 1
make[2]: *** [all-recursive] Error 1
make[1]: *** [all-recursive] Error 1
make: *** [all-recursive] Error 1

Error: Status 1 encountered during processing.

comment:3 Changed 16 years ago by jmpp@…

Description: modified (diff)

comment:4 Changed 16 years ago by jmpp@…

Milestone: Port Bugs

comment:5 Changed 16 years ago by jmpp@…

It would be great if these patches were provided as attachments to this ticket, thanks!

-jmpp

comment:6 Changed 16 years ago by nox@…

Summary: ettercap-NG-0.7.3 doesn't compile on Mac OS X Leopard (10.5)ettercap-ng fails to build on Mac OS X 10.5 Leopard

comment:7 Changed 16 years ago by christian@…

Does anything happen regarding this issue?

comment:8 Changed 16 years ago by jmroot (Joshua Root)

Cc: ultrix@… added

CC maintainer.

comment:9 Changed 16 years ago by vicoasis@…

Add only one line

#define u_char unsigned char

............

    int x1, y1, x2, y2;

#define u_char unsigned char

    /* object colors */
   u_char screen_color;
   u_char border_color;
   u_char focus_color;
   u_char title_color;
   u_char window_color;
   u_char select_color;

.........

And be happy :)

comment:10 Changed 16 years ago by jmroot (Joshua Root)

Resolution: duplicate
Status: newclosed

The fix from #13399 was applied for this issue.

comment:11 Changed 15 years ago by (none)

Milestone: Port Bugs

Milestone Port Bugs deleted

Note: See TracTickets for help on using tickets.