Getting Started with Eiffel
Goals:
Install Eiffel
Create, compile and execute our first Eiffel Program.
Installing Eiffel is just as easy as installing other languages, below I will show you how to install EiffelStudio using two options: Installation Scripts or download files and set the environment variables.
EiffelStudio installation scripts
Using the installation scripts https://www.eiffel.org/setup provides a simple way to install EiffelStudio.
Getting the GPL files from Eiffel.org
Download and unzip Eiffel.zip from https://www.eiffel.org/downloads.
Create the following environment variables
Windows
EiffelStudio supports Microsoft and MinGW compilers on Microsoft Windows. To learn more read the following post-https://www.eiffel.org/doc/eiffelstudio/Supported%20C%20compilers
ISE_C_COMPILER= set to mingw or msc, msc_vc140 if you use VisualStudio 2015 or later
ISE_EIFFEL= to the path where you extracted Eiffel_X.Y folder
ISE_PLATFORM= to win64 or windows
Add %ISE_EIFFEL%\studio\spec\%ISE_PLATFORM%\bin to the PATH and also
%ISE_EIFFEL%\tools\spec\%ISE_PLATFORM%\bin .
Checking the Eiffel version.
ec -version
ISE EiffelStudio version 18.01.10.1424 GPL Edition - win64
Linux
On Linux, it is quite similar. First, you will need to download the EiffelStudio file for Linux.
Decompress the file using the following command.
tar xf Eiffel_18.01_gpl_101424-linux-x86-64.tar.bz2
using gedit or vi
gedit ~/.bashrc
set the following environment variables .
export ISE_EIFFEL=/home/dev/Eiffel_18.01
export ISE_PLATFORM=linux-x86-64 or linux-x86
export PATH=$PATH:$ISE_EIFFEL/studio/spec/$ISE_PLATFORM/bin
Checking Eiffel Version
ec -version
ISE EiffelStudio version 18.01.10.1424 GPL Edition - linux-x86-64
Writing your first Eiffel program
Creating a project in EiffelStudio, now you will learn how to create a basic project in EiffelStudio
- Open EiffelStudio from the command line type
estudio
- Select
Basic Application (no graphics library included)
and click create
- You can Select a
System name
,Root Cluster
,Root Class
,Root Feature
andLocation
and click OK.
At this moment let them with the default values
Now we have our first project created and compiled, for this little example we will use Workbench mode.
To learn more about Eiffel types of compilation and executions read the following blog eiffel compilation.
Running
Now it's time to execute our first application
Click the run button or just use the short-cut Ctrl + Alt + F5
, our program will print Hello Eiffel World!
to the console.
Conclusion
We've learned how to install EiffelStudio and how to create and run a basic application that prints the famous Hello World.
Finally to learn more about the EiffelStudio compiler Technology read the following blog post- https://www.eiffel.org/doc/eiffelstudio/Compiler