View previous topic :: View next topic |
Author |
Message |
Anonymous Guest
|
Posted: Mon Feb 28, 2005 11:36 pm Post subject: Trouble running code |
|
|
I have a code that compiles and builds without any errors. It runs just fine in Intel Visual Fortran. But when I try to build it and run it from FTN95, it builds without errors but running it give the error "An exception 'System.TypeInitializationException' has occured." I have no idea what this means or what to do about it. Anyone have suggestions? |
|
Back to top |
|
|
Anonymous Guest
|
Posted: Tue Mar 01, 2005 1:37 pm Post subject: Trouble running code |
|
|
I have found that if I have code where uninitialized variables are used and the code is compiled using the command line compiler, (ftn95.exe), the uninitialized variables will be initialized by the compiler to be some negative number and the code runs without any runtime exceptions.
However, when the same code is compiled using Salford Fortran in the Visual Studio .NET development environment, then the uninitialized variables cause a runtime exception. You may be having a similar problem with Intel Visual Fortran.
Ron Coutts |
|
Back to top |
|
|
Andrew
Joined: 09 Sep 2004 Posts: 232 Location: Frankfurt, Germany
|
Posted: Sat Mar 05, 2005 5:03 am Post subject: Trouble running code |
|
|
There is another potential difference here. Intel Visual Fortran only compiles in Win32 mode. The error that was seen is a .NET runtime error. Do you really intend to build the program in .NET mode? If not then you can change the configuration by selecting a Win32 mode from the dropdown combo at the top of the IDE. |
|
Back to top |
|
|
MarcusMaximus
Joined: 28 Feb 2005 Posts: 1
|
Posted: Fri Mar 11, 2005 3:13 am Post subject: Trouble running code |
|
|
That was it. I changed to Win32 and now it runs just fine. Thanks! |
|
Back to top |
|
|
Andrew
Joined: 09 Sep 2004 Posts: 232 Location: Frankfurt, Germany
|
Posted: Fri Mar 11, 2005 3:34 am Post subject: Trouble running code |
|
|
There may be another cause for this too. When you compile and run from the command line - do you use the switch /CHECK? If not then no runtime checks are placed and your code may execute where there are actually uninitialised variables. When running inside Visual Studio (depending on the configuration) /CHECK may be turned on. If this is the case and an unitialised variable is encountered at runtime then a runtime exception will be thrown. There may also be differences between running code in Win32 mode and .NET mode with /CHECK. Make sure you are comparing like with like, as otherwise you may see differing behaviour. |
|
Back to top |
|
|
|