The ModMyTM Family of Sites:
ModMyMotoModMyiModMyGphone




 
 
Register or Connect with Facebook

Discuss AppStore Apps | Browse / Search Cydia | MMi Cydia Stats




  Apple Forums & iPhone Forums, Mods, Hacks, News, Themes, Downloads, and more! | ModMyi.com > 3rd Party Apps For iPhone | iPod Touch > iPhone / iPod Touch SDK | Development Discussion
Reply
 
LinkBack Thread Tools Display Modes
  #16  
Old 10-04-2009, 04:33 PM
What's Jailbreak?
 
Join Date: Jan 2008
Posts: 15
Thanks: 3
Thanked 0 Times in 0 Posts

>.< glad everyone else is having so much luck, all I've done is install the compiler and fake-libgcc (none of the c++ stuff) and it's still not able to find stdio.h. I've been looking for the directory that the header files need to be in to make sure there's at least a symlink but I can't find where they're supposed to be. Any help would be great :-D
Digg StumbleUpon Delicious Reddit Newsvine Google Yahoo Thanks Reply With Quote
  #17  
Old 10-18-2009, 11:21 AM
What's Jailbreak?
 
Join Date: Oct 2009
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts

For the headers, following the directions on Developing for the iphone using the open toolchain and SDK 2.0 headers - antirez weblog, get the headers from MEGAUPLOAD - The leading online storage and file delivery service. Extract them on your phone, and copy the contents into /usr/include, or some other location in the include path. It should then be able to find stdio.h.

Another thing to note, in case anyone is having problems like I did, is that you have to sign the application in order for it to run. Otherwise you will get 'Killed' written to stderr every time you try to run your app. To run it, build your program first (i.e. gcc main.c -o testApp), then do:
$> ldid -S ./testApp

Last edited by JeremyG; 10-18-2009 at 11:21 AM.. Reason: Automerged Doublepost
Digg StumbleUpon Delicious Reddit Newsvine Google Yahoo Thanks Reply With Quote
  #18  
Old 10-18-2009, 11:58 PM
What's Jailbreak?
 
Join Date: Jan 2008
Posts: 15
Thanks: 3
Thanked 0 Times in 0 Posts

-_-

Thanks for the help Jeremy, I'm having an error I can't explain now though. I tried building a 6 line hello world app from the Terminal.app using 'gcc -o test test.c'. I got about 50 lines of errors, the compiler was actually declaring that there were errors within stdio.h

So I wanted to get a copy of the error so I could paste it here, and when I ssh'd into my ipod and ran the exact same command, the program built, then ran without needing to be signed. I can't imagine what is different, ssh should behave exactly like using the terminal from the ipod, but sure as hell it's giving me errors from terminal.app and building fine from ssh.

-_- is all I can say right now. Can anyone think of any reason at all that ssh would produce different results than Terminal.app?

I'm trying to figure out how to copy the errors over, but like I said it's mostly 'finding' errors in stdio.h itself. Actually, I just looked again and the only error that is actually in my program is 'test.c:6: error: expected '{' at end of input' which quite simply doesn't make any damn sense. It's on the same line as my closing brace. Blah to this mess, I can't imagine what's wrong I recently restored less than a month ago its a pretty fresh install.
Digg StumbleUpon Delicious Reddit Newsvine Google Yahoo Thanks Reply With Quote
  #19  
Old 10-19-2009, 12:23 AM
What's Jailbreak?
 
Join Date: Oct 2009
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts

I normally build from ssh, but I tried from Terminal.app to see what would happen. I get errors too. The problem is that with ssh I log in a root user, whereas with Terminal.app I am logged on as 'mobile', which does not have root access, and so apparently does not have access to the include directories on my system. So, if it's important that you can build in Terminal.app, either change permissions of the files, change your /etc/group file to give mobile user admin, or login with root with su. Glad you were able to build your app though.
Digg StumbleUpon Delicious Reddit Newsvine Google Yahoo Thanks Reply With Quote
  #20  
Old 10-19-2009, 12:00 PM
What's Jailbreak?
 
Join Date: Jan 2008
Posts: 15
Thanks: 3
Thanked 0 Times in 0 Posts

AHA!!

I didn't even think about the fact that I was logging in as root. Awesome. Finally got it to build, thanks so much for the help man, now I can code whenever I get a good idea, and I've got an iTouch so when I don't have internet I have a new toy to play with too.

Did you have any problems compiling c++? It's not finding any of the headers either, and I'm root this time I installed the 'iPhone OS C/C++ compiler' and 'C++ Standard Library' packages from Cydia but still getting the same problem, and the article you posted doesn't have anything about C++. I'm gonna mess with putting the headers in different places and see if g++ can find them, I'll post if I have any success.

Last edited by kestl; 10-19-2009 at 12:17 PM..
Digg StumbleUpon Delicious Reddit Newsvine Google Yahoo Thanks Reply With Quote
  #21  
Old 10-19-2009, 01:21 PM
What's Jailbreak?
 
Join Date: Oct 2009
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts

Yes, I also had big problems compiling C++ code. I couldn't find anyone else who posted a solution, so I ended up digging for several hours yesterday until I finally got it. I put the solution up on a blog entry at jeremyg: Building c/c++ applications using GCC/G++ on iPhone for others.

Basically you first find where the c++ headers are located, so search for iostream or some other c++ header. For me it is at /private/var/include/c++/4.0.0. Also, it seems that iostream etc. need the file bits/c++config.h, which for me is located at /private/var/include/c++/4.0.0/i686-apple-darwin9. So, what you have to do is add those directories to the standard C++ include path before building. Do that by setting the environment variable CPLUS_INCLUDE_PATH. So for me I do:

$> export CPLUS_INCLUDE_PATH=/private/var/include/c++/4.0.0:/private/var/include/c++/4.0.0/i686-apple-darwin9

Then you can build your c++ code with g++:

$> g++ test.cpp -o test

Hope it helps.
Digg StumbleUpon Delicious Reddit Newsvine Google Yahoo Thanks Reply With Quote
Reply

  Apple Forums & iPhone Forums, Mods, Hacks, News, Themes, Downloads, and more! | ModMyi.com > 3rd Party Apps For iPhone | iPod Touch > iPhone / iPod Touch SDK | Development Discussion

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



Go to Top
ModMyI

All times are GMT -6. The time now is 04:13 AM. Powered by vBulletin® Version 3.8.4
If you need Dedicated Server Hosting, you should check out SingleHop. | Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.3.0 Copyright © 2007-09 by ModMy, LLC. All rights reserved.

iPhone News / iPhone Forums / Apple News / Apple Forums / RSS / Contact Us / / Top