scr_ problems help

Discuss the development of software, tools, libraries and anything else that helps make ps2dev happen.

Moderators: cheriff, Herben

Post Reply
JorDy
Posts: 121
Joined: Sun Dec 11, 2005 8:45 am

scr_ problems help

Post by JorDy »

wel im trying to compile a new project to use the mc fncs, my poject is dumping memory but im having problems when i go to use scr_printf
ERROR

Code: Select all

jordan@jordy:/usr/local/ps2dev/ps2sdk/samples/CMPdump$ make
ee-gcc -D_EE -O2 -G0 -Wall  -I/usr/local/ps2dev/ps2sdk/ee/include -I/usr/local/ps2dev/ps2sdk/common/include -I.  -c cmp_dump.c -o cmp_dump.o
cmp_dump.c: In function `main':
cmp_dump.c:120: warning: implicit declaration of function `Dump'
cmp_dump.c:131: warning: control reaches end of non-void function
cmp_dump.c: At top level:
cmp_dump.c:136: warning: return type defaults to `int'
cmp_dump.c: In function `Dump':
cmp_dump.c:146: warning: control reaches end of non-void function
ee-gcc -mno-crt0 -T/usr/local/ps2dev/ps2sdk/ee/startup/linkfile -L/usr/local/ps2dev/ps2sdk/ee/lib  \
        -o cmp_dump.elf /usr/local/ps2dev/ps2sdk/ee/startup/crt0.o cmp_dump.o -lmc -lc -lc -lkernel
cmp_dump.o(.text+0x14): In function `main':
cmp_dump.c: undefined reference to `init_scr'
cmp_dump.o(.text+0x30):cmp_dump.c: undefined reference to `scr_printf'
cmp_dump.o(.text+0x58):cmp_dump.c: undefined reference to `scr_printf'
cmp_dump.o(.text+0xfc):cmp_dump.c: undefined reference to `scr_printf'
cmp_dump.o(.text+0x150):cmp_dump.c: undefined reference to `scr_printf'
cmp_dump.o(.text+0x174):cmp_dump.c: undefined reference to `scr_printf'
cmp_dump.o(.text+0x1a0):cmp_dump.c: more undefined references to `scr_printf' follow
collect2: ld returned 1 exit status
make: *** [cmp_dump.elf] Error 1
i am also wondering what is wrong with my Dump function, heres my source for it and the command to write it.

Code: Select all

Dump(int handle, char *buf, int len)
{
    int ret;

    ret =  mcWrite(handle, buf, len);
	if&#40;ret < 0&#41;&#123;
		scr_printf&#40;"ERROR WRITING DUMP"&#41;;
		SleepThread&#40;&#41;;
	&#125;
	mcSync&#40;0, NULL, &ret&#41;;

&#125;;

THE CALL
Dump&#40;handle, 0x00100000, 200000&#41;;
thanks
User avatar
Drakonite
Site Admin
Posts: 990
Joined: Sat Jan 17, 2004 1:30 am
Contact:

Post by Drakonite »

Um, you need a type for the function.

And you need to include debug.h to use scr_ functions
Shoot Pixels Not People!
Makeshift Development
JorDy
Posts: 121
Joined: Sun Dec 11, 2005 8:45 am

Post by JorDy »

ive inlcuded debug already but what do you mean type?

aha! i worked out my problem lol stupid me =) forgot to place in the make file

Code: Select all

-ldebug
hehe sorry for the pointless topic now
misfire
Posts: 110
Joined: Mon Sep 06, 2004 7:53 am
Location: Germany

Post by misfire »

By type he means the return type of your Dump() function.
You have to use int/char/void for no return value/etc.

For example:

Code: Select all

void Dump&#40;int handle, char *buf, int len&#41;;
JorDy
Posts: 121
Joined: Sun Dec 11, 2005 8:45 am

Post by JorDy »

yes i managed to fix that and the other problem was its position in my source which caused a warning
Post Reply