| View previous topic :: View next topic |
| Author |
Message |
egorive
Joined: 22 Jun 2006 Posts: 24
|
Posted: Sun Jul 20, 2008 8:25 am Post subject: string type problem |
|
|
Hi, have try to find information about why i obtain the error when compiling my program :
**** Build of configuration Default for project HelloWorldCPP ****
make all
psp-g++ -I. -ID:/cygwin/usr/local/pspdev/psp/sdk/include -O2 -G0 -Wall -I. -ID:/cygwin/usr/local/pspdev/psp/sdk/include -O2 -G0 -Wall -fno-exceptions -fno-rtti -c -o main.o main.cpp
main.cpp: In function 'void ejemplo_estructuras()':
main.cpp:35: error: 'string' does not name a type
main.cpp:36: error: 'string' does not name a type
main.cpp:37: error: 'string' does not name a type
main.cpp:38: error: 'string' does not name a type
main.cpp:49: error: 'struct ejemplo_estructuras()::habitacion' has no member named 'piano'
.
.
.(etc)
This is the original code:
#include <pspkernel.h>
#include <pspdebug.h>
#include <string.h>
#include "OtrasFunciones.h"
#include "PruebaDeClases.h"
using namespace std;
...(etc)
void ejemplo_estructuras(){
int num_mesillas=2;
struct habitacion{
string piano;
string cama;
string mesa;
string armario;
int *mesillas;
};
...(etc)
And my makefile:
TARGET = template
OBJS = main.o OtrasFunciones.o PruebaDeClases.o
INCDIR =
CFLAGS = -O2 -G0 -Wall
CXXFLAGS = $(CFLAGS) -fno-exceptions -fno-rtti
ASFLAGS = $(CFLAGS)
LIBDIR =
LIBS = -lstdc++ -lc -lpsplibc
LDFLAGS =
EXTRA_TARGETS = EBOOT.PBP
PSP_EBOOT_TITLE = Template
PSPSDK=$(shell psp-config --pspsdk-path)
include $(PSPSDK)/lib/build.mak
main.cpp : OtrasFunciones.h PruebaDeClases.h
OtrasFunciones.cpp : OtrasFunciones.h
PruebaDeClases.cpp : PruebaDeClases.h
Perhaps I don't have the library that gives this funcionality added in my makefile but i don't know which one to chose and i have try to find information about this.. but nothing. So sorry if it is a silly question I am a newbe.
Thanks. |
|
| Back to top |
|
 |
pspZorba
Joined: 22 Sep 2007 Posts: 156 Location: NY
|
Posted: Sun Jul 20, 2008 11:35 am Post subject: |
|
|
replace
#include <string.h>
by:
#include <string> _________________ --pspZorba--
NO to K1.5 ! |
|
| Back to top |
|
 |
egorive
Joined: 22 Jun 2006 Posts: 24
|
Posted: Sun Jul 20, 2008 4:18 pm Post subject: clearing my mind... |
|
|
So ... żis the reason something close to this?
<string> is the new include for c++ which have the string type definition and so on and
<string.h> is the old c include that give us functions like strcpy or strlen.. |
|
| Back to top |
|
 |
pspZorba
Joined: 22 Sep 2007 Posts: 156 Location: NY
|
Posted: Sun Jul 20, 2008 11:07 pm Post subject: |
|
|
correct _________________ --pspZorba--
NO to K1.5 ! |
|
| Back to top |
|
 |
Jim

Joined: 02 Jul 2005 Posts: 487 Location: Sydney
|
|
| Back to top |
|
 |
|