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 

Questions about includes

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



Joined: 24 Jan 2006
Posts: 38

PostPosted: Tue Jul 18, 2006 11:47 pm    Post subject: Questions about includes Reply with quote

Hi,

After playing a little bit with samples from SDK and a few simple programs of my own, I started porting one or other piece of code.

I need some includes, but I am not sure where and how to get them.

In Windows I would use (well, among others) :
Quote:

#include <math.h> <- no problem with this one
#include <sstream>
#include <string>
#include <vector>
#include <limits>
#include <cassert>
#include <iomanip>


How do we include vectors? What about other STL and std c++ functions, classes and utils?

How do we add the files from this directory (see below) ?
c:\cygwin\usr\local\pspdev\include\c++\4.0.2\

I searched the forums, but I thought I'd ask nevertheless to be sure I understand it well.
Back to top
View user's profile Send private message Visit poster's website
JesusXP



Joined: 17 Jan 2006
Posts: 80
Location: Ontario, Canada

PostPosted: Wed Jul 19, 2006 3:30 am    Post subject: Reply with quote

hey dude...

just #include them like you would in Windows.. as long as they've been added to your environment (are you using Linux or Windows to code? most probably cygwin or something right?!) -- anyways.. I'm pretty sure you dont need to worry, they libraries are portable and you can use the regular c/c++ libs as long as they are set up in your environment properly when you go to compile. try compiling one of your c programs from the cygwin command line (have the file in the right dir), and run
Code:

gcc myFile.c -o myFile

than run
Code:

./myFile

and that will let you know whether or not you have the right libs installed... im sure that you would tho if you've made it this far... and also (i could be 100% wrong abot all of this :) ..but yeah, if gcc and g++ are installed, you should be fine) ... um.. respond with somethin:P
-----------------
Everything should run normally, if you just #include it... if not, then you dont have the environment set up properly..
Back to top
View user's profile Send private message MSN Messenger
danzel



Joined: 04 Nov 2005
Posts: 182

PostPosted: Wed Jul 19, 2006 6:48 am    Post subject: Reply with quote

If this code is from MS:VC 6, or some other non standard compiler then you may be missing the line "using namespace std;" after your includes.

Code:
#include <math.h>
#include <sstream>
#include <string>
#include <vector>
#include <limits>
#include <cassert>
#include <iomanip>

using namespace std;


^^ Something like that.
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