Build

This command is not part of the porting commands. It is meant to be used as a preparation to build Cygwin Net release source package from scratch. Something like -b option in 'source build' commands in.deb and.rpm packaging managers. When you get to the screen that lets you select packages to install, find make and select it (it's probably under 'Development' or something similar). Then you'll be able to run make from the Cygwin bash command line. These are linux package management commands. Cygwin is not * a way to run native Linux apps on Windows. Again, you need to build your apps from source if you want to take advantage of Cygwin functionality. A large collection of GNU and Open Source tools which provide. Which Cygwin packages do I need to install to get and use. Part Three - Testing the GCC C++ Compiler Download this 'Hello World' test program (hello.cpp). You could have done the last few steps using the Windows Command Prompt, instead of the Cygwin Command Prompt. Installing the X Windows System on Cygwin is next. MOAC DTC, Senate House, University of Warwick, Coventry CV4 7AL. The install command on Linux systems is used to copy files, and it does this by combining several commands into one to make them easy to use. The install command uses the cp, chown, chmod, and strip commands.

  1. Download this 'Hello World' test program (hello.cpp), save it in your 'Cygwin Home' (see Part One):

    C:CygwinHomeusername

    Note that a file extension of .cpp means 'C Plus Plus'. Sometimes '.cc' is also used.

  2. Run cygwin
  3. Type 'ls' and enter, or 'ls -l' and enter. These should show the 'hello.cpp' file.
  4. Type the following command, and press enter:

    g++ hello.cpp -o hello

    This should take a little while, but no error messages should appear. It tells the GNU C++ compiler (g++) to take the input file hello.cpp and make an output file called hello.exe (the -o is for output).

  5. Type 'ls' and enter, or 'ls -l' and enter. These should show the 'hello.cpp' file and the new 'hello.exe' file
  6. Try typing either of the following and press enter:

    ./hello.exe

    or,

    ./hello

    They should both run your program which prints a simple message to the screen.

  7. quit Cygwin, either by typing 'exit' or clicking on the X in the top right of the screen
  8. Now run the windows command line ('DOS Screen') by using the Windows start menu, run, and typing in 'cmd'.
  9. A black window should appear (often called a 'DOS Screen').
  10. Type in the following to change directory to where we put the hello.cpp file:

    cd C:CygwinHomeusername

    (where username is your Windows username)

  11. Type 'dir' and press enter. You should see the 'hello.cpp' and 'hello.exe' files.
  12. Try typing either of the following:

    hello.exe

    Or:

    hello

    They should both run the program in the windows command window ('DOS Screen').

  13. Now we can delete this file using:

    del hello.exe

  14. We can re-compile it from within the windows command line ('DOS Screen') by typing:

    g++ hello.cpp -o hello

    As before, this will create the hello.exe file.

    i.e. You can run the compiler (g++) from inside Cygwin, or in the Windows command prompt (DOS Screen).

  15. You might have noticed a spelling mistake in the example program (was't should be wasn't). Well lets fix it!
  16. In windows, using the short cut made in Part I, Step 7, open this folder:

    C:CygwinHomeusername

    (where username is your windows username)

  17. Open the hello.cpp file (i.e C:CygwinHomeusernamehello.cpp) with a text editor (like Notepad)
  18. Change the text 'was't' to read 'wasn't', and save and quit the program.

    Note (if you are not using Notepad) the file MUST be saved as plain text

  19. Run cygwin again
  20. Type 'ls' or 'ls -l' to make sure you can see 'hello.cpp'
  21. Type 'cat hello.cpp' to view the file on screen, and check that the spelling mistake is fixed
  22. Recompile the program as before:

    g++ hello.cpp -o hello

  23. Run the program as before

    ./hello.exe

    or,

    ./hello

  24. Again, you could have done the last few steps using the Windows Command Prompt, instead of the Cygwin Command Prompt.
Rpm

Cygwin Install Command Line

Installing the X Windows System on Cygwin is next...