Skip to content

Using on MS Windows

alesegovia edited this page May 6, 2012 · 1 revision

Introduction

This page describes how to use the L+ compiler on MS Windows.

Details

To use the L+ compiler on MS Windows you can download one of the prebuilt binaries or you can build the L+ compiler yourself. In the downloads section, you can get 32-bit and 64-bit versions. The 32-bit version should work on both 32 and 64-bit operating systems.

Once downloaded, extract the contents of the zip file using your favorite un-archiving application.

You can place the contents of the zip file anywhere, but the compiler needs you to set the environment variable LPC_HOME, pointing to the absolute path where the extracted folder is.

From the Windows Command-line, this environment variable can be exported using the following command: set LPC_HOME=C:\lpc

Assuming the extracted folder is called lpc and is located in C:.

Note: exporting a variable like this only makes it visible to the Command-line window that exports it and will not persist once the window is closed. Persistent variables can be defined at the "advanced system settings" in Windows.

Now, let's write a simple L+ program. Type the following command to open notepad:

notepad program.lp

and now type in and save the following program:

// hello.lp
void main()
{
        print("Hello, World!");
}

After saving the file and, having exported the LPC_HOME environment variable, you can now invoke the compiler as follows:

%LPC_HOME%\bin\compiler.bat program.lp

Here, program.lp is the name of the L+ source file to build.

The compiler is self-contained and does not require your system to meet any particular dependencies. Program assembly and execution does require you to have a Java VM installed. You can get this as a free download from java.com.

You can find some L+ examples to try in the README.md file and in the examples/ directory under the source tree.

Clone this wiki locally