Find the answer to your Linux question:
Page 2 of 2 FirstFirst 1 2
Results 11 to 16 of 16
gnu gcc without a doubt! It is very high quality and stable. It adheres to the standard very well. Intel has a good Fortran compiler that is free to Linux ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #11
    Linux Newbie
    Join Date
    Feb 2005
    Location
    Texas
    Posts
    168

    gnu gcc without a doubt! It is very high quality and stable. It adheres to the standard very well.

    Intel has a good Fortran compiler that is free to Linux users for non-commercial use.

    There is also an up and comming Fortran 95 compliant compiler based on gcc that is quite good. It is called G95. It is open source and works quite well.

    Jeff
    Registered Linux User #391940

  2. #12
    Just Joined!
    Join Date
    Jun 2005
    Posts
    5
    guys, not to sound stupid, btu how do i complie and run a program, which is save in the text file called hello.cpp


    appreciate the help !

  3. #13
    Linux Guru Cabhan's Avatar
    Join Date
    Jan 2005
    Location
    Seattle, WA, USA
    Posts
    3,252
    You would do it as follows:
    Code:
    g++ -Wall -o hello hello.cpp
    This does the following:

    g++ - The GNU C++ Compiler
    -Wall - Show all warnings
    -o hello - Call the outputted binary "hello" (the default is a.out)
    hello.cpp - The source code to compile

    Hope that helps!

  4. #14
    Just Joined!
    Join Date
    Jun 2005
    Posts
    5
    thanx cabhan..

    could you plz explain the -o option a bit more plz.

  5. #15
    Linux Guru Cabhan's Avatar
    Join Date
    Jan 2005
    Location
    Seattle, WA, USA
    Posts
    3,252
    Sure.

    Let's say that I have the following:
    Code:
    hello.cpp:
    
    #include <iostream>
    using namespace std;
    
    int main&#40;&#41;
    &#123;
        cout << "Hello, world!" << endl;
    
        return 0;
    &#125;
    As noted, this is saved as hello.cpp.

    Now then, without the -o option, I would run the following command:
    Code:
    g++ -Wall hello.cpp
    After this compiles, there will be an executable file called "a.out" that, when executed, will print "Hello, world!".
    Code:
    alex@tux ~/test $ ./a.out
    Hello, world!

    However, let's say that I compile this with the -o option:
    Code:
    g++ -Wall -o hello hello.cpp
    In this case, rather than creating a file called "a.out", a file called "hello" is created that accomplishes the same purpose:
    Code:
    alex@tux ~/test $ ./hello
    Hello, world!

    So basically, the default binary name is "a.out". The "-o" option allows you to override that default, so the outputted binary can be called whatever you want.

  6. #16
    Just Joined!
    Join Date
    Jun 2005
    Posts
    5
    thanx a lot cabhan

Page 2 of 2 FirstFirst 1 2

Posting Permissions

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