- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I have added `C:\path\to\files\thelibrary\include` to the `Configuration Properties --> Fortran --> General --> Additional Include Directories`, and used an `#include <someheaderfile.h>` inside my code, and everything was compiling as intended. Now I have created a sytem environment variable `TOTO` with value `C:\path\to\files\thelibrary` and replaced `C:\path\to\files\thelibrary\include` with `%TOTO%\include` inside `Configuration Properties --> Fortran --> General --> Additional Include Directories` and at compilation I had an `#error: can't find include file: someheaderfile.h`. I also tried with `%(TOTO)\include` and `%TOTO%\include` as well as `TOTO\include` and had the same error. I don't know though if this error is specific to the fact that I am inside a intel visual fortran project for visual studio or if I would have had the same issue with a vanilla c++ visual studio project.
Of course, I have the same issue with "additional libraries" etc.
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
After you defined the system environment variable, did you exit/restart your Visual Studio window? Not just reload the Fortran solution, actually exit out and restart Visual Studio.
And, no, this isn't just a Fortran-integration thing. I've seen this sort of thing with pure C/C++ projects too.
--Lorri
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Lorri Menard (Intel) wrote:After you defined the system environment variable, did you exit/restart your Visual Studio window? Not just reload the Fortran solution, actually exit out and restart Visual Studio.
And, no, this isn't just a Fortran-integration thing. I've seen this sort of thing with pure C/C++ projects too.
--Lorri
I even rebooted the d*** computer. :) One precision though : the problem does happen with the (system) environment variable I have created, but doesn't with using the environment variable IFORT_COMPILER19 in `%IFORT_COMPILER19%mkl\lib\intel64_win` for instance.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Other precision : I confirm that this doesn't happen with a vanilla (c++ console for instance) visual studio 2017 project, nor with intel visual fortran console project. (My project type, with which I have a problem, is "intel visual fortran dll project".)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
The syntax you want is $(TOTO)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
As I wrote in my question, I "did" try $(TOTO) and it didn't work ... Anyway, now it worked. (Strange, maybe I mixed up things.)
Question, though : why does %TOTO% work for a fortran console project but not for a fortran dll project ?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I would not expect %TOTO% to work in either. Certainly the project type doesn't matter. The %TOTO% syntax works in a shell command,but not in the list of additional include directories.
What I have seen sometimes is that setting system environment variables don't "take" right away, sometimes needing a logout/login.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Steve Lionel (Ret.) (Blackbelt) wrote:I would not expect %TOTO% to work in either. Certainly the project type doesn't matter. The %TOTO% syntax works in a shell command,but not in the list of additional include directories.
Well `%IFORT_COMPILER19%mkl\include` is understood without problem any though.
Steve Lionel (Ret.) (Blackbelt) wrote:What I have seen sometimes is that setting system environment variables don't "take" right away, sometimes needing a logout/login.
Yes, same for me, I was never clear on that.

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