C++ library files not compiling with pspsdk
C++ library files not compiling with pspsdk
Hey all,
I'm new to the psp development scene and am having some trouble using the C++ standard library files (like "string" and "math" etc).
Basically, I have set up MinPSPW to work with VC++ 2008 and I can compile the samples no worries, but on trying to include any files not part of the psp library (and things like "stdlib.h"), I get hundreds of errors.
My makefile has
INCDIR = C:/pspsdk/psp/include/c++/4.3.2/
and without it the compiler won't find the files, but like I said I get hundreds of errors, most looking like this:
1>C:/pspsdk/psp/include/c++/4.3.2/bits/basic_string.h(836) : error: expected declaration specifiers before 'template'
but there are some variations.
I'm assuming I have something setup incorrectly or it's because I'm not using cygwin and all that to do it (honestly, I've tried that before but being able to use VC++ and build from it is much more appealing).
If anybody can give some suggestions I'd greatly appreciate it :)
Thanks in advance,
Jonathan
I'm new to the psp development scene and am having some trouble using the C++ standard library files (like "string" and "math" etc).
Basically, I have set up MinPSPW to work with VC++ 2008 and I can compile the samples no worries, but on trying to include any files not part of the psp library (and things like "stdlib.h"), I get hundreds of errors.
My makefile has
INCDIR = C:/pspsdk/psp/include/c++/4.3.2/
and without it the compiler won't find the files, but like I said I get hundreds of errors, most looking like this:
1>C:/pspsdk/psp/include/c++/4.3.2/bits/basic_string.h(836) : error: expected declaration specifiers before 'template'
but there are some variations.
I'm assuming I have something setup incorrectly or it's because I'm not using cygwin and all that to do it (honestly, I've tried that before but being able to use VC++ and build from it is much more appealing).
If anybody can give some suggestions I'd greatly appreciate it :)
Thanks in advance,
Jonathan
-
- Posts: 388
- Joined: Tue Aug 12, 2008 12:46 am
Yeah no worries.
Here's the makefile:
Now the program code compiles unless I add a line to include one of the files I want to use. For example:
#include <string>
will cause hundreds of errors... literally, about 700+
The full program code is just one of the samples (celshading) that I have been playing around with just to see what the PSP can do ;)
The includes of the file look like this:
Thanks for the quick reply. I hope this helps you to help me ;)
Jonathan
Here's the makefile:
Code: Select all
TARGET = celshading
OBJS = lightmap.o celshading.o ../common/callbacks.o
INCDIR = C:/pspsdk/psp/include/c++/4.3.2
CFLAGS = -G0 -Wall -O2
CXXFLAGS = $(CFLAGS) -fno-exceptions -fno-rtti
ASFLAGS = $(CFLAGS)
LIBDIR =
LDFLAGS =
LIBS= -lstdc++ -lpspgum -lpspgu -lm
EXTRA_TARGETS = EBOOT.PBP
PSP_EBOOT_TITLE = Celshading Sample
PSPSDK=$(shell psp-config --pspsdk-path)
include $(PSPSDK)/lib/build.mak
lightmap.o : lightmap.raw
bin2o -i lightmap.raw lightmap.o lightmap
#include <string>
will cause hundreds of errors... literally, about 700+
The full program code is just one of the samples (celshading) that I have been playing around with just to see what the PSP can do ;)
The includes of the file look like this:
Code: Select all
#include <pspkernel.h>
#include <pspdisplay.h>
#include <pspdebug.h>
#include <stdlib.h>
#include <stdio.h>
#include <math.h>
#include <string.h>
#include <pspctrl.h>
#include <pspgu.h>
#include <pspgum.h>
#include <string>
#include "../common/callbacks.h"
PSP_MODULE_INFO("Celshading", 0, 1, 1);
PSP_MAIN_THREAD_ATTR(THREAD_ATTR_USER);
Jonathan
-
- Posts: 388
- Joined: Tue Aug 12, 2008 12:46 am
Ok turns out one big problem was that I missed one of the first errors... it was a missing file.
So now I'm left with 38 errors (from including <string>), all of which are:
1. error: expected '=', ',', ';', 'asm' or '__attribute__' before 'std' OR
2. error: expected '=', ',', ';', 'asm' or '__attribute__' before '__gnu_cxx' OR
3. error: expected identifier or '(' before string constant
I thought this might mean errors in the code but I really don't know. The errors are located when this is encountered (errors 1 and 2):
_GLIBCXX_BEGIN_NAMESPACE(X)
where:
# define _GLIBCXX_BEGIN_NAMESPACE(X) namespace X _GLIBCXX_VISIBILITY_ATTR(default) {
and a couple for this too (error 3):
extern "C++" {
I've not had experience with gcc errors before so I'm really not sure what I'm looking for and I can't find anything to help on these.
Thanks again for any help anyone can give :)
Jonathan
So now I'm left with 38 errors (from including <string>), all of which are:
1. error: expected '=', ',', ';', 'asm' or '__attribute__' before 'std' OR
2. error: expected '=', ',', ';', 'asm' or '__attribute__' before '__gnu_cxx' OR
3. error: expected identifier or '(' before string constant
I thought this might mean errors in the code but I really don't know. The errors are located when this is encountered (errors 1 and 2):
_GLIBCXX_BEGIN_NAMESPACE(X)
where:
# define _GLIBCXX_BEGIN_NAMESPACE(X) namespace X _GLIBCXX_VISIBILITY_ATTR(default) {
and a couple for this too (error 3):
extern "C++" {
I've not had experience with gcc errors before so I'm really not sure what I'm looking for and I can't find anything to help on these.
Thanks again for any help anyone can give :)
Jonathan
Wow. I can't believe I let that slip past me...
I guess that's one thing that can happen if you're using other files instead of creating your own. Teach me to try out samples :P
Thanks very much for the basic advice jojojoris. I'll admit at first I thought it was a rather pointless comment...
Again thanks for the help guys :)
Jonathan
I guess that's one thing that can happen if you're using other files instead of creating your own. Teach me to try out samples :P
Thanks very much for the basic advice jojojoris. I'll admit at first I thought it was a rather pointless comment...
Again thanks for the help guys :)
Jonathan