the makefile from the tutorial already has the line:
include $(CCBASE)/gp32.mk
and gp32.mk seems to contain the rest of the stuff you pasted...
So I made a set of .h / .cpp files containing the definition and implementation of a simple class and then included the .h file in my main .cpp file (the one from the tutorial that was originally just a .c file)...
This gives me all kind of compilation errors (copy / pasted at the end of this msg) - I don't think I understood your instructions ?
My main problem may be that I know next to nothing about c / c++ makefiles etc but if I could just get a setup that would let me compile and run my c++ proggies I wouldn't really have to bother with that as of yet ?
I changed this line in the makefile:
gpmain.o: gpmain.c
into this
gpmain.o: gpmain.cpp
which allowed me to compile and run the original files from the tutorial after changing the gpmain.c file to gpmain.cpp, the following errors showed up after including the .h file from the simple class I did:
C:\devkitadv\test>make
c:/devkitadv/bin/arm-agb-elf-gcc -DLITTLE_ENDIAN -DGP32 -W -Wall -ansi -pedanti
-mcpu=arm9tdmi -mtune=arm9tdmi -O3 -mstructure-size-boundary=32 -finline-funct
ons -fomit-frame-pointer -mno-thumb-interwork -fno-exceptions -fno-common -fno-
uiltin -fshort-enums -ffast-math -fshort-double -fexpensive-optimizations -mapc
-Ic:/devkitadv/arm-agb-elf/include/gp32 -Ic:/devkitadv/arm-agb-elf/include -c
pmain.cpp
In file included from c:/devkitadv/include/g++-v3/bits/char_traits.h:39,
from c:/devkitadv/include/g++-v3/bits/std_string.h:41,
from c:/devkitadv/include/g++-v3/string:31,
from PersonHeader.h:1,
from gpmain.cpp:15:
c:/devkitadv/include/g++-v3/bits/std_cstring.h:68: `memcpy' not declared
c:/devkitadv/include/g++-v3/bits/std_cstring.h:70: `strcpy' not declared
c:/devkitadv/include/g++-v3/bits/std_cstring.h:71: `strncpy' not declared
c:/devkitadv/include/g++-v3/bits/std_cstring.h:72: `strcat' not declared
c:/devkitadv/include/g++-v3/bits/std_cstring.h:73: `strncat' not declared
c:/devkitadv/include/g++-v3/bits/std_cstring.h:82: `memset' not declared
c:/devkitadv/include/g++-v3/bits/std_cstring.h:84: `strlen' not declared
In file included from c:/devkitadv/include/g++-v3/bits/std_string.h:41,
from c:/devkitadv/include/g++-v3/string:31,
from PersonHeader.h:1,
from gpmain.cpp:15:
c:/devkitadv/include/g++-v3/bits/char_traits.h: In static member function
`static size_t std::char_traits<char>::length(const char*)':
c:/devkitadv/include/g++-v3/bits/char_traits.h:158: `strlen' undeclared (first
use this function)
c:/devkitadv/include/g++-v3/bits/char_traits.h:158: (Each undeclared identifier
is reported only once for each function it appears in.)
c:/devkitadv/include/g++-v3/bits/char_traits.h: In static member function
`static char* std::char_traits<char>::copy(char*, const char*, long unsigned
int)':
c:/devkitadv/include/g++-v3/bits/char_traits.h:170: `memcpy' undeclared (first
use this function)
c:/devkitadv/include/g++-v3/bits/char_traits.h: In static member function
`static char* std::char_traits<char>::assign(char*, long unsigned int,
char)':
c:/devkitadv/include/g++-v3/bits/char_traits.h:174: `memset' undeclared (first
use this function)
In file included from c:/devkitadv/include/g++-v3/bits/stl_algobase.h:73,
from c:/devkitadv/include/g++-v3/bits/std_memory.h:49,
from c:/devkitadv/include/g++-v3/bits/std_string.h:43,
from c:/devkitadv/include/g++-v3/string:31,
from PersonHeader.h:1,
from gpmain.cpp:15:
c:/devkitadv/include/g++-v3/bits/std_cstdlib.h: At global scope:
c:/devkitadv/include/g++-v3/bits/std_cstdlib.h:85: `calloc' not declared
c:/devkitadv/include/g++-v3/bits/std_cstdlib.h:88: `free' not declared
c:/devkitadv/include/g++-v3/bits/std_cstdlib.h:92: `malloc' not declared
In file included from gpmain.cpp:15:
PersonHeader.h:6: parse error before `nm'
PersonHeader.h:8: `string' was not declared in this scope
PersonHeader.h:8: parse error before `)' token
PersonHeader.h:11: parse error before `)' token
PersonHeader.h:15: 'string' is used as a type, but is not defined as a type.
gpmain.cpp: In function `void GpMain(void*)':
gpmain.cpp:34: warning: unused parameter `void*arg'
make: *** [gpmain.o] Error 1
The included .h / .cpp files with the simple class have been tested without any issues using the default compiler in Dev-C++ to do a windows .exe btw...
The answers are probably obvious to anyone with a deeper knowledge of c++ etc. - whoever gets me out of this mess and started doing some c++ gp32 development earns a lifetime place close to my heart - in a manly platonic kind of way of course ;-)
Cheers
/motten "the clueless c-noob"