Skip to content

ScalaZ3 and Visual Studio 2012 Express for Windows Desktop

vo1stv edited this page Oct 15, 2013 · 20 revisions

Create a local clone of the repository

Version control software is available from GitHub

Create an Eclipse Workspace

Suggested workspace location is in MyDocuments\GitHub

Create an New Scala Project

Suggested project location is ScalaZ3. Eclipse will configure test, main\java and main\scala as source folders. Set the output class folder to ScalaZ3\target\scala-2.10\classes

Create the JNI headers

You need the compiled classfiles and the javah from the JDK for this. On my host, the JNI headers compile only under the 2.9.x branch, using the rather long command name:

"C:\Program Files\Java\jdk1.7.0_21\bin\javah.exe" -classpath .\target\scala-2.10\classes; C:\eclipse-jee-juno-SR2-win32-x86_64\eclipse\configuration\org.eclipse.osgi\bundles\808\1\.cp\lib\scala-library.jar
-d project\libscalaz3 -sourcepath .\src\main\java z3.Z3Wrapper

Create a Visual C++ project

  1. From the Start Page, choose New Project
  2. Choose to create a Win32 Project.
  3. Create the project in the ScalaZ3 projects folder. It's not necessary to create a subfolder for the project.
  4. Under Application Settings, select the DLL application type. Also check the empty project checkbox.
  5. Give the project the name libscalaz3 or scalaz3 (see notes).
  6. Click Finish to create the project.
  7. Add the files from ScalaZ3: src/c to the project.
  8. Under the Project Properties, set the Configuration Property C/C++ Precompiled Headers to "not using precompiled headers".

You will probably want to add 32-bit and 64-bit configurations. The DLL configuration must match the version of the Java VM (32-bit or 64-bit) installed. The above instructions will create the 32-bit configuration by default. To copy the settings for 64-bit configuration, run the Configuration Manager from the Project Properties dialog.

(Optional) Migrate the Windows DLL project to Eclipse

An article discussing the procedure for migrating Visual Studio projects to makefiles for use in the Eclipse environment can be found at http://www.ibm.com/developerworks/library/os-ecl-vscdt/index.html?ca=dgr-eclipse-1

Clone this wiki locally