FAQs on Homework Assignment 1



  • I am trying to do the first lab. My code is as follows

    #include
    using namespace std;

    int main()
    {
    cout << "Hello CS 60, this is lab 1!!! "<< endl;
    return 0;
    }

    when i compile this

    csil% g++ -o first first.cpp

    everything is fine and it gives me a new command line. when i try to execute typing the following

    csil% first

    it gives me an error saying "first: command not found". What am i doing wrong?

    You should execute the program as prompt% ./first This is different from what the Professor does. But this is required if the current directory is not included in the PATH environment variable, which is the case for you. The ./ tells the shell to look for first in the current directory.

    For a quick fix, you can also do this:

    cp ~teliot/.cshrc ~
    cp ~teliot/.login ~

    then log out and log in again. After this, your commands should work without the preceding ./