Jump to content

Recommended Posts

Posted

woo....what are you building it in? devkitpro? i jsut got a book on c and it will take me 2 or 3 weeks to memorize it (and the way you make progress that remarkebly fast) so i might be able to help

Posted

I have one more question :

 

How can i do to delete these 'warning' message :

 

1°)

 

c:/.../main.c:809: warning: 'struct sockaddr' declared inside parameter list

c:/.../main.c:809: warning: its scope is only this definition or declaration, which is probably not what you want

 

int bind(int socket,const struct sockaddr * addr, int addr_len) {;};

 

2°)

 

c:/.../main.c:1187: warning: type-punning to incomplete type might break strict-aliasing rules

c:/.../main.c:1187: warning: passing argument 5 of 'sendto' from incompatible pointer type

 

int sendto(int socket, const void * data, int sendlength, int flags, const struct sockaddr * addr, int addr_len) {... };

...

sendto(sock,sendbuf,strlen(sendbuf),0,(struct sockaddr *)&sain,sizeof(sain));

Posted

yorel: do a full rebuild and post all of the warnings somewhere - I beleive you have a problem with include paths, or you may have modified part of the lib to introduce some problems (either of these would cause all of those warnings)

 

On a side note...

fischju: I know you're trying to be helpful but you're not really helping - let people speak for themselves please.

 

-Stephen

Posted (edited)

i'm actually on my home pc ( 350Mz, 98... ) I do a rebuild tomorrow (8h30 for me in belgium ^^ ) at the university.

 

the warnings are all the same. I have two times the first one and five or six the second one. I have no more errors, so i have a beautiful "ds.gba" file.

 

EDIT : So, here all the warnings message but i doubt that it will be very usefull.

 

> "make"

main.c

c:/Projects/HelloWorld/source/main.c:809: warning: 'struct sockaddr' declared inside parameter list

c:/Projects/HelloWorld/source/main.c:809: warning: its scope is only this definition or declaration, which is probably not what you want

c:/Projects/HelloWorld/source/main.c:869: warning: 'struct sockaddr' declared inside parameter list

c:/Projects/HelloWorld/source/main.c:922: warning: 'struct sockaddr' declared inside parameter list

c:/Projects/HelloWorld/source/main.c: In function 'main':

c:/Projects/HelloWorld/source/main.c:1082: warning: type-punning to incomplete type might break strict-aliasing rules

c:/Projects/HelloWorld/source/main.c:1082: warning: passing argument 2 of 'bind' from incompatible pointer type

c:/Projects/HelloWorld/source/main.c:1110: warning: type-punning to incomplete type might break strict-aliasing rules

c:/Projects/HelloWorld/source/main.c:1110: warning: passing argument 5 of 'sendto' from incompatible pointer type

c:/Projects/HelloWorld/source/main.c:1118: warning: type-punning to incomplete type might break strict-aliasing rules

c:/Projects/HelloWorld/source/main.c:1118: warning: passing argument 5 of 'recvfrom' from incompatible pointer type

c:/Projects/HelloWorld/source/main.c:1177: warning: type-punning to incomplete type might break strict-aliasing rules

c:/Projects/HelloWorld/source/main.c:1177: warning: passing argument 5 of 'sendto' from incompatible pointer type

c:/Projects/HelloWorld/source/main.c:1187: warning: type-punning to incomplete type might break strict-aliasing rules

c:/Projects/HelloWorld/source/main.c:1187: warning: passing argument 5 of 'sendto' from incompatible pointer type

arm-elf-g++ -g -mthumb-interwork -mno-fpu -L/c/devkitPro/PAlib/lib -specs=ds_arm9.specs main.o wifi_arm7.o -Lc:/devkitPro/PAlib//lib -lpa9 -L/c/devkitPro/libnds/lib -lnds9 -o build.elf

Nintendo DS rom tool 1.24 - Oct 19 2005 20:26:11 by Rafael Vuijk (aka DarkFader)

built... HelloWorld.ds.gba

dsbuild 1.21 - Oct 19 2005

using default loader

 

> Process Exit Code: 0

> Time Taken: 00:08

 

The code is in the 'little demo game topic'. I send it to sgstair@akkit.org, too.

Edited by yorel
  • 2 weeks later...
Posted

Hi.. I am having issues linking in the library.. The Arm7 builds ok, but the arm 9 doesnt. Below is the output of make... It dies with all these undefined reference to C:\DS\projects... My path is not setup that way. I changed the makefile, and the only reference I can find in my computer to C:\DS\projects is in the.lib files themselves(I ran a grep over everything)... I think i am missing something pretty basic, but I have been staring at this for a while..

 

So if anyone has any suggestions, please send them my way!

 

Good work on the wifilib.. Looks like it will be great if I can use it!

 

 

C:\devkitPro\examples\nds\nettest>make

arm-elf-g++ -g -Wall -O2 -mcpu=arm7tdmi -mtune=arm7tdmi -fomit-frame-pointer -ffast-math -mthumb-interwork -I/c/devkitPro/libnds/include -I/c/devkitPro/wifi_lib

/include -DARM7 -c arm7_main.cpp -oarm7_main.o

 

arm-elf-g++ -g -mthumb-interwork -mno-fpu -specs=ds_arm7.specs arm7_main.o /c/devkitpro/wifi_lib/lib/dswifi7.lib -L/c/devkitPro/libnds/lib -lnds7 -oarm7.elf

arm-elf-objcopy -O binary arm7.elf arm7.bin

arm-elf-g++ -g -Wall -O2 -mcpu=arm9tdmi -mtune=arm9tdmi -fomit-frame-pointer -ffast-math -mthumb-interwork -I/c/devkitPro/libnds/include -I/c/devkitPro/wifi_lib/include -DARM9 -c arm9_main.cpp -oarm9_main.o

 

 

 

arm-elf-g++ -g -mthumb-interwork -mno-fpu -specs=ds_arm9.specs arm9_main.o /c/devkitpro/wifi_lib/lib/dswifi9.lib -L/c/devkitPro/libnds/lib -lnds9 -o arm9.elf

c:/devkitpro/wifi_lib/lib/dswifi9.lib(sgIP_memblock.o): In function `sgIP_memblock_Init':

c:/DS/projects/wifi_lib/arm9/source/sgIP_memblock.c:60: undefined reference to `sgIP_malloc'

c:/devkitpro/wifi_lib/lib/dswifi9.lib(wifi_arm9.o): In function `ethhdr_print':

c:/DS/projects/wifi_lib/arm9/source/wifi_arm9.c:93: undefined reference to `sgIP_dbgprint'

c:/devkitpro/wifi_lib/lib/dswifi9.lib(wifi_arm9.o): In function `Wifi_TransmitFunction':

c:/DS/projects/wifi_lib/arm9/source/wifi_arm9.c:302: undefined reference to `sgIP_dbgprint'

 

lots more undefined references follow...

Posted

Those are external functions the lib uses for debugging and such, you just need to have them declared. Put this in your arm9 code:

 

extern "C" {
void * sgIP_malloc(int size) { return malloc(size); }
void sgIP_free(void * ptr) { free(ptr); }

void sgIP_dbgprint(char * txt,...) {  //Uncomment this for debug output
/*	char buffer[256];
va_list args;
va_start(args,txt);
vsprintf(buffer,txt,args);
iprintf (buffer);
iprintf ("\n");*/
}
}

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...