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

Add winspool.drv to project

klaus_knebel
Beginner
1,281 Views

Hello
I need to add the following file to my project
C:WINDOWSsystemwinspool.drv
How can I do that in VS.2005 ?

BTW:
Forum Postings dont work using Firefox Browser ?

Klaus

0 Kudos
8 Replies
Jugoslav_Dujic
Valued Contributor II
1,281 Views

klaus.knebel@mero.de:

Hello
I need to add the following file to my project
C:WINDOWSsystemwinspool.drv
How can I do that in VS.2005 ?

You don't. Instead, you likely need jsut winspool.lib, which you should just append to the linker list at Project Properties/Linker/Input/Additional dependencies.

klaus.knebel@mero.de:

Forum Postings dont work using Firefox Browser ?



Yes, known Forum bug. As a workaround, hit "Continue" on the "Script not responding" dialog and press space bar immediately. Or, use IE View or IE Tab extension.
0 Kudos
klaus_knebel
Beginner
1,281 Views

It is not a .lib file is is a .drv file.

When I do that I get the following error message.

1>Fatal error cannot open "C:wintlib.if8winter.lib;C:WINDOWSsystemwinspool.drv"

Klaus

0 Kudos
Les_Neilson
Valued Contributor II
1,281 Views

Depending on which version of Visual Studio you are using "winspool.lib" is found in :

VS6 = Microsoft Visual StudioVC98lib or

VS2003 =Microsoft Visual Studio .NET 2003Vc7PlatformSDKLib or

VS2005 = Microsoft Visual Studio 8VCPlatformSDKLib

The "winspool.mod" file is found in your Fortran installation "include" directory.

Les

0 Kudos
Jugoslav_Dujic
Valued Contributor II
1,281 Views
klaus.knebel@mero.de:

It is not a .lib file is is a .drv file.



Exactly, that was my point -- Winspool.drv shouldn't be referenced in your project at all.

Winspool.drv is a Windows system library (it's actually a .dll, just with a funny extension) containing functions related with printing. The winspool lib is its import library, which should be linked with your project. Module Winspool contains the function declarations.

As I see, just USE DFWIN automatically pulls in everything you need for both CVF and IVF (both module and library reference). See the attached project, which calls Winspool function EnumPrinters (and displays the names of all printers installed on your computer) and loads Winspool.drv automatically upon start. So, you should remove all your references to Winspool.drv rather than trying to include them.
0 Kudos
klaus_knebel
Beginner
1,281 Views

Ok
I slowly understand.
I copied all the required libs to my project folder and added them to the source file list.
Then it works.
But, it seems, that my projekt cannot find the .lib files in the original folder like :
C:ProgrammeMicrosoft Visual Studio 8VCPlatformSDKLib
Although the folders are set in the : Set directory list

$(IFORTInstallDir)Lib
$(VCInstallDir)lib
$(VCInstallDir)atlmfclib
$(VCInstallDir)atlmfclibi386
$(VCInstallDir)PlatformSDKlib
$(FrameworkSDKDir)lib
$(VSInstallDir)
$(VSInstallDir)lib
C:ProgrammeMicrosoft Visual Studio 8VCATLMFCLIB
C:ProgrammeMicrosoft Visual Studio 8VCLIB
C:ProgrammeMicrosoft Visual Studio 8VCPlatformSDKlib
C:ProgrammeMicrosoft Visual Studio 8SDKv2.0lib
C:wintCVFlib.if8
LIB=C:Program FilesMicrosoft Visual StudioVC98LIB
C:Program FilesMicrosoft Visual StudioDF98LIB

Any idea, why this can be ?

Klaus

0 Kudos
Jugoslav_Dujic
Valued Contributor II
1,281 Views
OK. Let me clarify few things:

On Project/Properties/Linker/Input/Additional dependencies, you specify list of external .lib files to be linked in. Those libraries can be in either of the following forms:
  1. foobar.lib whatever.lib
  2. C:somewherefoobar.lib D:elsewherewhateverwhatever.lib
If you use option 1), i.e. no explicit paths, the linker will search for those .libs in the project folder as well as in directories specified in Tools/Options/Intel Fortran/General/Libraries (i.e. LIB environment variable has no effect from the VS, only from the command line).

That being said, I've just added the text "C:wintlib.if8winter.lib;C:WINDOWSsystemwinspool.drv" to my ..."Additional dependencies" edit box on a sample project and I got
1>Linking...
1>Fatal error cannot open "C:wintlib.if8winter.lib;C:WINDOWSsystemwinspool.drv"

If that's your case as well, just go to the said "Additional dependencies" edit box on Project Properties, remove the entire winspool.drv path (and fix the winter.lib as well if necessary). Note that the libraries should be separated by spaces, not by semicolons.
0 Kudos
klaus_knebel
Beginner
1,281 Views

Hello

this means I need to specify each lib which I need at 'Additional dependencies'

I thought it is enough to give the path only and the linker takes whatever is needed.

Thanky again fo the good and fast help.

Klaus

0 Kudos
Jugoslav_Dujic
Valued Contributor II
1,281 Views
Yes, that's normally what one should do.

There's an alternate method, whereby you specify
!DEC$OBJCOMMENT LIB: "whatever.lib"
anywhere in the source code. However, I recommend against it, as it 1) causes the reference to "whatever.lib" to be embedded in the .obj file 2) with time, it can become a mess, because with time !DEC$OBJCOMMENTs spread all over the code will become untraceable, and porting to another computer or renaming a library would become difficult. It's best to keep the library list centralized in the project settings.

(For example, there's !DEC$OBJCOMMENT LIB:"WINSPOOL.LIB" in C:Program FilesIntelCompilerFortran9.1IA32Includewinspool.f90, which causes my program above to build without specifying additional libraries. However, in this case, it is known that USE WINSPOOL will require the system's "winspool.lib" from now to eternity -- adding your own libraries might not be so if you e.g. wish to reorganize sources one day.)
0 Kudos
Reply