 |
forums.ps2dev.org Homebrew PS2, PSP & PS3 Development Discussions
|
| View previous topic :: View next topic |
| Author |
Message |
Barts_706

Joined: 24 Jan 2006 Posts: 38
|
Posted: Tue Jul 18, 2006 11:47 pm Post subject: Questions about includes |
|
|
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 |
|
 |
JesusXP
Joined: 17 Jan 2006 Posts: 80 Location: Ontario, Canada
|
Posted: Wed Jul 19, 2006 3:30 am Post subject: |
|
|
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
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 |
|
 |
danzel
Joined: 04 Nov 2005 Posts: 182
|
Posted: Wed Jul 19, 2006 6:48 am Post subject: |
|
|
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 |
|
 |
|
|
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
|