Compiling shared dinamyc library (.dll) with Visual C++ Microsoft Developer Studio (Version 6)

  1. Start it. Then, from the File menu, select New. Then, from the New dialog, select Project Workspace.
  2. In the Project Workspace dialog, specify a name for the project (such as “ar”).
  3. In addition, specify the path where you want to save the compiled codes.
  4. For Project Type choose “Win32 Dynamic-Link Library” (not MFCAppWizard (dll)).
  5. Then click on "an empty project".
  6. From the "Project menu", choose "Add to Project" and "Files".
  7. Add ar.c and ar.def to your project. To insert the .def file, use the "Files of Type" drop-down list and select Definition files (.def).
  8. Project -> Settings -> C/C++ tab. Add DLL_LOAD to the processor Definition text field.
  9. From the "Build menu", choose Rebuild All. Visual C++ will build your DLL, in either the Debug or Release subdirectory beneath your project workspace (depending upon whether you select “Debug” or “Release” in the Default Project Configuration dialog accessed from Build/Set Default Configuration...).

As mentioned before, I prefer option 3, which compiles the .dll directly with R.