Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.
29413 Discussions

Using /LIBPATH with an environment variable

Pellegrini_Eric
Beginner
717 Views

Hello everybody,

I am using intel visual fortran compiler 11.1 and I got some troubles when linking my application.

When using a command file as an argument to the linker I would like to include an additional directory to search for lib files using /LIBPATH option. This works if the path for that directory is hardcoded but fails when using an environment variable.

Here is the command file I provide to the linker:

/out:myexec.exe

/subsystem:windows

*.obj

/LIBPATH:%MYENVVAR%

where %MYENVVAR% is set to to the path of the directory that contains the lib file I need.

When runing the linker with that command file, I got a LNK1181 type error.

Any idea ?

Thank you for your help

Eric

0 Kudos
1 Reply
Steven_L_Intel1
Employee
717 Views

As far as I know, substitution of %envvar% is done by the command shell only. The file you are passing to the linker is not interpreted by the command shell.

Why don't you just define (or add to) the LIB environment variable before doing the link?

0 Kudos
Reply