Topic: Version 2.2 w/ VS2008 and VC++

Hello,

can someone please direct me to instructions on compiling version 2.2 under debug configuration with VS2008.

I did try the instructions on oofem wiki but I get the following -

Errors (x 424):

fatal error C1010: unexpected end of file while looking for precompiled header. Did you forget to add '#include "stdafx.h"' to your source?    e:\oofem\src\fm\binghamfluid2.c    723    oofem

Warnings:

warning C4005: 'ENUM_ITEM' : macro redefinition    e:\oofem\2.2\console\oofem\src\oofemlib\cltypes.c    281    oofem

warning C4005: 'ENUM_ITEM_WITH_VALUE' : macro redefinition e:\oofem\2.2\console\oofem\src\oofemlib\cltypes.c    286    oofem

warning C4005: 'TO_STRING_BODY' : macro redefinition    e:\oofem\2.2\console\oofem\src\oofemlib\cltypes.c    291    oofem

warning C4005: '__PROCESS_LOG' : macro redefinition    e:\oofem\2.2\console\oofem\src\oofemlib\logger.c    291    oofem



Thanks!!

Re: Version 2.2 w/ VS2008 and VC++

Hi Tejas.

This seems to indicate that you are trying to use precompiled headers, which isn't really worth it for OOFEM.
Can you try turning that off
Project-> Settings->C/C++->Category->Precompiled headers->not using precompiled headers
or something along those lines.

As for the warnings, I'm surprised they occur at all. I can only imagine its because MSVC isn't a very good compiler. In fact, it's pretty horrible.

Re: Version 2.2 w/ VS2008 and VC++

Dear Mikael,

Thanks for your reply.
I did turn off precompiled headers, although I have some different errors/ warnings now.

Errors:

fatal error C1083: Cannot open include file: 'contextoutputmode.h': No such file or directory
:
:
fatal error C1083: Cannot open include file: 'tinyxml2.h': No such file or directory
error C2065: 'MAX_ERROR_MSG_LENGTH' : undeclared identifier
:
:

Warnings:

https://sites.google.com/site/gwuresearch01/


I am new to c++ and oofem will in fact be my first trial project in c++.
I have had some experience in programming the finite element methods with fortran and now I'm trying to learn both oofem and c++.
So kindly excuse me if I happen to ask too many questions.

Thanks!!

Re: Version 2.2 w/ VS2008 and VC++

Please don't worry about asking questions!

I need to ask a few questions to se that everything was set up correctly, because you shouldn't get these warnings.
Did you configure the project using CMake, and then open the project-file that gets created by CMake?

Since you do not have tinyxml2 installed, please configure without CEMHYD-support (or download and compile TinyXML-2).

Re: Version 2.2 w/ VS2008 and VC++

Hey!

I did not use CMake to configure my project.

I followed steps from wiki instructions for compiling with Visual Studio C++ (steps 2 to 8) and later added the "do not use precompiled headers" option. I also added the file "oofemcfg.h.in" to my VS2008 project.

Re: Version 2.2 w/ VS2008 and VC++

How unfortunate that you found that old, no-longer-working, guide!
I'll be sure to remove the old link from the wiki.
Since we changed to CMake, we support visual studio directly, so please install CMake and configure the project to generate MSVS 9 project files.

Re: Version 2.2 w/ VS2008 and VC++

Hey Mikael,

So I downloaded CMake and followed the instructions from "CMake Tutorial"on wiki for Windows (Visual Studio).

I configured the defaults (BUILD_TESTING, USE_FM, USE_SM, USE_TM).

   Could NOT find PythonInterp (missing:  PYTHON_EXECUTABLE)
   Could NOT find Doxygen (missing:  DOXYGEN_EXECUTABLE)
   Configuring done

Then I clicked Generate to which I get the following message

   CMake Error in src/oofemlib/CMakeLists.txt:
   Cannot find source file:
   outputmanager.C
   Tried extensions .c .C .c++ .cc .cpp .cxx .m .M .mm .h .hh .h++ .hm .hpp .hxx .in .txx
   Generating done

Re: Version 2.2 w/ VS2008 and VC++

I just downloaded the zip from the homepage to make sure, and it seems outputmanager.C actually is missing from there (along with every other file containing the string "out"). It seems i made a bug in the regexp expression for the script that packs the sources for release.
Sorry about that.

I've fixed those bugs and hopefully the zip on the homepage will be replaced as soon as possible.
For now;
http://dhcp2-pc051043.am.chalmers.se/sh … em-2.2.zip

Re: Version 2.2 w/ VS2008 and VC++

Works!

VS project generated with no issues.

Thanks!!

10

Re: Version 2.2 w/ VS2008 and VC++

I have just uploaded corrected source package to oofem.org.