[Z88dk-users] Symbol <_P> redefined in module 'CTK' error

Bridge to the z88dk-users mailing list
Post Reply
vittorio benintende

[Z88dk-users] Symbol <_P> redefined in module 'CTK' error

Post by vittorio benintende »

Hi,

this is my problem.

i have 2 sources:

ctk.c
program-handler.c

and i try to compile with this cmdline:

zcc +zx -O3 -no-cleanup -lndos -oprogram.bin main.c ek.c arg.c
program-handler.c ctk.c ctk-draw.c timer.c ek-service.c

but this is the output:
-------------------------------------------

C:\bc31\prj\zx>if "zno" == "z" (
set
PATH=C:\WINNT\system32;C:\WINNT;C:\WINNT\System32\Wbem;C:\PROGRA~1\ULTRAE~1;
c:\Programmi\Microsoft SQL
Server\90\Tools\binn\;c:\progra~1\z88dk\bin;c:\progra~1\z88dk\bin
set emu=c:\realspec\tap
set ZCCCFG=c:\progra~1\z88dk\lib\config\
SET Z80_OZFILES=c:\progra~1\z88dk\lib\
SET Z80_STDLIB=c:\progra~1\z88dk\lib\clib\rex_clib.lib
set APPENDPATH=no
)

C:\bc31\prj\zx>cd c:\bc31\prj\zx

C:\bc31\prj\zx>del .bin

C:\bc31\prj\zx>rem zcc +zx -a -O3 -lndos -o.bin main.c ek.c arg.c
program-handler.c ctk.c ctk-draw.c timer.c ek-service.c

C:\bc31\prj\zx>zcc +zx -O3 -no-cleanup -lndos -o.bin main.c ek.c arg.c
program-handler.c ctk.c ctk-draw.c timer.c ek-service.c
1 file copiati.
1 file copiati.
sccz80:"C:\PROGRA~1\z88dk\include/contiki\ek.h" L:318 Warning:#40:Volatile
type not supported by compiler
sccz80:"main.c" L:6 Warning:#4:Function returns different type to prototype
sccz80:"main.c" L:6 Warning:#5:Prototype is void fn
sccz80:"main.c" L:6 Warning:#6:Function is signed int fn
sccz80:"main.c" L:15 Warning:#36:In function: eventhandler() line 4
sccz80:"main.c" L:15 Warning:#13:Pointer/pointer type mismatch
sccz80:"main.c" L:15 Warning:#34:Func expects: signed char *
sccz80:"main.c" L:15 Warning:#35:Func gets: signed int
sccz80:"main.c" L:73 Warning:#4:Function returns different type to prototype
sccz80:"main.c" L:73 Warning:#5:Prototype is signed int fn
sccz80:"main.c" L:73 Warning:#6:Function is void fn
sccz80:"C:\PROGRA~1\z88dk\include/contiki\ek.h" L:318 Warning:#40:Volatile
type not supported by compiler
sccz80:"ek.c" L:42 Warning:#40:Volatile type not supported by compiler
sccz80:"ek.c" L:357 Warning:#39:Const type not supported by compiler
sccz80:"C:\PROGRA~1\z88dk\include/contiki\ek.h" L:318 Warning:#40:Volatile
type not supported by compiler
sccz80:"C:\PROGRA~1\z88dk\include/contiki\log.h" L:41 Warning:#39:Const type
not supported by compiler
sccz80:"C:\PROGRA~1\z88dk\include/contiki\log.h" L:41 Warning:#39:Const type
not supported by compiler
sccz80:"C:\PROGRA~1\z88dk\include/contiki\ek.h" L:318 Warning:#40:Volatile
type not supported by compiler
sccz80:"ctk.c" L:549 Warning:#36:In function: make_windowbuttons() line 16
sccz80:"ctk.c" L:549 Warning:#13:Pointer/pointer type mismatch
sccz80:"ctk.c" L:549 Warning:#34:Func expects: struct ctk_widget*
sccz80:"ctk.c" L:549 Warning:#35:Func gets: struct ctk_button*
sccz80:"ctk.c" L:559 Warning:#36:In function: make_windowbuttons() line 26
sccz80:"ctk.c" L:559 Warning:#13:Pointer/pointer type mismatch
sccz80:"ctk.c" L:559 Warning:#34:Func expects: struct ctk_widget*
sccz80:"ctk.c" L:559 Warning:#35:Func gets: struct ctk_button*
sccz80:"C:\PROGRA~1\z88dk\include/contiki\ek.h" L:318 Warning:#40:Volatile
type not supported by compiler
sccz80:"C:\PROGRA~1\z88dk\include/contiki\ek-service.h" L:41
Warning:#39:Const type not supported by compiler
sccz80:"C:\PROGRA~1\z88dk\include/contiki\ek-service.h" L:47
Warning:#39:Const type not supported by compiler
copy C:\PROGRA~1\z88dk\lib\spec_crt0.opt
C:\DOCUME~1\vittorio\IMPOST~1\Temp\s258_8.opt
copy C:\DOCUME~1\vittorio\IMPOST~1\Temp\s258_8.opt
C:\DOCUME~1\vittorio\IMPOST~1\Temp\s258_8.asm
zcpp -I. -DZ80 -DSMALL_C -DSPECTRUM -D__SPECTRUM__ -DSCCZ80
-IC:\PROGRA~1\z88dk\include main.c
C:\DOCUME~1\vittorio\IMPOST~1\Temp\s258_.i
sccz80 -// C:\DOCUME~1\vittorio\IMPOST~1\Temp\s258_.i
copt C:\PROGRA~1\z88dk\lib\z80rules.2 <
C:\DOCUME~1\vittorio\IMPOST~1\Temp\s258_.asm >
C:\DOCUME~1\vittorio\IMPOST~1\Temp\s258_.op1
copt C:\PROGRA~1\z88dk\lib\z80rules.1 <
C:\DOCUME~1\vittorio\IMPOST~1\Temp\s258_.op1 >
C:\DOCUME~1\vittorio\IMPOST~1\Temp\s258_.op2
copt C:\PROGRA~1\z88dk\lib\z80rules.0 <
C:\DOCUME~1\vittorio\IMPOST~1\Temp\s258_.op2 >
C:\DOCUME~1\vittorio\IMPOST~1\Temp\s258_.opt
z80asm -eopt -ns -Mo C:\DOCUME~1\vittorio\IMPOST~1\Temp\s258_.opt
zcpp -I. -DZ80 -DSMALL_C -DSPECTRUM -D__SPECTRUM__ -DSCCZ80
-IC:\PROGRA~1\z88dk\include ek.c
C:\DOCUME~1\vittorio\IMPOST~1\Temp\s258_1.i
sccz80 -// C:\DOCUME~1\vittorio\IMPOST~1\Temp\s258_1.i
copt C:\PROGRA~1\z88dk\lib\z80rules.2 <
C:\DOCUME~1\vittorio\IMPOST~1\Temp\s258_1.asm >
C:\DOCUME~1\vittorio\IMPOST~1\Temp\s258_1.op1
copt C:\PROGRA~1\z88dk\lib\z80rules.1 <
C:\DOCUME~1\vittorio\IMPOST~1\Temp\s258_1.op1 >
C:\DOCUME~1\vittorio\IMPOST~1\Temp\s258_1.op2
copt C:\PROGRA~1\z88dk\lib\z80rules.0 <
C:\DOCUME~1\vittorio\IMPOST~1\Temp\s258_1.op2 >
C:\DOCUME~1\vittorio\IMPOST~1\Temp\s258_1.opt
z80asm -eopt -ns -Mo C:\DOCUME~1\vittorio\IMPOST~1\Temp\s258_1.opt
zcpp -I. -DZ80 -DSMALL_C -DSPECTRUM -D__SPECTRUM__ -DSCCZ80
-IC:\PROGRA~1\z88dk\include arg.c
C:\DOCUME~1\vittorio\IMPOST~1\Temp\s258_2.i
sccz80 -// C:\DOCUME~1\vittorio\IMPOST~1\Temp\s258_2.i
copt C:\PROGRA~1\z88dk\lib\z80rules.2 <
C:\DOCUME~1\vittorio\IMPOST~1\Temp\s258_2.asm >
C:\DOCUME~1\vittorio\IMPOST~1\Temp\s258_2.op1
copt C:\PROGRA~1\z88dk\lib\z80rules.1 <
C:\DOCUME~1\vittorio\IMPOST~1\Temp\s258_2.op1 >
C:\DOCUME~1\vittorio\IMPOST~1\Temp\s258_2.op2
copt C:\PROGRA~1\z88dk\lib\z80rules.0 <
C:\DOCUME~1\vittorio\IMPOST~1\Temp\s258_2.op2 >
C:\DOCUME~1\vittorio\IMPOST~1\Temp\s258_2.opt
z80asm -eopt -ns -Mo C:\DOCUME~1\vittorio\IMPOST~1\Temp\s258_2.opt
zcpp -I. -DZ80 -DSMALL_C -DSPECTRUM -D__SPECTRUM__ -DSCCZ80
-IC:\PROGRA~1\z88dk\include program-handler.c
C:\DOCUME~1\vittorio\IMPOST~1\Temp\s258_3.i
sccz80 -// C:\DOCUME~1\vittorio\IMPOST~1\Temp\s258_3.i
copt C:\PROGRA~1\z88dk\lib\z80rules.2 <
C:\DOCUME~1\vittorio\IMPOST~1\Temp\s258_3.asm >
C:\DOCUME~1\vittorio\IMPOST~1\Temp\s258_3.op1
copt C:\PROGRA~1\z88dk\lib\z80rules.1 <
C:\DOCUME~1\vittorio\IMPOST~1\Temp\s258_3.op1 >
C:\DOCUME~1\vittorio\IMPOST~1\Temp\s258_3.op2
copt C:\PROGRA~1\z88dk\lib\z80rules.0 <
C:\DOCUME~1\vittorio\IMPOST~1\Temp\s258_3.op2 >
C:\DOCUME~1\vittorio\IMPOST~1\Temp\s258_3.opt
z80asm -eopt -ns -Mo C:\DOCUME~1\vittorio\IMPOST~1\Temp\s258_3.opt
zcpp -I. -DZ80 -DSMALL_C -DSPECTRUM -D__SPECTRUM__ -DSCCZ80
-IC:\PROGRA~1\z88dk\include ctk.c
C:\DOCUME~1\vittorio\IMPOST~1\Temp\s258_4.i
sccz80 -// C:\DOCUME~1\vittorio\IMPOST~1\Temp\s258_4.i
copt C:\PROGRA~1\z88dk\lib\z80rules.2 <
C:\DOCUME~1\vittorio\IMPOST~1\Temp\s258_4.asm >
C:\DOCUME~1\vittorio\IMPOST~1\Temp\s258_4.op1
copt C:\PROGRA~1\z88dk\lib\z80rules.1 <
C:\DOCUME~1\vittorio\IMPOST~1\Temp\s258_4.op1 >
C:\DOCUME~1\vittorio\IMPOST~1\Temp\s258_4.op2
copt C:\PROGRA~1\z88dk\lib\z80rules.0 <
C:\DOCUME~1\vittorio\IMPOST~1\Temp\s258_4.op2 >
C:\DOCUME~1\vittorio\IMPOST~1\Temp\s258_4.opt
z80asm -eopt -ns -Mo C:\DOCUME~1\vittorio\IMPOST~1\Temp\s258_4.opt
zcpp -I. -DZ80 -DSMALL_C -DSPECTRUM -D__SPECTRUM__ -DSCCZ80
-IC:\PROGRA~1\z88dk\include ctk-draw.c
C:\DOCUME~1\vittorio\IMPOST~1\Temp\s258_5.i
sccz80 -// C:\DOCUME~1\vittorio\IMPOST~1\Temp\s258_5.i
copt C:\PROGRA~1\z88dk\lib\z80rules.2 <
C:\DOCUME~1\vittorio\IMPOST~1\Temp\s258_5.asm >
C:\DOCUME~1\vittorio\IMPOST~1\Temp\s258_5.op1
copt C:\PROGRA~1\z88dk\lib\z80rules.1 <
C:\DOCUME~1\vittorio\IMPOST~1\Temp\s258_5.op1 >
C:\DOCUME~1\vittorio\IMPOST~1\Temp\s258_5.op2
copt C:\PROGRA~1\z88dk\lib\z80rules.0 <
C:\DOCUME~1\vittorio\IMPOST~1\Temp\s258_5.op2 >
C:\DOCUME~1\vitsccz80:"C:\PROGRA~1\z88dk\include/contiki\ek.h" L:318
Warning:#40:Volatile type not supported by compiler
sccz80:"C:\PROGRA~1\z88dk\include/contiki\ek-service.h" L:41
Warning:#39:Const type not supported by compiler
sccz80:"C:\PROGRA~1\z88dk\include/contiki\ek-service.h" L:47
Warning:#39:Const type not supported by compiler
sccz80:"C:\PROGRA~1\z88dk\include/contiki\log.h" L:41 Warning:#39:Const type
not supported by compiler
sccz80:"C:\PROGRA~1\z88dk\include/contiki\log.h" L:41 Warning:#39:Const type
not supported by compiler
sccz80:"ek-service.c" L:40 Warning:#39:Const type not supported by compiler
sccz80:"ek-service.c" L:48 Warning:#39:Const type not supported by compiler
Symbol <_P> redefined in module 'CTK'
torio\IMPOST~1\Temp\s258_5.opt
z80asm -eopt -ns -Mo C:\DOCUME~1\vittorio\IMPOST~1\Temp\s258_5.opt
zcpp -I. -DZ80 -DSMALL_C -DSPECTRUM -D__SPECTRUM__ -DSCCZ80
-IC:\PROGRA~1\z88dk\include timer.c
C:\DOCUME~1\vittorio\IMPOST~1\Temp\s258_6.i
sccz80 -// C:\DOCUME~1\vittorio\IMPOST~1\Temp\s258_6.i
copt C:\PROGRA~1\z88dk\lib\z80rules.2 <
C:\DOCUME~1\vittorio\IMPOST~1\Temp\s258_6.asm >
C:\DOCUME~1\vittorio\IMPOST~1\Temp\s258_6.op1
copt C:\PROGRA~1\z88dk\lib\z80rules.1 <
C:\DOCUME~1\vittorio\IMPOST~1\Temp\s258_6.op1 >
C:\DOCUME~1\vittorio\IMPOST~1\Temp\s258_6.op2
copt C:\PROGRA~1\z88dk\lib\z80rules.0 <
C:\DOCUME~1\vittorio\IMPOST~1\Temp\s258_6.op2 >
C:\DOCUME~1\vittorio\IMPOST~1\Temp\s258_6.opt
z80asm -eopt -ns -Mo C:\DOCUME~1\vittorio\IMPOST~1\Temp\s258_6.opt
zcpp -I. -DZ80 -DSMALL_C -DSPECTRUM -D__SPECTRUM__ -DSCCZ80
-IC:\PROGRA~1\z88dk\include ek-service.c
C:\DOCUME~1\vittorio\IMPOST~1\Temp\s258_7.i
sccz80 -// C:\DOCUME~1\vittorio\IMPOST~1\Temp\s258_7.i
copt C:\PROGRA~1\z88dk\lib\z80rules.2 <
C:\DOCUME~1\vittorio\IMPOST~1\Temp\s258_7.asm >
C:\DOCUME~1\vittorio\IMPOST~1\Temp\s258_7.op1
copt C:\PROGRA~1\z88dk\lib\z80rules.1 <
C:\DOCUME~1\vittorio\IMPOST~1\Temp\s258_7.op1 >
C:\DOCUME~1\vittorio\IMPOST~1\Temp\s258_7.op2
copt C:\PROGRA~1\z88dk\lib\z80rules.0 <
C:\DOCUME~1\vittorio\IMPOST~1\Temp\s258_7.op2 >
C:\DOCUME~1\vittorio\IMPOST~1\Temp\s258_7.opt
z80asm -eopt -ns -Mo C:\DOCUME~1\vittorio\IMPOST~1\Temp\s258_7.opt
z80asm -a -m -Mo -o.bin -iC:\PROGRA~1\z88dk\lib\clibs\ndos
-iC:\PROGRA~1\z88dk\lib\clibs\zx_clib
-iC:\PROGRA~1\z88dk\lib\clibs\z80_crt0
C:\DOCUME~1\vittorio\IMPOST~1\Temp\s258_8.opt
C:\DOCUME~1\vittorio\IMPOST~1\Temp\s258_.o
C:\DOCUME~1\vittorio\IMPOST~1\Temp\s258_1.o
C:\DOCUME~1\vittorio\IMPOST~1\Temp\s258_2.o
C:\DOCUME~1\vittorio\IMPOST~1\Temp\s258_3.o
C:\DOCUME~1\vittorio\IMPOST~1\Temp\s258_4.o
C:\DOCUME~1\vittorio\IMPOST~1\Temp\s258_5.o
C:\DOCUME~1\vittorio\IMPOST~1\Temp\s258_6.o
C:\DOCUME~1\vittorio\IMPOST~1\Temp\s258_7.o

C:\bc31\prj\zx>bin2tap main.bin main.tap
Can't open input file

C:\bc31\prj\zx>copy main.tap c:\realspec\tap
1 file copiati.
------------------------------------------------


I looked at .asm code and I find this:





;* * * * * Small-C/Plus z88dk * * * * *
; Version: v26-03-2004.01
;
; Reconstructed for the z80 Module Assembler
;
; Module compile time: Wed May 24 18:16:36 2006



MODULE program-handler.c

INCLUDE "#z80_crt0.hdr"


._contikidsclast
defm ""&0

._p
defw 0
defb 32
defw i_1+0
defb 127
defw _program_handler_eventhandler
defw 0
defw 0



and this:


;* * * * * Small-C/Plus z88dk * * * * *
; Version: v26-03-2004.01
;
; Reconstructed for the z80 Module Assembler
;
; Module compile time: Wed May 24 18:10:54 2006



MODULE ctk.c

INCLUDE "#z80_crt0.hdr"


._p
defw 0
defb 32
defw i_1+0
defb 127
defw _ctk_eventhandler
defw _ctk_poll
defw 0



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


This is my source code:


Program-handler.c




#include <string.h>

Some include stuff....


extern unsigned char ctk_menuitem_add(struct ctk_menu *menu, char *name);
extern void ctk_icon_add(struct ctk_widget *icon, ek_id_t id);
extern void ctk_menu_new(struct ctk_menu *menu, char *title);
extern void ctk_menu_add(struct ctk_menu *menu);
extern ek_id_t ek_start(struct ek_proc *p);


...code...


EK_EVENTHANDLER(program_handler_eventhandler, ev, data);
EK_PROCESS(p, "Program handler", EK_PRIO_NORMAL,
program_handler_eventhandler, NULL, NULL);


...code...

EK_EVENTHANDLER(program_handler_eventhandler, ev, data)
{
#ifdef WITH_LOADER_ARCH
unsigned char err;
struct dsc *dsc;
#endif /* WITH_LOADER_ARCH */
unsigned char i;
struct dsc **dscp;
/* DISPATCHER_SIGHANDLER_ARGS(s, data);*/
EK_EVENTHANDLER_ARGS(ev, data);

if(ev == EK_EVENT_INIT) {
/* Create the menus */
ctk_menu_add(&contikimenu);
#if WITH_LOADER_ARCH
runmenuitem = ctk_menuitem_add(&contikimenu, "Run program...");

make_windows();
#endif /* WITH_LOADER_ARCH */


displayname = NULL;

screensaver[0] = 0;

} else if(ev == ctk_signal_button_activate) {
#ifdef WITH_LOADER_ARCH
if(data == (ek_data_t)&loadbutton) {
ctk_window_close(&runwindow);
program_handler_load(name, NULL);
} else if(data == (ek_data_t)&errorokbutton) {
ctk_dialog_close();
}
#endif /* WITH_LOADER_ARCH */
dscp = &contikidsc[0];
for(i = 0; i < CTK_CONF_MAXMENUITEMS; ++i) {
if(*dscp != NULL &&
/* RED data == (ek_data_t)(*dscp)->icon) { */
data == (void *)(*dscp)->icon) {
RUN((*dscp)->prgname, (*dscp)->init, NULL);
break;
}
++dscp;
}
} else if(ev == ctk_signal_menu_activate) {
if((struct ctk_menu *)data == &contikimenu) {
#if WITH_LOADER_ARCH
dsc = contikidsc[contikimenu.active];
if(dsc != NULL) {
RUN(dsc->prgname, dsc->init, NULL);
} else if(contikimenu.active == runmenuitem) {
make_windows();
ctk_window_close(&runwindow);
ctk_window_open(&runwindow);
CTK_WIDGET_FOCUS(&runwindow, &nameentry);
}
#else /* WITH_LOADER_ARCH */
if(contikidsc[contikimenu.active] != NULL) {
RUN(contikidsc[contikimenu.active]->prgname,
contikidsc[contikimenu.active]->init,
NULL);
}
#endif /* WITH_LOADER_ARCH */
}
#if CTK_CONF_SCREENSAVER
} else if(ev == ctk_signal_screensaver_start) {
#if WITH_LOADER_ARCH
if(screensaver[0] != 0) {
program_handler_load(screensaver, NULL);
}
#endif /* WITH_LOADER_ARCH */
#endif /* CTK_CONF_SCREENSAVER */
} else if(ev == LOADER_EVENT_DISPLAY_NAME) {
#if WITH_LOADER_ARCH
if(displayname == NULL) {
make_windows();

ctk_label_set_text(&loadingname, ((struct pnarg *)data)->name);
ctk_dialog_open(&loadingdialog);
/* dispatcher_emit(loader_signal_load, data, id);*/
ek_post(id, LOADER_EVENT_LOAD, data);
displayname = data;
} else {
/* Try again. */
/* dispatcher_emit(loader_signal_display_name, data, id);*/
ek_post(id, LOADER_EVENT_DISPLAY_NAME, data);
}
#endif /* WITH_LOADER_ARCH */
} else if(ev == LOADER_EVENT_LOAD) {
#if WITH_LOADER_ARCH
if(displayname == data) {
ctk_dialog_close();
displayname = NULL;
log_message("Loading ", ((struct pnarg *)data)->name);
err = LOADER_LOAD(((struct pnarg *)data)->name,
((struct pnarg *)data)->arg);
if(err != LOADER_OK) {
make_windows();
errorfilename[0] = '"';
strncpy(errorfilename + 1, ((struct pnarg *)data)->name,
sizeof(errorfilename) - 2);
errorfilename[1 + strlen(((struct pnarg *)data)->name)] = '"';
ctk_label_set_text(&errortype, (char *)errormsgs[err]);
ctk_dialog_open(&errordialog);
log_message((char *)errormsgs[err], errorfilename);
}
pnarg_free(data);
} else {
/* Try again. */
/* dispatcher_emit(loader_signal_display_name, data, id);*/
ek_post(id, LOADER_EVENT_DISPLAY_NAME, data);
}
#endif /* WITH_LOADEER_ARCH */
}
}
/*--------------------------------------------------------------------------
---------*/


Ctk.c


...include stuff...

EK_POLLHANDLER(ctk_poll);
EK_EVENTHANDLER(ctk_eventhandler, ev, data);
EK_PROCESS(p, "CTK Contiki GUI", EK_PRIO_NORMAL, ctk_eventhandler,
ctk_poll, NULL);



EK_EVENTHANDLER(ctk_eventhandler, ev, data)
{

}
/*--------------------------------------------------------------------------
---------*/
/** @} */
/** @} */


The problem seems to be in EV_EVENTHANDLER

Any suggestions???

Thank you.




-------------------------------------------------------
All the advantages of Linux Managed Hosting--Without the Cost and Risk!
Fully trained technicians. The highest number of Red Hat certifications in
the hosting industry. Fanatical Support. Click to learn more
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=107521&bid=248729&dat=121642
Groepaz

Post by Groepaz »

On Wednesday 24 May 2006 19:10, vittorio benintende wrote:
Hi,

this is my problem.

i have 2 sources:

ctk.c
program-handler.c

and i try to compile with this cmdline:

zcc +zx -O3 -no-cleanup -lndos -oprogram.bin main.c ek.c arg.c
program-handler.c ctk.c ctk-draw.c timer.c ek-service.c

[snip]

you are trying to compile/port contiki right? i'd give sdcc a try then, z88dk
isnt quite capable of compiling contiki (even sdcc, which is quite a bit more
standard compliant, needs a few hacks)

--

http://www.hitmen-console.org
http://www.gc-linux.org/docs/yagcd.html
http://www.pokefinder.org
http://ftp.pokefinder.org

Computer games don't affect kids. I mean, if Pac-Man affected us as kids, we'd
all be running around in darkened rooms, munching pills and listening to
repetitive music.
<Marcus Brigstocke>



-------------------------------------------------------
All the advantages of Linux Managed Hosting--Without the Cost and Risk!
Fully trained technicians. The highest number of Red Hat certifications in
the hosting industry. Fanatical Support. Click to learn more
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=107521&bid=248729&dat=121642
alvin
Well known member
Posts: 1872
Joined: Mon Jul 16, 2007 7:39 pm

Post by alvin »

;* * * * * Small-C/Plus z88dk * * * * *
; Version: v26-03-2004.01

._contikidsclast
defm ""&0

._p
defw 0
defb 32
defw i_1+0
defb 127
defw _program_handler_eventhandler
defw 0
defw 0

and this:

;* * * * * Small-C/Plus z88dk * * * * *
; Version: v26-03-2004.01
;
MODULE ctk.c

._p
defw 0
defb 32
defw i_1+0
defb 127
defw _ctk_eventhandler
defw _ctk_poll
defw 0

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


This is my source code:


Program-handler.c

#include <string.h>

Some include stuff....


extern unsigned char ctk_menuitem_add(struct ctk_menu *menu, char *name);
extern void ctk_icon_add(struct ctk_widget *icon, ek_id_t id);
extern void ctk_menu_new(struct ctk_menu *menu, char *title);
extern void ctk_menu_add(struct ctk_menu *menu);
extern ek_id_t ek_start(struct ek_proc *p);


...code...


EK_EVENTHANDLER(program_handler_eventhandler, ev, data);
EK_PROCESS(p, "Program handler", EK_PRIO_NORMAL,
program_handler_eventhandler, NULL, NULL);

/*--------------------------------------------------------------------------
---------*/


Ctk.c


...include stuff...

EK_POLLHANDLER(ctk_poll);
EK_EVENTHANDLER(ctk_eventhandler, ev, data);
EK_PROCESS(p, "CTK Contiki GUI", EK_PRIO_NORMAL, ctk_eventhandler,
ctk_poll, NULL);


The problem seems to be in EV_EVENTHANDLER

Actually I think it's in EK_PROCESS. Is that a macro that creates
a data structure named "p"? It looks like it is...

If there is supposed to be one such data structure per file (with
one process per c file) -- again I am not familiar with contiki --
is there maybe missing a static declaration so that the "p"
data structure isn't made global?

Have a look at your two asm files again; if either one of them
have an "XDEF _p" in them then the local "_p" data structures
are being made global and you have two different p data structures
being referenced with the same name...

From what I remember long ago, contiki needed function pointer

typedefing and mulit-dimensional array support which z88dk is
missing. it's possible to work around, of course, but that would
involve changing the source quite a bit. Maybe that's what
you're doing? :-)

_________________________________________________________________
Take charge with a pop-up guard built on patented Microsoft? SmartScreen
Technology.
http://join.msn.com/?pgmarket=en-ca&page=byoa/prem&xAPID=1994&DI=1034&SU=http://hotmail.com/enca&HL=Market_MSNIS_Taglines
Start enjoying all the benefits of MSN? Premium right now and get the
first two months FREE*.



-------------------------------------------------------
All the advantages of Linux Managed Hosting--Without the Cost and Risk!
Fully trained technicians. The highest number of Red Hat certifications in
the hosting industry. Fanatical Support. Click to learn more
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=107521&bid=248729&dat=121642
Post Reply