- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I have installed VS 2005, Intel 9.1 (C and FORTRAN) and am trying to compile a simple program from a cygwn window. I am getting undefined externals - am I missing a library?
GECRD-E65569F5C> ifort maxmem.f
Intel Fortran Compiler for Intel EM64T-based applications, Version 9.1
Build 20060324
Copyright (C) 1985-2006 Intel Corporation. All rights reserved.
Microsoft Incremental Linker Version 8.00.50727.42
Copyright (C) Microsoft Corporation. All rights reserved.
-out:maxmem.exe
-subsystem:console
maxmem.obj
LIBCMT.lib(open.obj) : error LNK2001: unresolved external symbol __imp_CloseHandle
LIBCMT.lib(initcon.obj) : error LNK2001: unresolved external symbol __imp_CloseHandle
libifcoremt.lib(for_nt_open_proc.obj) : error LNK2019: unresolved external symbol __imp_CloseHandle referenced in function for__reopen_file
libifcoremt.lib(for_close_proc.obj) : error LNK2001: unresolved external symbol__imp_CloseHandle
LIBCMT.lib(thread.obj) : error LNK2001: unresolved external symbol __imp_CloseHandle
LIBCMT.lib(close.obj) : error LNK2001: unresolved external symbol __imp_CloseHandle
libifcoremt.lib(for_reentrancy.obj) : error LNK2001: unresolved external symbol__imp_CloseHandle
libifcoremt.lib(for_lub_mgt.obj) : error LNK2001: unresolved external symbol __imp_CloseHandle
libifcoremt.lib(for_diags_intel.obj) : error LNK2001: unresolved external symbol __imp_CloseHandle
libifcoremt.lib(for_avalloc.obj) : error LNK2001: unresolved external symbol __imp_CloseHandle
libifcoremt.lib(for_reentrancy.obj) : error LNK2019: unresolved external symbol__imp_Sleep referenced in function for__acquire_semaphore_threaded
libifcoremt.lib(for_get.obj) : error LNK2001: unresolved external symbol __imp_Sleep
LIBCMT.lib(crtheap.obj) : error LNK2001: unresolved external symbol __imp_Sleep
ifconsol.lib(for_m_console.obj) : error LNK2001: unresolved external symbol __im
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
The LIB variable is defined as:
GECRD-E65569F5C> printenv LIB
C:Program Files (x86)Microsoft Visual Studio 8VCPlatformSDKLIB;
C:Program FilesMicrosoft Visual Studio 8VCLIB;
c:Program Files (x86)IntelCompilerFortran9.1EM64TLIB;
c:Program Files (x86)IntelCompilerC++9.1EM64TLIB;
I had to add some mods to the LIB, PATH and INCLUDE variables in the .bashrc file to get things to work. These changes were intended to mirror the ifortvars and clvars.bat files plus changes so that cl.exe etc can be found. The mods are shown below.
#############################
#############################
##"c:/Program Files (x86)/Intel/Compiler/C++/9.1/em64t/bin/iclvars.bat"
export ICPP_COMPILER91="/cygdrive/c/Program Files (x86)/Intel/Compiler/C++/9.1"
export PATH="${ICPP_COMPILER91}/EM64T/BIN":${PATH}
export ICPP_COMPILER91="c:Program Files (x86)IntelCompilerC++9.1"
export LIB="${ICPP_COMPILER91}EM64TLIB;${LIB}"
export INCLUDE="${ICPP_COMPILER91}EM64TINCLUDE;${INCLUDE}"
#
###############################
##"c:/Program Files (x86)/Intel/Compiler/Fortran/9.1/em64t/bin/ifortvars.bat"
export IFORT_COMPILER91="/cygdrive/c/Program Files (x86)/Intel/Compiler/Fortran/9.1"
export PATH="${IFORT_COMPILER91}/EM64T/BIN":${PATH}
export IFORT_COMPILER91="c:Program Files (x86)IntelCompilerFortran9.1"
export LIB="${IFORT_COMPILER91}EM64TLIB;${LIB}"
export INCLUDE="${IFORT_COMPILER91}EM64TINCLUDE;${INCLUDE}"
##################################
##################################
#
# Visual Studio 2005 (cl and associated dll's)
export PATH="/cygdrive/C/Program Files/Microsoft Visual Studio 8/VC/BIN":$PATH
export PATH="/cygdrive/C/Program Files/Microsoft Visual Studio 8/Common7/IDE":$PATH
export LIB="C:Program FilesMicrosoft Visual Studio 8VCLIB;${LIB}"
export LIB="C:Program Files (x86)Microsoft Visual Studio 8VCPlatformSDKLIB;${LIB}"
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Steve - thanks for the info. It turned out it was the definition of the LIB variable.
I would like to use ifortvars.bat and iclvars.bat files to set up paths etc. However I need to build the code in a cygwin window hence the need to convert to a ksh type format as I don't know of any way to make the ksh inherit stuff from a com script. I also found the bat files don't set the paths and env vars for the CL compiler. Maybe I am missing something here
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
A correctly set up ifort.cfg also is required in order for ifort to find Microsoft components required at link time, or when attempting to run CL from the Fortran command window. When that isn't correct, cygwin may substitute its own (32-bit) link, and so the errors are confusing. In my own opinion, ifort should furnish a sample ifort.cfg and mention in the documentation the guidelines for setting it up, if the installer cannot be corrected to make ifort install automatically with Microsoft PSDK. I suppose this is a symptom of the moving target presented by Microsoft software. I have submitted several QuAD issues on this. The compiler team was able to correct known problems with ifortvars.bat setup, but not ifort.cfg.
Last week, on my x64 installation, CL was not invoking libraries properly in its own PSDK command window, so it should not be surprising that it continues to have difficulty in the ifortvars.bat window. This is separate from the problems occasioned by ifort setup not filling in ifort.cfg so that ifort can link; I have edited both icl.cfg and ifort.cfg so those compilers are working. I don't think many people care whether CL can run on its own in the ifort command window, if it can build objects which work in an ifort build.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ifort.cfg has nothing to do with this particular problem.

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