김윤승
가입: 2014년 9월 1일 올린 글: 452 위치: 302동 312-2호
|
올려짐: 2014년11월16일 18:44 주제: TIP: How To Write OCaml Code With Eclipse IDE |
|
|
You can use Eclipse if you want better IDE (a developing tool) like VisualStudio.
Eclipse is known as a Java developing tool, but it supports various plugins including OcaIDE, which is a plugin for OCaml.
If you cannot bear your current developing environment, follow this instruction to use Eclipse.
0. Install Ocaml. (If you are a Windows user, install OCPWin.)
1. Install the most recent Java JDK and download Eclipse from here:
Java JDK: http://www.oracle.com/technetwork/java/javase/downloads/index.html
Eclipse: https://www.eclipse.org/downloads/packages/eclipse-ide-java-developers/lunasr1
2. Extract Eclipse and then run "eclipse.exe".
3. Select "Help -> Install New Software..." in the menu bar at the top of the window.
4. Enter "http://www.algo-prog.info/ocaide/" in the textbox of "Work with:".
5. Select "OcaIDE" and then click "Next" to install it.
6. After restarting Eclipse, go to "Window -> Preferences" at the menu bar.
7. Select "OcaIDE -> Paths" at the left window.
8. Choose "Ocaml Binaries Directory". For Windows users, choose the folder of "xxx\OCPWin64\bin".
9. Click Apply.
10. At the bottom, choose "OCaml lib path". For windows users, choose "xxx\OCPWin64\lib".
11. Click OK.
Now you are ready to use Eclipse. To write code, follow this:
1.At the menu bar, click "File -> New -> Other" and then choose "OCaml -> OCaml Managed Project".
2. Enter the name of the project (ex. "hw6-2") and then click "Finish".
3. Right-click the project name at the Navigator window at the left, and then click "Import".
4. Choose "General -> File System".
5. Click Browse and choose the folder in which the skeleton code files are located.
6. Choose "commonGrade.ml", "hw6_x.ml", and "hw6_x_grade.ml".
7. Click "Finish" button.
8. Right-click the project name at the Navigator window, and then click "Properties".
9. Choose "Ocaml Project" and then click the checkbox of "hw6_x_grade.ml".
10. Click "OK".
Now you can compile OCaml code. At the bottom screen, you can use the Interactive mode by choosing the "Ocaml Toplevel" Window. If you run the self-grader, follow this:
1. After you complete "hw6_x.ml", right-click "hw6_x_grade.exe" at the Navigator window, and click "Run as -> Ocaml Executable".
2. The result will be printed at "Console" window at the bottom.
If you have problems while following this, ask me. |
|