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

Accessing static libraries

Intel_C_Intel
Employee
435 Views

Hello,

I have created a static library and I'd like to set the option for accessing it from the Command Line option of the IDE.

I have found that the following option works if setat the Linker Command Line option field:

/SUBSYSTEM:CONSOLE "D:Fortran ProjectsMyLibrarydebugMyLibrary.lib"

Is this the recommended way?

Thank you,

Yair

0 Kudos
4 Replies
Steven_L_Intel1
Employee
435 Views
No. There are two recommended ways. One is to list it under "Additional Dependencies" on the Linker Input property page. The other is to add the .lib as a source file to the project. While the method you have works, using the existing property for this is better.
0 Kudos
Intel_C_Intel
Employee
435 Views

Well, I actually used your 1st recommendation and then I saw in the Linker Command Line All Options field that there appears:

/SUBSYSTEM:CONSOLE mylibname

So I guess I can equivalently put that option manually in the Additional Options field on the same page. Is there a difference between these two?

I generally prefer to put all my options on the Command Line pages of both the Fortran and the Linker property pages so I can easily see what changes I've made to the defaults.

0 Kudos
Intel_C_Intel
Employee
435 Views

Hmmm... apparently /SUBSYSTEM:CONSOLE was already there. What was added is just the library name, which I think can equivalently be added to the Linker's Command Line Property Page (I've tried it and it works).

Is that so?

0 Kudos
Steven_L_Intel1
Employee
435 Views
I prefer to use the property pages when there is a place for an option, as there is here, but if you like it the other way and it works for you, that's fine.
0 Kudos
Reply