This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision | ||
eiffel:hello:start [2017/12/31 21:42] jonathan |
eiffel:hello:start [2018/12/28 20:49] (current) jackie [Your first Eiffel program (Hello World)] |
||
---|---|---|---|
Line 3: | Line 3: | ||
There is much to do in the first week of EECS3311. Get started right away. Familiarize yourself with Eiffel, the Eiffel method, and Eiffelstudio: | There is much to do in the first week of EECS3311. Get started right away. Familiarize yourself with Eiffel, the Eiffel method, and Eiffelstudio: | ||
* Execute a "Hello World" program using the command line compiler. Instructions below. | * Execute a "Hello World" program using the command line compiler. Instructions below. | ||
- | * Quick introduction to Eiffel Syntax [[http://www.eecs.yorku.ca/~eiffel/eiffel-guide-friess/eiffel-guide/|here]] | + | * Quick introduction to Eiffel Syntax [[http://www.eecs.yorku.ca/~eiffel/eiffel-guide/|here]] |
* Learn how to use the EiffelStudio IDE [[:eiffel:hello:hello2:|here]] (using class CALENDAR). This also introduces you to some design principles. | * Learn how to use the EiffelStudio IDE [[:eiffel:hello:hello2:|here]] (using class CALENDAR). This also introduces you to some design principles. | ||
* Run the unit testing framework ESpec, instructions [[:eiffel/espec/start|here]] | * Run the unit testing framework ESpec, instructions [[:eiffel/espec/start|here]] | ||
Line 54: | Line 54: | ||
- | === Using command line (''ec17.05'') === | + | === Using command line (''ec18.11'') === |
**//To compile//** your program from the command line, use | **//To compile//** your program from the command line, use | ||
- | ec17.05 hello_world.e | + | ec18.11 hello_world.e |
| | ||
- | On Prism (Linux), we have renamed the command line compiler (“ec”) to '“ec17.05”, as we are using EiffelStudio version 17.05. | + | On Prism (Linux), we have renamed the command line compiler (“ec”) to '“ec18.11”, as we are using EiffelStudio version 18.11. |
[On your own install in Linux/Windows/MacOs, you may be prompted to precompile. Answer Yes.] | [On your own install in Linux/Windows/MacOs, you may be prompted to precompile. Answer Yes.] | ||
- | On Windows/MacOs, the command line will just be “ec”. On Windows, use the EiffelStudio 16.05 Command Prompt (available from the Start menu). | + | On Windows/MacOs, the command line will just be “ec”. On Windows, use the EiffelStudio 18.11 Command Prompt (available from the Start menu). |
When you invoke ec on a single source file such as hello_world.e, the compiler will generate the ecf file for you (hello_world.ecf). ECF files specify which libraries will be used. The Base library is always included. | When you invoke ec on a single source file such as hello_world.e, the compiler will generate the ecf file for you (hello_world.ecf). ECF files specify which libraries will be used. The Base library is always included. | ||
Line 73: | Line 73: | ||
You can obtain a finalized executable that can be deployed by any user (without the need for the EiffelStudio environment) by: | You can obtain a finalized executable that can be deployed by any user (without the need for the EiffelStudio environment) by: | ||
- | ec17.05 -c_compile -finalize -config hello_world.ecf | + | ec18.11 -c_compile -finalize -config hello_world.ecf |
| | ||
The Eiffel program is translated to C, and the C program is compiled to executable machine code (that does not need a virtual machine to run it). To execute the program: | The Eiffel program is translated to C, and the C program is compiled to executable machine code (that does not need a virtual machine to run it). To execute the program: | ||
Line 82: | Line 82: | ||
- | * Note: If you are using the command line under Windows, then the compiler is ec (not ec16.05). Use the Eiffel 17.05 command prompt (available from the Start menu). Alternatively,ensure that: C:\Program Files\Eiffel Software\EiffelStudio 16.05 GPL\studio\spec\windows\bin is on your PATH variable. | + | * Note: If you are using the command line under Windows, then the compiler is ec (not ec18.11). Use the Eiffel 18.11 command prompt (available from the Start menu). Alternatively,ensure that: C:\Program Files\Eiffel Software\EiffelStudio 18.11 GPL\studio\spec\windows\bin is on your PATH variable. |
- | ===Using IDE (estudio17.05)=== | + | ===Using IDE (estudio18.11)=== |
You can invoke the EiffelStudio IDE on the above project as follows: | You can invoke the EiffelStudio IDE on the above project as follows: | ||
- | > estudio17.05 & | + | > estudio18.11 & |
(On your own install, it is just estudio). | (On your own install, it is just estudio). | ||
When you start a new project on the IDE, you can use the Wizard to generate an ECF file automatically. If you already have a project with ECF file foo.ecf, then you can start from the command line as follows: | When you start a new project on the IDE, you can use the Wizard to generate an ECF file automatically. If you already have a project with ECF file foo.ecf, then you can start from the command line as follows: | ||
- | estudio17.05 foo.ecf &. | + | estudio18.11 foo.ecf &. |
(The ampersand at the end causes the EStudio process to run in the background, leaving the terminal free for further commands.) | (The ampersand at the end causes the EStudio process to run in the background, leaving the terminal free for further commands.) |