- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I know it's weird but here is the case.
The program I have wants to print out something on screen so I used write(*,*) 'xxxx'. It works perfectly fine before I moved my Fortran compiler to a new WIN 10 machine. Now it still compiled fine but whenever it runs to write(*,*), nothing is printed out and there is a severe (157) access violation error. Tried some other syntax such as write(6,*) but none works. I wonder if it's because of some settings I messed up in VS or fortran compiler.
Visual studio 2012, fortran XE2013 update 5.
Thanks.
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
The problem is the access violation, not the syntax. Does this happen for any kind of WRITE or just a particular one in your program? Does a simple "Hello World" program work? (For example, the default new program console application template in VS.)
Since you didn't show us any code, nor did you tell us if you recreated the project or simply copied the project from the other system, it's hard to guess what the issue might be. I will throw out one possibility - you have an allocatable array that you assign to without explicitly allocating, and didn't enable the "Enable F2003 Semantics" option (or add /assume:realloc_lhs in the Command Line options.) There are many other possibilities.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Please attach the .vfproj file for your project.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
<?xml version="1.0" encoding="UTF-8"?>
<VisualStudioProject ProjectCreator="Intel Fortran" Keyword="Console Application" Version="11.0" ProjectIdGuid="{9D485934-964F-49BC-9FD5-6A2F5F5E37C1}">
<Platforms>
<Platform Name="Win32"/>
<Platform Name="x64"/></Platforms>
<Configurations>
<Configuration Name="Debug|Win32">
<Tool Name="VFFortranCompilerTool" SuppressStartupBanner="true" DebugInformationFormat="debugEnabled" Optimization="optimizeDisabled" WarnInterfaces="true" Traceback="true" RuntimeChecks="rtChecksAll" BoundsCheck="true" RuntimeLibrary="rtMultiThreadedDebug"/>
<Tool Name="VFLinkerTool" LinkIncremental="linkIncrementalNo" SuppressStartupBanner="true" GenerateDebugInformation="true" SubSystem="subSystemConsole"/>
<Tool Name="VFResourceCompilerTool"/>
<Tool Name="VFMidlTool" SuppressStartupBanner="true"/>
<Tool Name="VFCustomBuildTool"/>
<Tool Name="VFPreLinkEventTool"/>
<Tool Name="VFPreBuildEventTool"/>
<Tool Name="VFPostBuildEventTool"/>
<Tool Name="VFManifestTool" SuppressStartupBanner="true"/></Configuration>
<Configuration Name="Release|Win32">
<Tool Name="VFFortranCompilerTool" SuppressStartupBanner="true" Traceback="true" RuntimeChecks="rtChecksAll"/>
<Tool Name="VFLinkerTool" LinkIncremental="linkIncrementalNo" SuppressStartupBanner="true" SubSystem="subSystemConsole"/>
<Tool Name="VFResourceCompilerTool"/>
<Tool Name="VFMidlTool" SuppressStartupBanner="true"/>
<Tool Name="VFCustomBuildTool"/>
<Tool Name="VFPreLinkEventTool"/>
<Tool Name="VFPreBuildEventTool"/>
<Tool Name="VFPostBuildEventTool"/>
<Tool Name="VFManifestTool" SuppressStartupBanner="true"/></Configuration>
<Configuration Name="Debug|x64">
<Tool Name="VFFortranCompilerTool" SuppressStartupBanner="true" DebugInformationFormat="debugEnabled" Optimization="optimizeDisabled" WarnInterfaces="true" Traceback="true" BoundsCheck="true" RuntimeLibrary="rtMultiThreadedDebug"/>
<Tool Name="VFLinkerTool" LinkIncremental="linkIncrementalNo" SuppressStartupBanner="true" GenerateDebugInformation="true" SubSystem="subSystemConsole"/>
<Tool Name="VFResourceCompilerTool"/>
<Tool Name="VFMidlTool" SuppressStartupBanner="true" TargetEnvironment="midlTargetAMD64"/>
<Tool Name="VFCustomBuildTool"/>
<Tool Name="VFPreLinkEventTool"/>
<Tool Name="VFPreBuildEventTool"/>
<Tool Name="VFPostBuildEventTool"/>
<Tool Name="VFManifestTool" SuppressStartupBanner="true"/></Configuration>
<Configuration Name="Release|x64">
<Tool Name="VFFortranCompilerTool" SuppressStartupBanner="true" Optimization="optimizeFull" VectorizationThreshold="90" PrefetchInsertionOpt="prefetchMedium" InterproceduralOptimizations="ipoSingleFile" MatrixLibrary="mlNo" RuntimeChecks="rtChecksNone" RuntimeLibrary="rtQuickWin"/>
<Tool Name="VFLinkerTool" LinkIncremental="linkIncrementalYes" SuppressStartupBanner="true" SubSystem="subSystemConsole" AdditionalDependencies="XXXXXXXX.lib"/>
<Tool Name="VFResourceCompilerTool"/>
<Tool Name="VFMidlTool" SuppressStartupBanner="true" TargetEnvironment="midlTargetAMD64"/>
<Tool Name="VFCustomBuildTool"/>
<Tool Name="VFPreLinkEventTool"/>
<Tool Name="VFPreBuildEventTool"/>
<Tool Name="VFPostBuildEventTool"/>
<Tool Name="VFManifestTool" SuppressStartupBanner="true"/></Configuration></Configurations>
<Files>
<Filter Name="Header Files" Filter="fi;fd"/>
<Filter Name="Resource Files" Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"/>
<Filter Name="Source Files" Filter="f90;for;f;fpp;ftn;def;odl;idl">
<File RelativePath="..\v3.0\v3.0\Source New\XXXXXXX.f90">
<FileConfiguration Name="Release|x64">
<Tool Name="VFFortranCompilerTool" PrefetchInsertionOpt="prefetchMedium" InterproceduralOptimizations="ipoMultiFile"/></FileConfiguration></File>
List XXXXXXX file configuration info
<Globals/></VisualStudioProject>
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I don't see anything obvious here. Which configuration are you building? Does it happen with either a Debug or Release build? If you put a write(*,*) "Hello" at the start of the program, do you get the error?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I was calling the exe generated from this project A with another exe generated from another project B.
Here is the codes I used in project B to call A.exe.
INQUIRE (FILE='A.EXE', EXIST = EXT2) IF(.NOT.EXT2) THEN WRITE(911,*) "ERROR, A.EXE not found" STOP ENDIF MS = SYSTEM("A.exe")
The crash happens if I do write(*,*) anywhere in project A, even at the start of A. There is no error if I do write(*,*) in B.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
What happens if you run A.EXE directly from a command prompt? Is project B a console application? Can you provide us with a complete test case (including both A and B projects)?
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page