gbadev.org forum archive

This is a read-only mirror of the content originally found on forum.gbadev.org (now offline), salvaged from Wayback machine copies. A new forum can be found here.

Beginners > DevKitARM r13 Compile errors

#46218 - danvx6 - Tue Jun 21, 2005 8:03 pm

Hello.

I am having some trouble compiling my source code with DevKitARM, the code compiles fine with DevKitAdvance, but DKARM give me warnings.

The warnings I get are:

In file included from pong.c:4:
bg0.h:4:1: warning: "/*" within comment
...
pong.c: In function `main':
pong.c:106: warning: implicit declaration of function `memcpy'
...
pong.c: In function `MoveAI':
pong.c:392: warning: implicit declaration of function `rand'
...

I know that I can eliminate the comment warnings by editing my .h files (although a quicker way would be nice) but I do not know how to eliminate the function warnings. The code compiles with no warnings in DevKitAdvance, which bothers me. Any help is appreciated, thanks.

#46222 - _Dan - Tue Jun 21, 2005 9:23 pm

Quote:
warning: implicit declaration of function `memcpy'

One possible cause is if you have not included the header file containing that function (string.h I think).

#46229 - wintermute - Tue Jun 21, 2005 11:43 pm

#include <stdlib.h> for rand
#include <string.h> for memcpy

The error checking in gcc 3.4.x is more stringent than earlier versions and usually shows up a shedload of potential problems in code written for devkitadvance.

#46240 - danvx6 - Wed Jun 22, 2005 4:05 am

Thanks! I was pretty sure that i needed to include headers for those, but I wasn't sure which ones.

There is still the comment issue, which I know I can solve by deleting the decorative pattern at the top of my .h files (which are created by pcx2sprite). I have a lot of those, so does anyone know a quicker way?

Again, thanks for the help!