windows_compilation
This is an old revision of the document!
This short guide describes the steps necessary to compile oofem using Microsoft Visual c++ compiler.
- Create a new, empty project (Win32 console application)
- Add all relevant files into the project. Identify modules that you need (oofemlib must be included). The relevant files can be easily explored from makefile templates located in OOFEM_TOP_DIR/base directory)
- In the project settings, add “/TP” compiler option. This will force “.C” files to be recognized as c++ files.
- Get oofemcfg.h and oofemdef.h files from OOFEM_TOP_DIR/base directory. Then #define HAVE_BOOLTYPE, TIME_WITH_SYS_TIME and HAVE_MACRO_VA_ARGS.
- Under the VC project option/preprocessor definition, define MODULENAME_MODULE (where the MODULENAME is the name of module(s) you want to include, for example define SM_MODULE and OOFEMLIB_MODULE). Also define OOFEM and DEBUG (if you want a debug version of OOFEM) macros.
- Open inverseit.h header file, and find out the “z” definition. Then change the original definition into
FloatArray* z=new(FloatArray[nc]);
and don’t forget to add
delete [] z;
at the end of usage;
- In timer.h file, some functions only have declaration but no definitions in the corresponding cpp file. Comment out the following declarations:
//timersub(&end_wtime, &start_wtime, &etime); //timeradd(&etime, &elapsedWTime, &elapsedWTime); //timersub(&end_utime, &start_utime, &etime); //timeradd(&etime, &elapsedUTime, &elapsedUTime); //start_utime=end_utime; start_wtime=end_wtime;
- Lack of #define clock.h statement in clock.h file, which would produce “redefinition” compile errors.
windows_compilation.1234458112.txt.gz · Last modified: 2009/02/12 18:01 by bp