Results 1 to 3 of 3

Thread: How to compile and execute .cpp file in Ubuntu?

  1. #1
    Join Date
    Jan 2006
    Location
    Bulgaria
    Beans
    25

    How to compile and execute .cpp file in Ubuntu?

    Sorry for the stupid question, but I can't find the right commands...
    Something like g++ file.cpp -o program01 and then?
    Tnx in advance
    Make Linux, not war!

  2. #2
    Join Date
    May 2006
    Beans
    20
    Distro
    Ubuntu Breezy 5.10

    Re: How to compile and execute .cpp file in Ubuntu?

    g++ -o file file.cpp

    should do the trick, running ./file will run your program. Best to have -Wall present as well.

  3. #3
    Join Date
    Jan 2006
    Location
    Bulgaria
    Beans
    25

    Re: How to compile and execute .cpp file in Ubuntu?

    Thank you! It's all working
    Make Linux, not war!

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •