forums.ps2dev.org Forum Index forums.ps2dev.org
Homebrew PS2, PSP & PS3 Development Discussions
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

using namespace or class?

 
Post new topic   Reply to topic    forums.ps2dev.org Forum Index -> PSP Development
View previous topic :: View next topic  
Author Message
x2cube



Joined: 11 Oct 2005
Posts: 7

PostPosted: Sun Oct 16, 2005 6:16 am    Post subject: using namespace or class? Reply with quote

How do I put a namespace or class in my project?

I tried this:
Code:

namespace ABC
{
class PSPabc
{
int i;
};
}


but some errors arose:
Code:

psp-gcc -I. -I/usr/local/pspdev/psp/sdk/include -O2 -G0 -Wall   -c -o main.o main.c
In file included from main.c:20:
main.h:1: error: syntax error before 'ABC'
main.h:2: error: syntax error before '{' token
make: *** [main.o] Error 1


what should I do?
Back to top
View user's profile Send private message
CyberBill



Joined: 26 Jul 2005
Posts: 86
Location: Redmond, WA

PostPosted: Sun Oct 16, 2005 6:44 am    Post subject: Reply with quote

Dont use .c, use .cpp.

You probably need to change some stuff in your makefile to allow for C++ code, too.

But that is the correct syntax.
Back to top
View user's profile Send private message AIM Address MSN Messenger
x2cube



Joined: 11 Oct 2005
Posts: 7

PostPosted: Sun Oct 16, 2005 6:52 am    Post subject: Reply with quote

CyberBill wrote:
Dont use .c, use .cpp.

You probably need to change some stuff in your makefile to allow for C++ code, too.

But that is the correct syntax.


thanks for the help!
Back to top
View user's profile Send private message
Paco



Joined: 09 Oct 2005
Posts: 54

PostPosted: Sun Oct 16, 2005 8:20 am    Post subject: Reply with quote

CyberBill wrote:
You probably need to change some stuff in your makefile to allow for C++ code, too.

At worst a LIBS = -lstdc++, probably needed for STL, new / delete and abstract methods.
_________________
Paco
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    forums.ps2dev.org Forum Index -> PSP Development All times are GMT + 10 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group