Topic: oofem compilation in visual studio 2008

Hi there,
I'm trying to compile oofem in visual studio 2008 (only the solver) and I get the following errors:

1>binghamfluid2.C
1>d:\program files\microsoft visual studio 9.0\vc\include\cstdio(39) : error C2143: syntax error : missing '{' before ':'
1>d:\program files\microsoft visual studio 9.0\vc\include\cstdio(39) : error C2059: syntax error : ':'
1>d:\program files\microsoft visual studio 9.0\vc\include\cstdio(41) : error C2143: syntax error : missing '{' before ':'
1>d:\program files\microsoft visual studio 9.0\vc\include\cstdio(41) : error C2059: syntax error : ':'
1>d:\program files\microsoft visual studio 9.0\vc\include\cstdio(41) : error C2143: syntax error : missing '{' before ':'
1>d:\program files\microsoft visual studio 9.0\vc\include\cstdio(41) : error C2059: syntax error : ':'
1>d:\program files\microsoft visual studio 9.0\vc\include\cstdio(41) : error C2143: syntax error : missing '{' before ':'
1>d:\program files\microsoft visual studio 9.0\vc\include\cstdio(41) : error C2059: syntax error : ':'
1>d:\program files\microsoft visual studio 9.0\vc\include\cstdio(42) : error C2143: syntax error : missing '{' before ':'
1>d:\program files\microsoft visual studio 9.0\vc\include\cstdio(42) : error C2059: syntax error : ':'
1>d:\program files\microsoft visual studio 9.0\vc\include\cstdio(42) : error C2143: syntax error : missing '{' before ':'
1>d:\program files\microsoft visual studio 9.0\vc\include\cstdio(42) : error C2059: syntax error : ':'
1>d:\program files\microsoft visual studio 9.0\vc\include\cstdio(42) : error C2143: syntax error : missing '{' before ':'
1>d:\program files\microsoft visual studio 9.0\vc\include\cstdio(42) : error C2059: syntax error : ':'
1>d:\program files\microsoft visual studio 9.0\vc\include\cstdio(43) : error C2143: syntax error : missing '{' before ':'
1>d:\program files\microsoft visual studio 9.0\vc\include\cstdio(43) : error C2059: syntax error : ':'
1>d:\program files\microsoft visual studio 9.0\vc\include\cstdio(43) : error C2143: syntax error : missing '{' before ':'
1>d:\program files\microsoft visual studio 9.0\vc\include\cstdio(43) : error C2059: syntax error : ':'
1>d:\program files\microsoft visual studio 9.0\vc\include\cstdio(43) : error C2143: syntax error : missing '{' before ':'
1>d:\program files\microsoft visual studio 9.0\vc\include\cstdio(43) : error C2059: syntax error : ':'
1>d:\program files\microsoft visual studio 9.0\vc\include\cstdio(44) : error C2143: syntax error : missing '{' before ':'
1>d:\program files\microsoft visual studio 9.0\vc\include\cstdio(44) : error C2059: syntax error : ':'
1>d:\program files\microsoft visual studio 9.0\vc\include\cstdio(44) : error C2143: syntax error : missing '{' before ':'
1>d:\program files\microsoft visual studio 9.0\vc\include\cstdio(44) : error C2059: syntax error : ':'
1>d:\program files\microsoft visual studio 9.0\vc\include\cstdio(44) : error C2143: syntax error : missing '{' before ':'
1>d:\program files\microsoft visual studio 9.0\vc\include\cstdio(44) : error C2059: syntax error : ':'
1>d:\program files\microsoft visual studio 9.0\vc\include\cstdio(45) : error C2143: syntax error : missing '{' before ':'
1>d:\program files\microsoft visual studio 9.0\vc\include\cstdio(45) : error C2059: syntax error : ':'
1>d:\program files\microsoft visual studio 9.0\vc\include\cstdio(45) : error C2143: syntax error : missing '{' before ':'
1>d:\program files\microsoft visual studio 9.0\vc\include\cstdio(45) : error C2059: syntax error : ':'
1>d:\program files\microsoft visual studio 9.0\vc\include\cstdio(45) : error C2143: syntax error : missing '{' before ':'
1>d:\program files\microsoft visual studio 9.0\vc\include\cstdio(45) : error C2059: syntax error : ':'
1>d:\program files\microsoft visual studio 9.0\vc\include\cstdio(46) : error C2143: syntax error : missing '{' before ':'
1>d:\program files\microsoft visual studio 9.0\vc\include\cstdio(46) : error C2059: syntax error : ':'
1>d:\program files\microsoft visual studio 9.0\vc\include\cstdio(46) : error C2143: syntax error : missing '{' before ':'
1>d:\program files\microsoft visual studio 9.0\vc\include\cstdio(46) : error C2059: syntax error : ':'
1>d:\program files\microsoft visual studio 9.0\vc\include\cstdio(46) : error C2143: syntax error : missing '{' before ':'
1>d:\program files\microsoft visual studio 9.0\vc\include\cstdio(46) : error C2059: syntax error : ':'
1>d:\program files\microsoft visual studio 9.0\vc\include\cstdio(47) : error C2143: syntax error : missing '{' before ':'
1>d:\program files\microsoft visual studio 9.0\vc\include\cstdio(47) : error C2059: syntax error : ':'
1>d:\program files\microsoft visual studio 9.0\vc\include\cstdio(47) : error C2143: syntax error : missing '{' before ':'
1>d:\program files\microsoft visual studio 9.0\vc\include\cstdio(47) : error C2059: syntax error : ':'
1>d:\program files\microsoft visual studio 9.0\vc\include\cstdio(47) : error C2143: syntax error : missing '{' before ':'
1>d:\program files\microsoft visual studio 9.0\vc\include\cstdio(47) : error C2059: syntax error : ':'
1>d:\program files\microsoft visual studio 9.0\vc\include\cstdio(48) : error C2143: syntax error : missing '{' before ':'
1>d:\program files\microsoft visual studio 9.0\vc\include\cstdio(48) : error C2059: syntax error : ':'
1>d:\program files\microsoft visual studio 9.0\vc\include\cstdio(48) : error C2143: syntax error : missing '{' before ':'
1>d:\program files\microsoft visual studio 9.0\vc\include\cstdio(48) : error C2059: syntax error : ':'
1>d:\program files\microsoft visual studio 9.0\vc\include\cstdio(48) : error C2143: syntax error : missing '{' before ':'
1>d:\program files\microsoft visual studio 9.0\vc\include\cstdio(48) : error C2059: syntax error : ':'
1>d:\program files\microsoft visual studio 9.0\vc\include\cstdio(49) : error C2143: syntax error : missing '{' before ':'
1>d:\program files\microsoft visual studio 9.0\vc\include\cstdio(49) : error C2059: syntax error : ':'
1>d:\program files\microsoft visual studio 9.0\vc\include\cstdio(49) : error C2143: syntax error : missing '{' before ':'
1>d:\program files\microsoft visual studio 9.0\vc\include\cstdio(49) : error C2059: syntax error : ':'
1>d:\program files\microsoft visual studio 9.0\vc\include\cstdio(50) : error C2143: syntax error : missing '{' before ':'
1>d:\program files\microsoft visual studio 9.0\vc\include\cstdio(50) : error C2059: syntax error : ':'
1>d:\program files\microsoft visual studio 9.0\vc\include\cstdio(50) : error C2143: syntax error : missing '{' before ':'
1>d:\program files\microsoft visual studio 9.0\vc\include\cstdio(50) : error C2059: syntax error : ':'
1>d:\program files\microsoft visual studio 9.0\vc\include\cstdio(51) : error C2143: syntax error : missing '{' before ':'
1>d:\program files\microsoft visual studio 9.0\vc\include\cstdio(51) : error C2059: syntax error : ':'
1>d:\program files\microsoft visual studio 9.0\vc\include\cstdio(51) : error C2143: syntax error : missing '{' before ':'
1>d:\program files\microsoft visual studio 9.0\vc\include\cstdio(51) : error C2059: syntax error : ':'
1>d:\program files\microsoft visual studio 9.0\vc\include\cstdio(51) : error C2143: syntax error : missing '{' before ':'
1>d:\program files\microsoft visual studio 9.0\vc\include\cstdio(51) : error C2059: syntax error : ':'
1>d:\program files\microsoft visual studio 9.0\vc\include\cstdio(52) : error C2143: syntax error : missing '{' before ':'
1>d:\program files\microsoft visual studio 9.0\vc\include\cstdio(52) : error C2059: syntax error : ':'
1>d:\program files\microsoft visual studio 9.0\vc\include\cstdio(52) : error C2143: syntax error : missing '{' before ':'
1>d:\program files\microsoft visual studio 9.0\vc\include\cstdio(52) : error C2059: syntax error : ':'
1>d:\program files\microsoft visual studio 9.0\vc\include\cstdio(52) : error C2143: syntax error : missing '{' before ':'
1>d:\program files\microsoft visual studio 9.0\vc\include\cstdio(52) : error C2059: syntax error : ':'
1>d:\program files\microsoft visual studio 9.0\vc\include\cstdio(53) : error C2143: syntax error : missing '{' before ':'
1>d:\program files\microsoft visual studio 9.0\vc\include\cstdio(53) : error C2059: syntax error : ':'
1>d:\program files\microsoft visual studio 9.0\vc\include\cstdio(53) : error C2143: syntax error : missing '{' before ':'
1>d:\program files\microsoft visual studio 9.0\vc\include\cstdio(53) : error C2059: syntax error : ':'
1>d:\program files\microsoft visual studio 9.0\vc\include\cstdio(53) : error C2143: syntax error : missing '{' before ':'
1>d:\program files\microsoft visual studio 9.0\vc\include\cstdio(53) : error C2059: syntax error : ':'
1>d:\program files\microsoft visual studio 9.0\vc\include\cstdio(54) : error C2143: syntax error : missing '{' before ':'
1>d:\program files\microsoft visual studio 9.0\vc\include\cstdio(54) : error C2059: syntax error : ':'
1>d:\program files\microsoft visual studio 9.0\vc\include\cstdio(54) : error C2143: syntax error : missing '{' before ':'
1>d:\program files\microsoft visual studio 9.0\vc\include\cstdio(54) : error C2059: syntax error : ':'
1>d:\program files\microsoft visual studio 9.0\vc\include\cstdio(54) : error C2143: syntax error : missing '{' before ':'
1>d:\program files\microsoft visual studio 9.0\vc\include\cstdio(54) : error C2059: syntax error : ':'
1>d:\program files\microsoft visual studio 9.0\vc\include\cstdio(55) : error C2143: syntax error : missing '{' before ':'
1>d:\program files\microsoft visual studio 9.0\vc\include\cstdio(55) : error C2059: syntax error : ':'
1>d:\program files\microsoft visual studio 9.0\vc\include\cstdio(55) : error C2143: syntax error : missing '{' before ':'
1>d:\program files\microsoft visual studio 9.0\vc\include\cstdio(55) : error C2059: syntax error : ':'
1>d:\program files\microsoft visual studio 9.0\vc\include\cstdio(55) : error C2143: syntax error : missing '{' before ':'
1>d:\program files\microsoft visual studio 9.0\vc\include\cstdio(55) : error C2059: syntax error : ':'
1>d:\program files\microsoft visual studio 9.0\vc\include\cstdio(56) : error C2143: syntax error : missing '{' before ':'
1>d:\program files\microsoft visual studio 9.0\vc\include\cstdio(56) : error C2059: syntax error : ':'
1>d:\program files\microsoft visual studio 9.0\vc\include\cstdlib(21) : error C2143: syntax error : missing '{' before ':'
1>d:\program files\microsoft visual studio 9.0\vc\include\cstdlib(21) : error C2059: syntax error : ':'
1>d:\program files\microsoft visual studio 9.0\vc\include\cstdlib(21) : error C2143: syntax error : missing '{' before ':'
1>d:\program files\microsoft visual studio 9.0\vc\include\cstdlib(21) : error C2059: syntax error : ':'
1>d:\program files\microsoft visual studio 9.0\vc\include\cstdlib(21) : error C2143: syntax error : missing '{' before ':'
1>d:\program files\microsoft visual studio 9.0\vc\include\cstdlib(21) : error C2059: syntax error : ':'
1>d:\program files\microsoft visual studio 9.0\vc\include\cstdlib(23) : error C2143: syntax error : missing '{' before ':'
1>d:\program files\microsoft visual studio 9.0\vc\include\cstdlib(23) : error C2059: syntax error : ':'
1>d:\program files\microsoft visual studio 9.0\vc\include\cstdlib(23) : error C2143: syntax error : missing '{' before ':'
1>d:\program files\microsoft visual studio 9.0\vc\include\cstdlib(23) : error C2059: syntax error : ':'
1>d:\program files\microsoft visual studio 9.0\vc\include\cstdlib(23) : error C2143: syntax error : missing '{' before ':'
1>d:\program files\microsoft visual studio 9.0\vc\include\cstdlib(23) : fatal error C1003: error count exceeds 100; stopping compilation
1>cbs.C
...

There is an identic topic on:
http://www.oofem.org/forum/viewtopic.php?id=357
but there's no solution to the problem and I already tried to contact the user privately, no answers.

I'm using version 1.9 downloaded from the site oofem.org .
How can I solve this problem?
Thanks,
Giovanni R.

2

Re: oofem compilation in visual studio 2008

Hi Giovanni,

There is a section on oofem wiki devoted to compilation on Windows with Visual studio.
Please follow this link: http://www.oofem.org/wiki/doku.php?id=w … ompilation
In case of any problem, let me know.

Borek

Re: oofem compilation in visual studio 2008

Thank you very much for the answers, I'm sorry I've forgot to tell that I followed exactely the guide you told me.

Giovanni

Re: oofem compilation in visual studio 2008

The point is that the, despite of the /TP compilation setting (referring to the wiki post) set in the project properties, the C files have the /TC option. I changed this for all c files.
Now the build starts correctly, but in the end (linking stage), visual studio returns me error like this one:

Errore    30    error LNK2019: external symbol reference "class MesherInterface * __cdecl CreateUsrDefMesherInterface(enum MeshPackageType,class Domain *)" (?CreateUsrDefMesherInterface@@YAPAVMesherInterface@@W4MeshPackageType@@PAVDomain@@@Z) not resolved in function "public: virtual void __thiscall AdaptiveLinearStatic::solveYourselfAt(class TimeStep *)" (?solveYourselfAt@AdaptiveLinearStatic@@UAEXPAVTimeStep@@@Z)    adaptlinearstatic.obj

What's this?

Giovanni

5

Re: oofem compilation in visual studio 2008

Have you included src/main/usrdefsub.C and src/main/main.C files into the project?

Borek

6 (edited by johnnyontheweb 21-10-2010 22:25:11)

Re: oofem compilation in visual studio 2008

thank you very much, now it works! I'm sorry but I don't know C++ language, I have developed some custom element for ABAQUS in Fortran that I want to try with your software. Now I'm starting to read how to add custom elements, but it's difficult without knowing C++ .

Another thing just for anyone else has the same problems: if I want to build a "Release" version (which I think it will be more performing during execution) I obtain the following error:

Error     763    error LNK2001: external symbol __CrtDbgReportW not resolved     compcol.obj

To fix it and make oofem compile I have to go in project properties (make sure that "Release" configuration is active) and set "Debug multithread (/MDd)" in the Configuration properties -> C/C++ -> Code generation mask.

Thanks again,
Giovanni