GCC on Mac...unable to find

I am talking a course in C++. I was told that GCC 4.0 exists on the mac. It comes under Xcode. But I am unable to find this compiler to run my C++ code. In fact I download Xcode and reinstalled it. To search for GCC I did the following:
--Open Xcode
--File > New Project
I do not find GCC in the list of things there are...How do I open C++ compiler on the mac and run my programs? Please help!

No. GCC is only a compiler. If you need an editor, try TextWrangler. It's free. Better still, use Xcode, Apple's free Integrated Development Environment (IDE). It will invoke "gcc" for C programs (you write), and "g++' for C++ programs.
Technically, GCC is not in Xcode. GCC is a program (one of many) invoked when you compile your program. Xcode "knows" what program / command to invoke by looking at the file extension (.c = C program, .cc or .cpp = C++ program, .m = Objective-C, etc).
You can trace GCC's lineage back to its UNIX roots, where the closest thing to an IDE is Emacs. After all, Mac OS X is just a pretty face on top of BSD UNIX. IDEs are great, but knowing how to use vi and emacs, make files and command-line compilers is what (all?) programmers should learn (IMHO).
Try this on your command line / terminal:
cat>hello.c
#include <stdio.h>
int main()
printf("Hello, world.\n");
return 0;
<Ctrl-D>
gcc -o hello hello.c
./hello
The "cat" command takes whatever you type and redirects it to a file named "hello.c".
Hitting Control-D in your terminal means end-of-file (it closes the "hello.c" file).
The following command, gcc, compiles "hello.c", creating an executable program named "hello".
The final command "./hello" runs your program. It should say "Hello, world." and terminates.
Congratulations! You just created and ran the obligatory Hello program.
To debug a program, use "gdb". Again, using Xcode would simplify things. Like "gcc", "gdb" is a command-line program, but Xcode putd a pretty interface on it. Again, it'd probably be a good idea to learn how to use "gdb" in all its native, command-line glory.

Similar Messages

  • Hi, I am using my icloud on my iphone but am unable to find it on my mac book pro. It's not under my system preferences like it shows under the setup. Can I download it again? Or something. I just need to backup some files on my computer and am unable.

    Hi, I am using my icloud on my iphone but am unable to find it on my mac book pro. It's not under my system preferences like it shows under the setup. Can I download it again? Or something. I just need to backup some files on my computer and am unable.

    The minimum requirement for iCloud is Lion 10.7.5 (Mavericks preferred): the iCloud Preference Pane does not appear on earlier systems - the MobileMe pane appears on Lion and earlier but is now non-functional - you cannot now open or access a MobileMe account.
    To make use of iCloud you will have to upgrade your Mac to Lion or Mavericks, provided it meets the requirements.
    The requirements for Lion are:
    Mac computer with an Intel Core 2 Duo, Core i3, Core i5, Core i7, or Xeon processor
    2GB of memory
    OS X v10.6.6 or later (v10.6.8 recommended)
    7GB of available space
    Lion is available in the Online Apple Store ($19.99). Mountain Lion (10.8.x) is also available there at the same price but there seems little point as the system requirements are the same for Mavericks (10.9.x) - which is free - unless you need to run specific software which will run on Mountain Lion only.
    The requirements for Mountain Lion and Mavericks are:
    OS X v10.6.8 or later
    2GB of memory
    8GB of available space
      and the supported models are:
    iMac (Mid 2007 or newer)
    MacBook (Late 2008 Aluminum, or Early 2009 or newer)
    MacBook Pro (Mid/Late 2007 or newer)
    Xserve (Early 2009)
    MacBook Air (Late 2008 or newer)
    Mac mini (Early 2009 or newer)
    Mac Pro (Early 2008 or newer)
    It is available from the Mac App Store (in Applications).
      You should be aware that PPC programs (such as AppleWorks) will not run on Lion or above; and some other applications may not be compatible - there is a useful compatibility checklist at http://roaringapps.com/apps:table

  • I received a psd file created in CS6 for MAC, I am unable to find the layers when I open it in photoshop in Windows. What can i do to edit the files?

    I received a psd file created in CS6 for MAC, I am unable to find the layers when I open it in photoshop in Windows. What can i do to edit the files? What can be done so that I can either open and see the layers or how can the sender save it in a way that it doesn't "merge" the layers in some way to just one?

    Could try saving as tiff provided layers and transparency are chosen at the time of saving. But it's hard to give a definitive answer as it depends on the final usage. For example PSD's tend to work better in applications like In Design in comparison with tiff.

  • HELP MY MAC IS BROKE AND WONT START (unable to find driver ACPI)

    Someone please help. I was reinstalling a printer driver and my power cut off while it was installing. now the computer wont start and i get this message below... I read to use the install dvd but my CD drive is broke and wont take cds. I did manage to hook it up to my dads computer with target disk mode so i can access files. his computer is a windows though. i do have a copy of the Leopard install cd saved as a DMG on his computer and a 8gb flash to boot it but i cant format the flash drive to be mac extended journaled GUID from his computer.IS there a program to do this???I dont know what needs to be fixed or where i can get this acpi driver? can anyone help because i dont have any money to get this fix and i need my mac for college which im starting soon.
    This is the error message
    panic(cpu 0 caller 0x004384FF): "unable to find driver for this platform: \"ACPI\".\n"@/SourceCache/xnu/xnu-1228.12.14/iokit/Kernel/IOPlatformExpert.cpp: 1407
    (That is the first line. It goes on to say...)
    Debugger called: <panic>
    Backtrace (CPU 0), Frame : Return Address (4 potential args on stack)
    (then there are 7 lines that start with 0x2f5d3 followed by)
    Backtrace terminated-invalid frame pointer 0
    BSD process name corresponding to current thread: Unknown
    Mac OS version:
    Not yet set
    Kernel version:
    Darwin Kernel Version 9.7.0: Tue Mar 31 22:52:17 PDT 2009; root:xnu-1228.12.14~1/RELEASE_I386
    System uptime in nanoseconds: 180744654
    It also says 64bit mode enabled and i thought macs were 32bit.
    I also tried resetting the pvram or whatever its called and no luck
    Someone please help!!!!

    I know this isn't what you really want to hear but I'd recommend taking it in to an authorized repair location or your local Apple Store to get the Superdrive repaired or replaced so you can do an install? I don't believe you will be able load from your Dad's Window's machine. However you might be able to from an external DVD drive.
    Also I might recommend getting a UPS so if you have similar issues you will have enough power to do a proper shutdown.
    Regards,
    Roger

  • I own a MAC Pro 3,1 (early 2008) and am running Mavericks 10.9.3 with no problems. I would like to add an I/O card to add USB 3 functionality or ESATA functionality but am unable to find a compatible card. As such my question...can I do this and if so wha

    I own a MAC Pro 3,1 (early 2008) and am running Mavericks 10.9.3 with no problems. I would like to add an I/O card to add USB 3 functionality or ESATA functionality but am unable to find a compatible card. As such my question...can I do this and if so what is the best card?
    Thank you

    Have you looked at the previous discussions listed on the right side of this page under the heading "More Like This"?
    Also see:
    https://discussions.apple.com/thread/6282459?tstart=0

  • HT6114 i have a mac mini that wont boot up and the screen says unable to find driver for this platform: \ powermac10.2 it also says mac os version not yeet set...how can i fix it

    the mac mini wont boot up it says you need to restart yuor computer and that its unable to find river for platform can i download software free from the internet to fix this

    What OS were you using on the mini before this problem started? If 10.7.8.9, boot to the Recovery Volume (command - R on a restart or hold down the option key during a restart and select Recovery Volume). Run Disk Utility Verify/Repair and Repair Permissions. Then reinstall the OS.
    OS X Recovery
    OS X Recovery (2)

  • Where did my pics go ??? Transferred pics from memory card to Mac Pro and lost pics on memory card and unable to find on Mac

    where did my pics go. Transferred 40-50- pic from camera memory card to Mac via  slot; lost pics on memory card and unable to find anywhere in Mac. May have gone to Open Office as Data . Is that possible and if so can I get pics back or if not so ,where could they be????

    First place to check is in the iPhoto library. If the images were imported there then they will be visible in the previews created.
    The physical location of image files in iPhoto is quite buried in folders within folders. So, if you want to copy them then select all of the ones needed from the previews and copy from iPhoto to a new location, preferably a new folder in the Pictures folder.
    The other app that might have transferred the files is Image Capture. It would download files from cards or cameras. Launch this app and look in the preferences to see the default location of transferred files.

  • [SOLVED]Arch hangs on startup, unable to find root device Mac

    For posterity, I'm editing the post with how I solved both issues.
    Hi All,
    I'm trying to dual boot Arch and Mac 10.4.11 on an old 32 bit MacbookPro1,1. I did the following:
    1) Partitioned Drive with an EFI partition, Mac partition, root partition, home partition, and swap partition
    2) Installed Mac to its respective partition
    3) Installed rEFInd to the ESP
    4) Confirmed the rEFInd was able to boot Mac
    5) Installed Arch to the root partition and mounted the separate /home and swap partitions
    6) Followed the beginners guide for the rest of the installation
    7) Did NOT install a bootloader
    - I am just using rEFInd to boot Arch; I installed Ubuntu in a similar fashion on my other (2013) MBP. I didn't create a mount point for /boot, did not install GRUB, and it works perfectly
    8) Rebooted. Selected the Arch installation from the rEFInd menu, it launched, and shortly after I am presented with this message:
    ERROR: device 'UUID=142bf...777' not found. Skipping fsck.
    ERROR: Unable to find root device 'UUID=142bf...777'.
    You are being dropped to a recovery shell
    Type 'exit' to try and continue booting
    sh: can't access tty: job control turned off
    [rootfs /]#
    I then booted to the live cd to try and do some noob detective work:
    # mkdir /mnt/arch
    # mount /dev/sda3 /mnt/arch
    # cat /mnt/arch/etc/fstab
    # cat /mnt/arch/etc/mkinitcpio.conf # my searching suggested the HOOKS might be the issue
    HOOKS="base udev autodetect modconf block filestystems keyboard fsck"
    Here is the output of /etc/fstab
    I am including the outputs of
    # lsblk
    # fdisk -l /dev/sda
    # blkid
    as a photo.
    EDIT:
    I was able to use rEFInd's line editor to boot with the fallback image. Everything went well for the first five seconds and I got past the previously mentioned failure. However, it is now stuck at
    [ OK ] Started Rebuild Hardware Database
    I booted again, and it froze at:
    [ OK ] Started udev Kernel Device Manager.
    I did this a few more times and it froze at:
    [ OK ] Reached Target Swap.
    [ OK ] Reached Target Sound Card.
    and
    [ OK ] Started Flush Journal to Persistent Storage.
    Why is it freezing at different points each time I boot (with fallback)?
    EDIT 2 [HALF SOLVED]:
    By switching the order of the hooks ( I still have no idea what they do) as per this link, I am now able to boot in normal (not fallback) mode. For the record, here is what I did:
    # mkdir /mnt/arch
    # mount /dev/sda3 /mnt/arch
    # chroot /mnt/arch/ /bin/bash/
    # nano /etc/mkinitcpio.conf # here I put block before autodetect in the hooks line (Why isn't this the default if it prevents the system from booting?)
    # mount -t proc proc /proc
    # mount -t sysfs sys /sys
    # mount -t devtmpfs udev /dev
    # mkinitcpio -p linux
    I then rebooted and it started up, except now it is freezing at various points in the startup sequence like the fallback image did above. What could be causing this issue?
    EDIT 3 [SOLVED]
    I don't know why this worked, but after following this advice I am now able to boot into login. Steps:
    1) Select Arch in the rEFInd menu and press F2
    2) Press F2 again to edit the boot parameters
    3) Scan to the end of the line and add
    nomodeset
    after the linux image.
    Last edited by sonarforte (2015-04-25 22:46:22)

    Yes, the UUID displayed in the error message upon bootup is the same as the UUID for /dev/sda3 as found when running blkid which is the same as the UUID for the root partition in /etc/fstab.

  • Unable to find bootcamp in control panel after upgrade to Mac OS X 10.6.8, please help.

    Unable to find bootcamp after upgrade tp Mac OS X 10.6.8, please help.

    you problem is in OS X (guessing here)
    Guess #2: you use an NTFS driver in Mac OS X
    Try OS X forum? No?
    When you do reboot into Windows - use Option key for one - and go to Windows Control Panel: Boot Camp: the Startup Disk section to change the default OS is there and works.
    It isn't "boot camp" it is Windows. Boot Camp are drivers, control panel, program to partition. What you wanted to see was "Windows" OS to change the default.
    Do you 'see' Windows volume on the Desktop as being physically there?
    Opened Disk Utility and look at the drives and volumes: Windows volumne is still present.

  • Unable to find skype in app store for Mac Pro

    unable to find skype on Mac pro App store.

    For App Store queries post here:
    https://discussions.apple.com/community/mac_app_store/using_mac_apple_store

  • Device in the data base getting PXE aborted --unable to find machine using Mac address /resouce iD

    hi
    when I deploy osd to my unknown collection iam getting PXE aborted  ..earlier we used to delete machines from sccm
    by searching query based on Mac address .and clear last pxe advertisement option , but iam finding certain machines getting PXE aborted  shows device in data base when we search these machines using mac address /resouce iD unable to find in sccm or
    sccm data base . I have found some blogs where unknown collection parameters are changed to decommissioned value from "o" to "1"
    but unable to build new unknown collection , its very difficult to delete machines from SCCM console every time when pxe aborted . machines are getting pxe aborted some way its known to SCCM ,its difficult to import machines every time before machines are
    image .is there any permanent solution to override pxe aborted ,even systems are known to SCCM ,we are in sccm 2012 infrastructure
    hoping a positive replay from all technical leads
    thanks in advance
    ankith

    Hi,
    "is there any permanent solution to override pxe aborted ,even systems are known to SCCM ,we are in sccm 2012 infrastructure"
    I think there is not a permanent solution.  
    It could help if you first run the configuration manager report to locate a particular MAC address.
    Best Regards,
    Joyce
    We
    are trying to better understand customer views on social support experience, so your participation in this
    interview project would be greatly appreciated if you have time.
    Thanks for helping make community forums a great place.

  • HT3231 why do all these pages not tell you where migration assistant is on a mac pro. they all say what to do when you have it however this is of no use if you are unable to find.

    why do all these pages not tell you where migration assistant is on a mac pro.  They all say what to do when it is on however this is of no use if you are unable to find it in the first place.

    In the Utilities folder, which is in Applications. You could also use Spotlight to search for it.
    Matt

  • I'm using matchbook pro and I'm unable to find iPhoto after upgrading to Maverick os

    I'm using matchbook pro and I'm unable to find iPhoto after upgrading to Maverick os

    Open the Mac App Store application and see if iPhoto is under your "Purchases" tab.
    Clinton

  • My mac does not find my position in maps

    Hi. I reasently discovered that my macbook pro and my ipad 2 are unable to find my current location in maps. I have turned on the feature in settings. It works on my iphone. Anyone who can give me some advise?

    - Reboot the Mac
    - Reset the iOS device. Nothing will be lost      
    Reset iOS device: Hold down the On/Off button and the Home button at the same time for at
    least ten seconds, until the Apple logo appears.
    Try another USB port
    - Try another cable
    - Inspect the dock connector on the iPod for bent or missing contacts, foreign material, corroded contacts, broken, missing or cracked plastic.

  • My MacBook Pro stated that it needed to be updated. I clicked yes to restart the computer and update but when it restarted it stays on the gray screen with the apple logo and then pops up, stating "unable to find driver for this platform." What do I do?

    My MacBook Pro stated that it needed to be updated. I clicked yes to restart the computer and update but when it restarted it stays on the gray screen with the apple logo and then pops up, stating "unable to find driver for this platform." What do I do?

    Boot into Recovery by holding down the key combination command-R at the startup chime. Release the keys when you see a gray screen with a spinning dial.
    Note: You need an always-on Ethernet or Wi-Fi connection to the Internet to use Recovery. It won’t work with USB or PPPoE modems, or with networks that require any kind of authentication other than a WPA or WPA2 Personal password.
    When the Mac OS X Utilities screen appears, follow the prompts to reinstall the Mac OS. You don't need to erase the boot volume, and you won't need your backup unless something goes wrong. If your Mac didn’t ship with Lion, you’ll need the Apple ID and password you used to upgrade, so make a note of those before you begin.
    Don't install the Thunderbolt update -- it's defective.

Maybe you are looking for

  • Reinstalling mountain lion from App Store

    My 2009 MacPro crashed badly, require a complete reinstall (reformat hard drive). It was running MountainLion. I have the Snow Leopard OSX disc, but bought the upgrade online. How can I upgrade the OSX again? Ultimately I want to restore from my Time

  • Simple Doubt in BDC

    Hi friends,    I am new to BDC .I am just trying a simple code which is written already.    This is the simple code to fill the transaction VK13 first screen.   PERFORM bdc_dynpro      USING 'SAPMV13A' '0100'.   PERFORM bdc_field       USING 'BDC_CUR

  • Order by cluse in matrix report

    Hello Friends, I have a month wise summary statment in matrix report formate, base on the following query select to_char(pvmdate,'Mon-RRRR') as pvmdate, pvtamnt,pvtwhta,pvt.lv4code I have use ORDER BY TO_DATE(PVMDATE,'Mon-RRRR') but this order by clu

  • Report Permissions -- Run existing reports but cannot read/create report

    Hey everyone, Hopefully this is a simple question. I'm trying to create a user in the RPD which has permission to run all the existing reports in a Shared folder and is able to change the filter criteria on those existing reports, however, the user c

  • In production order :

    Hi PP guru's, I will be thankfull to you if you can help me in solving this problem . During production order creation / release .we get error message that Forms are not available and i am unable to getrid off this problem and production order not ge