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

GSHandlerCheck

connell
Beginner
3,192 Views

I have a XP64 program (9.1 FORTRAN and C compilers and VS2005 SP1) that is linking and running correctly.
I need to add capabilty that requires a link against some third party libraries. When I attempt to link (using ifort) I get an unresolved external of GSHandlerCheck. A web article (http://blogs.msdn.com/mgaur/archive/2006/12/21/lnk2019-unresolved-external-symbol-gshandlercheck.aspx) libcmt.lib needs to be included - when I try this the original error stays and I get more errors about double defined variables (free, malloc etc) in libcmt and msvcrt. Any Ideas?

Stuart Connell

0 Kudos
10 Replies
Steven_L_Intel1
Employee
3,192 Views
You need to make sure that the libraries type setting you specify for your project(s) matches the one that this library requires. It sounds to me as if it wants the static multithreaded library, so set that in your C and Fortran projects.
0 Kudos
connell
Beginner
3,192 Views

I am building from the command .line. My FORTRAN/C compile and link uses -MD option. Are you indicating that the libs were built with a different set of options?

Stuart

0 Kudos
Steven_L_Intel1
Employee
3,192 Views
Very likely. Here's how to find out. From the command line, do:

dumpbin -directives yourlib.lib

and see which library directives are used. If the library code is C code, you must choose the same set of libraries. If it's Fortran code, then you can use linker options to ignore the conflicting libraries.
0 Kudos
connell
Beginner
3,192 Views

Note I am using XP64 and building 64 bit exe's. When I try to start dumpbin I get

The procedure entry point __security_error_handler could not be found in MSVCR80.dll

The smae thing works on my 32 bit box. There are numerous (different) versions of this dll on my machine. I think it is getting the one from the SDK area. Do I have a bad dll?

Stuart

0 Kudos
Steven_L_Intel1
Employee
3,192 Views
Which PSDK do you have installed? What's the value of PATH in the command window you're using and how did you start the command window? If you're using the "Fortran Build Environment...", does it say it is setting up for VS2005 or for the PSDK?
0 Kudos
connell
Beginner
3,192 Views

I have 2003 Release 2 Platform SDK installed. When I start the command windows I run iclvars.bat followed by ifortvars.bat.These have been modified slightly as recommended by Intel premier support as a result of an earlier issue. The output at the screen is

Intel C++ Compiler 9.1.030 build environment for EM64T-based applications
Copyright (C) 1985-2006 Intel Corporation. All rights reserved.

Targeting Windows Server 2003 X64 RETAIL

'Fortran' is not recognized as an internal or external command,
operable program or batch file.

Intel Fortran Compiler 9.1.029 build environment for EM64T-based applications

Copyright (C) 1985-2006 Intel Corporation. All rights reserved.

The contents of the files are listed below:

iclvars.bat

@echo off

echo.
echo Intel C++ Compiler 9.1.030 build environment for EM64T-based application
s
echo Copyright (C) 1985-2006 Intel Corporation. All rights reserved.
echo.

call "C:Program FilesMicrosoft Platform SDKSetEnv" /X64 /RETAIL
title Intel C++ Compiler 9.1.030 build environment for EM64T-based applicatio
ns

SET ICPP_COMPILER91=C:Program Files (x86)IntelCompilerC++9.1

SET INTEL_LICENSE_FILE=C:Program Files (x86)Common FilesIntelLicenses

Set Path=%ICPP_COMPILER91%EM64TBin;%path%

Set Lib=%ICPP_COMPILER91%EM64TLib;%LIB%

SET Include=%ICPP_COMPILER91%EM64TInclude;%Include%

ifortvars.bat

@echo off

Title Intel C/C++ & Fortran Compiler %s build environment for EM64T-based app
lications

echo.
echo Intel Fortran Compiler 9.1.029 build environment for EM64T-based applica
tions
echo Copyright (C) 1985-2006 Intel Corporation. All rights reserved.
echo.

rem call "C:Program FilesMicrosoft Visual Studio 8VCvcvarsall" x86_amd64

Title Intel Fortran Compiler 9.1.029 build environment for EM64T-based applic
ations
SET IFORT_COMPILER91=C:Program Files (x86)IntelCompilerFortran9.1

SET INTEL_LICENSE_FILE=C:c onnellIntel_compilerLicense

Set Path=%IFORT_COMPILER91%EM64TBin;%path%

Set Lib=%IFORT_COMPILER91%EM64TLib;%LIB%

SET Include=%IFORT_COMPILER91%EM64TInclude;%Include%

if exist "C:Program FilesIntelCompilerFortran9.1EM64TBinimsl.bat" call "
C:Program FilesIntelCompilerFortran9.1EM64TBinimsl.bat"


0 Kudos
connell
Beginner
3,192 Views

I forgot to add the value of PATH

NSK1XXES220BXXA> printenv PATH
/cygdrive/c/Program Files/Microsoft Platform SDK/Bin/Win64/x86/AMD64:.:/usr/loca
l/bin:/usr/bin:/bin:/usr/X11R6/bin:/cygdrive/c/Program Files (x86)/Intel/Compile
r/Fortran/9.1/EM64T/Bin:/cygdrive/c/Program Files (x86)/Intel/Compiler/C++/9.1/E
M64T/Bin:/cygdrive/c/Program Files/Microsoft Platform SDK/Bin/Win64/x86/AMD64:/c
ygdrive/c/Program Files/Microsoft Platform SDK/Bin:/cygdrive/c/Program Files/Mic
rosoft Platform SDK/Bin/WinNT:/cygdrive/c/Program Files (x86)/CA/Dcs/DMScripting
/:/cygdrive/c/Program Files (x86)/CA/DCS/CAWIN/:/cygdrive/c/program files (x86)/
imagemagick-6.2.8-q16:/cygdrive/c/WINDOWS/system32:/cygdrive/c/WINDOWS:/cygdrive
/c/WINDOWS/System32/Wbem:/cygdrive/c/Program Files/Intel/DMIX:/cygdrive/c/Progra
m Files (x86)/Microsoft SQL Server/90/Tools/binn/:/cygdrive/c/Program Files (x86
)/Intel/IDB/9.1/EM64T/Script:/cygdrive/c/Program Files (x86)/Intel/Compiler/C++/
9.1/IA32/Bin:/cygdrive/c/Program Files (x86)/Intel/Compiler/C++/9.1/EM64T/Bin:/c
ygdrive/c/Program Files (x86)/Intel/Compiler/C++/9.1/IA32/Bin:/cygdrive/c/Progra
m Files (x86)/Intel/Compiler/C++/9.1/EM64T/Bin:/cygdrive/c/Program Files (x86)/I
ntel/Compiler/Fortran/9.1/IA32/Bin:/cygdrive/c/Program Files (x86)/Intel/Compile
r/Fortran/9.1/EM64T/Bin:/cygdrive/c/Program Files (x86)/Intel/IDB/9.1/EM64T/Scri
pt:/usr/local/grace/bin

0 Kudos
Steven_L_Intel1
Employee
3,192 Views
Augh, you're using Cygwin. That adds another layer of complexity, though I don't know that it's relevant.

Instead of dumpbin, try:

link -dump -directives

The PSDK doesn't have "dumpbin" so you are getting one from somewhere else.
0 Kudos
connell
Beginner
3,192 Views

If I use link -dump -directives on the library with references to __GSHandlerCheck hdf5.libI get

Linker Directives
-----------------
/manifestdependency:"type='win32'
name='Microsoft.VC80.CRT'
version='8.0.50727.762'
processorArchitecture='amd64'
publicKeyToken='1fc8b3b9a1e18e3b'"
/DEFAULTLIB:"uuid.lib"
/DEFAULTLIB:"uuid.lib"
/DEFAULTLIB:"MSVCRT"
/DEFAULTLIB:"OLDNAMES"

The same thing on other libs gives different o/p. For example libadio45.lib

Linker Directives
-----------------
-defaultlib:ifconsol
-defaultlib:libifcoremd
-defaultlib:libifportmd
-defaultlib:libmmd
-defaultlib:MSVCRT
-defaultlib:libirc
-defaultlib:OLDNAMES
-defaultlib:ifconsol
-defaultlib:libifcoremd
-defaultlib:libifportmd
-defaultlib:libmmd
-defaultlib:MSVCRT
-defaultlib:libirc
-defaultlib:OLDNAMES

Not sure what this means - any ideas?

Stuart


0 Kudos
Steven_L_Intel1
Employee
3,192 Views
You need to link against the VS2005 SP1 libraries and not the PSDK you're using. This is an incompatiuble change MS introduced in VS2005 SP1. The library you have seems to have been compiled with the VS2005 SP1 compiler.

This is not a Fortran issue.
0 Kudos
Reply