I'm new in Fortran and Visual Studio. I need to compile and run one code from the reference manual of one commercial software.
When I directly open (from windows explorer) "bintst.F" then Visual Studio recognizes that "c" and "*deck" are comments automatically. But when I create new project and copy/paste the text from "bintst.F" - syntax errors are appeared and "c" and "*deck" are not recognized. Help me please to fix it.
IDE (This project was started with a template "Intel(R) Visual Fortran console application" I switched an extension from .f90 to .F manually, just for test):
Visual Studio 2015 Professional.
Intel Visual Fortran Compiler 220.127.116.11
Windows 7 x64
Compiler is launched with:
ifort /nologo /debug:full /Od /fpp /I"C:\ANSYS\v171\ansys\customize\include" /free /warn:all /module:"Debug" /object:"Debug" /Fd"Debug\vc140.pdb" /traceback /check:bounds /check:stack /libs:dll /threads /dbglibs /c /extfor:F /Qlocation,link,"C:\MV14\VC\\bin" /Qm32 "D:\tmp\fortran\vs1\Console1\Console1\bintst.F"
*deck,bintst USERDISTRIB ansys program bintst c *** primary function: dumps a binary file with the name, file.rst, c to the screen. it then takes that file and copies it to a new c file, file2.rst. lastly, it dumps the file, file2.rst, to the c screen for comparison purposes c c *** Notice - This file contains ANSYS Confidential information *** c c Copyright ANSYS. All Rights Reserved. c *** ansys, inc. c c common variables: c iout (int,sc,comm) - output unit number c intpdp (int,sc,comm) - number of integers per double precision word c lenfnm (int,sc,comm) - number of characters in the filename c reclng (int,sc,comm) - system record length c c NOTE: bintst is not part of binlib.a. it is c included only as an aid to users. c #include "impcom.inc" #include "unixpm.inc" external binini,bintrd,bintwr,biniqr,bintfo,modinfo integer biniqr c integer units, code character*80 title(2) character*260 pname,nname character*250 jobnam c integer iout,intpdp,lenfnm,reclng common /bintcm/ iout,intpdp,lenfnm,reclng c c ********** define application exit mode ********** system call modinfo(1,1) c ********** define the output unit number ********** system iout = 6 c ********** define the number of integers per double precision intpdp = biniqr (0,2) c ********** define the number of characters in the file name lenfnm = biniqr (0,3) c ********** define the i/0 buffer page length (integer*4 words) reclng = biniqr (0,1) c c ********** define the file names ********** system pname = 'file.rst' nname = 'file2.rst' c c ********** initialize the bin routines ********** call binini (iout) c c ********** initialize the header common ********** title(1) = 'New title as given by BINTST' title(2) = 'New subtitle as given by BINTST' jobnam = 'file ' units = 0 c --- the value for code below should be changed to appropriate 3rd party code code = 200 call bintfo (title,jobnam,units,code) c ********** read and list the file file.rst ********** call bintrd (pname) c c ********** copy file file.rst to file file2.rst ********** call bintwr (pname,nname) c c ********** read and list the file file2.rst ********** call bintrd (nname) c stop end
I solved syntax error by switching fixed/free format to "use file extension" and adding special preprocessor directives (I found them in one .bat file that prepares for launching).
But now I have another problem:
Deleting intermediate files and output files for project 'Console2', configuration 'Debug|Win32'. Compiling with Intel(R) Visual Fortran Compiler 18.104.22.168 [IA-32]... ifort /debug:full /fpp /I"C:\ANSYS\v171\ansys\customize\include" /warn:all /module:"Debug\\" /object:"Debug\\" /Fd"Debug\vc140.pdb" /traceback /check:all /libs:dll /threads /dbglibs /c /D__EFL /DNOSTDCALL /DARGTRAIL /DPCWINNT_SYS /DPCWIN64_SYS /DPCWINX64_SYS /DCADOE_ANSYS /fpp /4Yportlib /4Ya /c /Fo.\ /DFORTRAN /MD /W0 /extfor:F /Qlocation,link,"C:\MV14\VC\\bin" /Qm32 "D:\tmp\fortran\vs1\Console2\Console2\Console2.F" Intel(R) Visual Fortran Intel(R) 64 Compiler for applications running on IA-32, Version 17.0 Build 20161005 Copyright (C) 1985-2016 Intel Corporation. All rights reserved. ifort: NOTE: The evaluation period for this product ends on 17-feb-2017 UTC. Compiling manifest to resources... rc.exe /fo "Debug\Console2.exe.embed.manifest.res" "Debug\Console2.exe.embed.manifest.rc" Microsoft (R) Windows (R) Resource Compiler Version 6.3.9600.17336 Copyright (C) Microsoft Corporation. All rights reserved. Linking... Link /OUT:"Debug\Console2.exe" /VERBOSE /NOLOGO /MANIFEST /MANIFESTFILE:"Debug\Console2.exe.intermediate.manifest" /MANIFESTUAC:"level='asInvoker' uiAccess='false'" /DEBUG /PDB:"D:\tmp\fortran\vs1\Console2\Console2\Debug\Console2.pdb" /SUBSYSTEM:CONSOLE /IMPLIB:"D:\tmp\fortran\vs1\Console2\Console2\Debug\Console2.lib" C:\ANSYS\v171\ansys\custom\Misc\Winx64\binlib.lib -qm32 "Debug\Console2.obj" "Debug\Console2.exe.embed.manifest.res" ipo: error #11018: Cannot open Debug\Console2.obj LINK : fatal error LNK1181: cannot open input file 'Debug\Console2.obj' Console2 - 2 error(s), 0 warning(s)
I am unable to reproduce the error but with your project the failure might relate to an earlier thread where it was noted that "x86" appears in the Solution Platforms pull-down (just under the Tools label on the tool bar). That should read "Win32" not "x86". That is happening as a by-project of starting a new project and a defect with our integrations defaulting to the "x86" platform configuration.
Within the Solution Platforms box, left-click on the x86 value and select Configuration Manager. When that appears, under Active solution platform, left-click on x86 and select New. When the New Solution Platform dialog appears, verify that Win32 appears in the Type or select the new platform, that x86 appears in Copy settings from, the Create new project platforms checkbox is checked, and then click OK. That will create and change the Active solution platform to Win32. Click Close on the Configuration Manager dialog.
With that set, try rebuilding the project or solution.