- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Has anyone figured out how to control which version number of the IFX compiler is used when compiling in Visual studio. I know about the Tools/Options, but that is a global setting. I need to make sure that when maintaining old code, it does not switch to the latest compiler, but new code does use the latest compiler. The global setting affects compiling all projects which is not a useful feature.
I see there is a pre-build step, can we use this to set an appropriate environment variable?
Link Copied
- 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
USE ISO_FORTRAN_ENV
CHARACTER(LEN=256) :: VERSION
VERSION=COMPILER_VERSION( )
WRITE(*,*)TRIM(VERSION)
END
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
That tells you what version you used the request is to SET the version to be used from those installed for specific projects in a solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
This is something you can try. I haven't experimented with this.
Separate the IFX version dependent code (libraries) into different Solutions (not Projects).
For each, add a pre-build event that performs the setvars.bat of the desired IFX version
Note, I have not tested this to see if the environment variables from the pre-build event are used by the solution build.
This is something you might be able to do.
Note, the pre-build event is for Solution build, not a per-project build.
Another hack that might work in a single solution (you will have to try this).
Have each project dependent on the output of something that performs the intended setvars for the project.
IIF the setvars are sticky (persists) this may work
This will require that the solution pre-build event deletes these dependencies.
Also, you may need to disable multi-process compilation.
EDIT:
You can also create two batch files:
: batch to build using old version
call setenvold.bat
devenv YourOldIFXSolution.sln
The other is similar using different file names.
Place shortcuts on your desktop to these batch files.
Modify the shortcuts to specify an appropriate start in location
Jim Dempsey
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Unfortunately, compiler version selection is not a project or solution property. Jim's suggestion of using a batch file to establish the desired version is good - you must then use "devenv /useenv" to start Visual Studio with the designated environment.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks Steve for mentioning the /useenv, I missed that.
Jim

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page