Jeriicho / iphone-gcc

Automatically exported from code.google.com/p/iphone-gcc
1 stars 0 forks source link

iostream not working out of the box #5

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
Hello,
I have ipod 1g 3.0 sw. I was able to compile hello world and some cocoa touch 
apps with user 
interface and advance features. I have copied header files to 
usr/local/include, also frameworks. C, 
objective c works great, but not c++. I assume the problem might be the 
compiler flags. Any ideas?
??

For the IDE I am using Backgrounder for a fast switch between termainal.app and 
iFile. Would be 
nice to have it all in one app. Also, Erica Sadun's "launch" command line 
utility is not working on 
3.0.

Original issue reported on code.google.com by radif.sharafullin@gmail.com on 12 Aug 2009 at 10:30

GoogleCodeExporter commented 8 years ago
This is most likely the same problem as Issue #4 which you reported earlier, so 
I'll
repost my response here in case it helps people searching:

I had the same problem, the headers were on my system, but gcc/g++ was not 
finding
them. What I did was first of all find where the file iostream is located:

$> find / -name "iostream"
/private/var/include/c++/4.0.0/iostream
/private/var/include/gcc/darwin/3.3/c++/iostream
/private/var/include/gcc/darwin/3.3-fast/c++/iostream

Then, you need to include one of those paths in your g++ arguments. So in your 
case
you'd do:

$> g++ helloi.cpp -I/private/var/include/c++/4.0.0/ -o helloi

After doing this, it seemed that it was still not finding the file 
bits/c++config.h,
so again I did a find on that file. For me it came up with a bunch of matches, 
one of
which was in /private/var/include/c++/4.0.0/i686-apple-darwin9/, so I modified 
my g++
command to be the following:

$> g++ helloi.cpp -I/private/var/include/c++/4.0.0/
-I/private/var/include/c++/4.0.0/i686-apple-darwin9/ -o helloi

After that, it compiled fine, and I was able to print something with cout. I 
hope
this helps you and any others that are having this problem!

Original comment by jeremy.g...@gmail.com on 19 Oct 2009 at 5:10