Using Fortran in Microsoft Visual C++

Fortran routines are included in C-code using the cfortran packages, and the cernlibs. The cernlibs are compiled as a dynamic lib library so your c-code has to be compiled as a dll.

Microsoft Developer Studio Settings

From the menu chose Build and the Settings menu item. The Fortran, C/C++ and Link items have to be changed as follows.

  category: Fortran Libraries
      Using run time library: Multithreaded DLL

  category:  Code Generation
      Using run time library: Multithreaded DLL

  category:  input
     ignore libraries:     
            libc.lib, libcmt.lib, libcd.lib, libcmtd.lib, msvcrtd.lib


There are the following files:
The main.c files defines the pawc common block.
hb.c contains the two functions which show how histograms and ntuples are booked.
The standard cfortran.h include file (copied from CERN). This file should be edited at all.
hbbok.h contains the definition of the cernlib/hbook functions. Your own fortran subroutines definitions has to go in here.
There is a tar file that contains all four files. Good luck.
Back to Daq Page or Silicon home page

comments or questions :

Break out of frames to bookmark page thereafter.