Topic: Compile oofem with MS VC6.0

Hi:
I tried to install oofem-1.8 on my computer. I met some errors like below:
Compiling...
usrdefsub.C
d:\oofem-1.8\oofem-1.8\src\oofemlib\element.h(784) : error C2244: 'Element::updateLocalNumbering' : unable to resolve function overload
d:\oofem-1.8\oofem-1.8\src\oofemlib\element.h(786) : error C2954: template definitions cannot nest
d:\oofem-1.8\oofem-1.8\src\oofemlib\element.h(799) : error C2244: 'Element::ipEvaluator' : unable to resolve function overload
d:\oofem-1.8\oofem-1.8\src\oofemlib\element.h(801) : error C2954: template definitions cannot nest
d:\oofem-1.8\oofem-1.8\src\oofemlib\element.h(814) : error C2244: 'Element::ipEvaluator' : unable to resolve function overload
d:\oofem-1.8\oofem-1.8\src\oofemlib\structuralelement.h(52) : error C2989: 'TimeStep' : template class has already been defined as a non-template class
        d:\oofem-1.8\oofem-1.8\src\oofemlib\domain.h(61) : see declaration of 'TimeStep'

2

Re: Compile oofem with MS VC6.0

Hi,
it is hard to say from the information provided. Are you sure that c++ compiler is used?
I have created a guide on how to compile under MS Visual Studio on oofem wiki (http://www.oofem.org/wiki/doku.php?id=w … ompilation).
Could you please check this guide, as it may solve the problem.

Borek

3 (edited by Ni Yongzhong 29-09-2009 17:29:00)

Re: Compile oofem with MS VC6.0

Hi bp:
Thanks for your answer.could you look at the attachment which is my setting of MS VC.
in addition,can you provided a VC project with .dsw file which has been Configured.

Re: Compile oofem with MS VC6.0

Hi bp:
    I think I will compile the oofem code successfully.There has only error of overriding,I need you help.The information of error like:
error C2555: 'HydrationModel::giveStatus' : overriding virtual function differs from 'Material::giveStatus' only by return type or calling convention ..\trunk\src\oofemlib\material.h(87) : see declaration of 'Material'

By the way, I list some error which were modified in the process of compiled.
1:timer.h file "void toString(EngngModelTimerType t, char *buff) { timers [ t ].toString(buff); } "
2:in mathfem.h,class mem_fun is conflit with the head file "funtional" of VC,I have changed mem_fun to mem_fun_ which reference was also changed.
3:in dofmange.h file,It should  add "#define __ENABLE_COMPONENT_LABELS",otherwise the function "giveGlobalNumber" could not been compiled which is refered in other file.

5

Re: Compile oofem with MS VC6.0

Hi,

regarding the HydrationModel::giveStatus declaration, the problem could be solved by changing the declaration (hydram.h) to

virtual MaterialStatus *giveStatus(GaussPoint *gp) const;

And the corresponding change in hydram.C where the method is defined.

Also the lines marked with "// !!" should be changed in hydram.C:

double
HydrationModel :: giveHydrationDegree(GaussPoint *gp, TimeStep *atTime, ValueModeType mode)
// returns the hydration degree in integration point gp
{
  HydrationModelStatus *status = (HydrationModelStatus*) giveStatus(gp); // !!
 ....
}

void
HydrationModel :: updateInternalState(const FloatArray &vec, GaussPoint *gp, TimeStep *atTime)
/** Recalculates the hydration degree according to the given new state vector and time increment, using equilib status
 *  State vector is supposed to contain [1]->temperature, [2]->relative humidity!
 *  caller should ensure that this is called only when state vector is changed
 */
{
    double ksi, dksi, T = 0., h = 1., dt;
    // get hydration model status associated with integration point
    HydrationModelStatus *status = (HydrationModelStatus*) giveStatus(gp); // !!
  ....
}

Thank you for reporting this,
Borek

Re: Compile oofem with MS VC6.0

Thanks for your help,I have complied the code successfully.