Welcome to the MacNN Forums.

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

You are here: MacNN Forums > Software - Troubleshooting and Discussion > Developer Center > Running builds in Terminal by default?

Running builds in Terminal by default?
Thread Tools
Junior Member
Join Date: Jan 2001
Location: California, USA
Status: Offline
Reply With Quote
Mar 15, 2003, 03:03 PM
 
Hey!

Is there a way to make Project Builder automatically run project builds in the terminal rather than the run window? I ask because I'm writing a C++ database app for my Comp Sci class that uses the system("clear") call that only works when the application is running in the terminal.

Aditionally, is there a C++ call that lets you determine what OS your application is running on so I can have the app call system("cls") when it's running on a PC and system("clear") when it's running on OS X? Thanks!

-Joel
     
Dedicated MacNNer
Join Date: Nov 2000
Status: Offline
Reply With Quote
Mar 17, 2003, 01:49 PM
 
Use the C pre-processor. GCC defines __APPLE__ to be 1 when compiling on OS X.

Code:
#ifdef __APPLE__ system("clear") #else system("cls") #endif

edit: forgot closing #endif
     
   
Thread Tools
Forum Links
Forum 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
Top
Privacy Policy
All times are GMT -5. The time now is 08:54 PM.
All contents of these forums © 1995-2011 MacNN. All rights reserved.
Branding + Design: www.gesamtbild.com
vBulletin v.3.8.7 © 2000-2011, Jelsoft Enterprises Ltd., Content Relevant URLs by vBSEO 3.3.2