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

Unresolved external symbols

Ashley_Weinstein
Beginner
7,464 Views
When I attempt to compile some legacy code I first get an error that the linker cannot find DFWIN.LIB (from CVF days). So I ignore that specific library. Then I get another file that's a problem too. So I walk down the line and ignore the libraries that it's looking for. Overall the following 5 libraries are ignored:

dfwin.lib, dfor.lib, libc.lib, dfconsol.lib, dfport.lib

I have the libraries the linker wants (from a computer that still has CVF 6.6c installed on it) and I added them into the project solution but this did not resolve the issue. It began to have duplicate definitions errors, between the CVF version of the file and IVF version of the file.

After ignoring all 5 libraries I get the following error below. To me it appears that the functions that PSWPTH is looking for are Fortran intrinsic functions and since this is legacy code these intrinsic functions must be from CVF.

Linking...
Creating temporary file "RSP1.rsp" with contents
[
 /OUT:"K:\\Pyrotec\\Software\\RSISimcon\\930680IVF\\RSIEFPSBASE\\Release\\EFPS6.exe" /INCREMENTAL:NO /NOLOGO /NODEFAULTLIB:"dfwin.lib" /NODEFAULTLIB:"dfor.lib" /NODEFAULTLIB:"libc.lib" /NODEFAULTLIB:"dfconsol.lib" /NODEFAULTLIB:"dfport.lib" /MANIFEST /MANIFESTFILE:"K:\\Pyrotec\\Software\\RSISimcon\\930680IVF\\RSIEFPSBASE\\Release\\EFPS6.exe.intermediate.manifest" /MANIFESTUAC:"level='asInvoker' uiAccess='false'" /DEBUG /PDB:"Debug/EFPS6.pdb" /SUBSYSTEM:CONSOLE kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /MACHINE:I386 "Debug/RSIDECNFG.obj" "Debug/PYGERA.obj" "Debug/fbxdrv.obj" "Debug/PyrolmLink.obj" "Debug/RSISPY.obj" "Debug/EFPSVersionInfo.res" "K:\\Pyrotec\\Software\\RSISimcon\\930680IVF\\RSIEFPSBASE\\Release\\GUIlink.lib" "K:\\Pyrotec\\Software\\RSISimcon\\930680IVF\\RSIEFPSBASE\\slmpsw\\lsapiw32.lib" "K:\\Pyrotec\\Software\\RSISimcon\\930680IVF\\RSIEFPSBASE\\PASSWD.lib" "K:\\Pyrotec\\Software\\RSISimcon\\930680IVF\\RSIEFPSBASE\\Release\\GEN9306.lib" "K:\\Pyrotec\\Software\\RSISimcon\\930680IVF\\RSIEFPSBASE\\Release\\TLEX.lib" "K:\\Pyrotec\\Software\\RSISimcon\\930680IVF\\RSIEFPSBASE\\Release\\Flowsheet.lib" "K:\\Pyrotec\\Software\\RSISimcon\\930680IVF\\RSIEFPSBASE\\Release\\SPYRO6.lib" "K:\\Pyrotec\\Software\\RSISimcon\\930680IVF\\RSIEFPSBASE\\Release\\FIREBOX.lib" "K:\\Pyrotec\\Software\\RSISimcon\\930680IVF\\RSIEFPSBASE\\Release\\LMFAC.lib" "K:\\Pyrotec\\Software\\RSISimcon\\930680IVF\\RSIEFPSBASE\\Release\\CONVEC.lib" "K:\\Pyrotec\\Software\\RSISimcon\\930680IVF\\RSIEFPSBASE\\NLSECURE.lib" "K:\\Pyrotec\\Software\\RSISimcon\\930680IVF\\RSIEFPSBASE\\Release\\KIN9306.lib" "K:\\Pyrotec\\Software\\RSISimcon\\930680IVF\\RSIEFPSBASE\\Release\\AUXILL.lib" "k:\\Pyrotec\\Software\\RSISimcon\\930680IVF\\RSIEFPSBASE\\Debug\\EFPS6_lib.lib"
]
Creating command line "Link @"K:\\Pyrotec\\Software\\RSISimcon\\930680IVF\\RSIEFPSBASE\\Debug\\RSP1.rsp""

Link: executing 'link'
EFPS6_lib.lib(Pyrolm.obj) : warning LNK4075: ignoring '/EDITANDCONTINUE' due to '/INCREMENTAL:NO' specification
LINK : warning LNK4098: defaultlib 'LIBCMT' conflicts with use of other libs; use /NODEFAULTLIB:library
NLSECURE.lib(PSWPTH.OBJ) : error LNK2019: unresolved external symbol _GETENVQQ@16 referenced in function _PSWPTH
NLSECURE.lib(PSWPTH.OBJ) : error LNK2019: unresolved external symbol _for_f90_index@20 referenced in function _PSWPTH
NLSECURE.lib(PSWPTH.OBJ) : error LNK2019: unresolved external symbol _for_len_trim@8 referenced in function _PSWPTH
NLSECURE.lib(PSWPTH.OBJ) : error LNK2001: unresolved external symbol _for_len_trim@8
NLSECURE.lib(PSWPTH.OBJ) : error LNK2001: unresolved external symbol _for_len_trim@8
NLSECURE.lib(PSWPTH.OBJ) : error LNK2019: unresolved external symbol __OtsMoveMinimum referenced in function _PSWPTH
NLSECURE.lib(PSWPTH.OBJ) : error LNK2019: unresolved external symbol __OtsFill referenced in function _PSWPTH
NLSECURE.lib(PSWPTH.OBJ) : error LNK2019: unresolved external symbol _SPLITPATHQQ@40 referenced in function _PSWPTH
K:\\Pyrotec\\Software\\RSISimcon\\930680IVF\\RSIEFPSBASE\\Release\\EFPS6.exe : fatal error LNK1120: 6 unresolved externals


EFPS6 - 9 error(s), 4 warning(s)

So I look into the static library containing PSWPTH.f and I see that it's using DFWIN and using DFLIB. I comment both of those out, recompile the *.lib file and reinsert it into the main project. I compile and get the following:

Linking...
Creating temporary file "RSP1.rsp" with contents
[
 /OUT:"K:\\Pyrotec\\Software\\RSISimcon\\930680IVF\\RSIEFPSBASE\\Release\\EFPS6.exe" /INCREMENTAL:NO /NOLOGO /NODEFAULTLIB:"dfwin.lib" /NODEFAULTLIB:"dfor.lib" /NODEFAULTLIB:"libc.lib" /NODEFAULTLIB:"dfconsol.lib" /NODEFAULTLIB:"dfport.lib" /MANIFEST /MANIFESTFILE:"K:\\Pyrotec\\Software\\RSISimcon\\930680IVF\\RSIEFPSBASE\\Release\\EFPS6.exe.intermediate.manifest" /MANIFESTUAC:"level='asInvoker' uiAccess='false'" /DEBUG /PDB:"Debug/EFPS6.pdb" /SUBSYSTEM:CONSOLE kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /MACHINE:I386 "Debug/RSIDECNFG.obj" "Debug/PYGERA.obj" "Debug/fbxdrv.obj" "Debug/PyrolmLink.obj" "Debug/RSISPY.obj" "Debug/EFPSVersionInfo.res" "K:\\Pyrotec\\Software\\RSISimcon\\930680IVF\\RSIEFPSBASE\\Release\\GUIlink.lib" "K:\\Pyrotec\\Software\\RSISimcon\\930680IVF\\RSIEFPSBASE\\slmpsw\\lsapiw32.lib" "K:\\Pyrotec\\Software\\RSISimcon\\930680IVF\\RSIEFPSBASE\\PASSWD.lib" "K:\\Pyrotec\\Software\\RSISimcon\\930680IVF\\RSIEFPSBASE\\Release\\GEN9306.lib" "K:\\Pyrotec\\Software\\RSISimcon\\930680IVF\\RSIEFPSBASE\\Release\\TLEX.lib" "K:\\Pyrotec\\Software\\RSISimcon\\930680IVF\\RSIEFPSBASE\\Release\\Flowsheet.lib" "K:\\Pyrotec\\Software\\RSISimcon\\930680IVF\\RSIEFPSBASE\\Release\\SPYRO6.lib" "K:\\Pyrotec\\Software\\RSISimcon\\930680IVF\\RSIEFPSBASE\\Release\\FIREBOX.lib" "K:\\Pyrotec\\Software\\RSISimcon\\930680IVF\\RSIEFPSBASE\\AUXILL\\Release\\AUXILL.lib" "K:\\Pyrotec\\Software\\RSISimcon\\930680IVF\\RSIEFPSBASE\\Release\\LMFAC.lib" "K:\\Pyrotec\\Software\\RSISimcon\\930680IVF\\RSIEFPSBASE\\Release\\CONVEC.lib" "K:\\Pyrotec\\Software\\RSISimcon\\930680IVF\\RSIEFPSBASE\\NLSECURE.lib" "K:\\Pyrotec\\Software\\RSISimcon\\930680IVF\\RSIEFPSBASE\\Release\\KIN9306.lib" "k:\\Pyrotec\\Software\\RSISimcon\\930680IVF\\RSIEFPSBASE\\Debug\\EFPS6_lib.lib"
]
Creating command line "Link @"K:\\Pyrotec\\Software\\RSISimcon\\930680IVF\\RSIEFPSBASE\\Debug\\RSP1.rsp""

Link: executing 'link'
EFPS6_lib.lib(Pyrolm.obj) : warning LNK4075: ignoring '/EDITANDCONTINUE' due to '/INCREMENTAL:NO' specification
LINK : warning LNK4098: defaultlib 'LIBCMT' conflicts with use of other libs; use /NODEFAULTLIB:library
AUXILL.lib(PSWPTH.obj) : error LNK2019: unresolved external symbol _GETENVQQ@16 referenced in function _PSWPTH
AUXILL.lib(PSWPTH.obj) : error LNK2019: unresolved external symbol _GETMODULEFILENAME@16 referenced in function _PSWPTH
AUXILL.lib(PSWPTH.obj) : error LNK2019: unresolved external symbol _SPLITPATHQQ@40 referenced in function _PSWPTH
K:\\Pyrotec\\Software\\RSISimcon\\930680IVF\\RSIEFPSBASE\\Release\\EFPS6.exe : fatal error LNK1120: 3 unresolved externals


EFPS6 - 4 error(s), 4 warning(s)

I toggled DFLIB on and off. Now I get all 9 original errors regardless. Any help would be appreciated!
0 Kudos
49 Replies
Ashley_Weinstein
Beginner
1,383 Views
Tim, I still don't understand why no one can give me an explanation of why the _for_len_trim is found referenced in GUILinkF.obj but not in PSWPTH.obj, when both files are part of the same project and both are being recompiled in the new IDE.
0 Kudos
IanH
Honored Contributor III
1,383 Views
The (example) missing symbol isn't _for_len_trim - it's _for_len_trim@8. That @8 suffix on that internal compiler function name is strong (irrefutable?) evidence that there's object code from CVF still being fed into the final link.

You shouldn't need to have those ignore specific library settings. That's more evidence that object code from CVF is still around.

The errors come via a library (EFPS68_lib.lib) - are you sure that the specific lib file being referenced is a lib file that is being built from object code files only made by ifort, and not some hangover from CVF days?

Post (attach) your build logs - the one for the library and the one for the final exe or DLL that actually generates the errors.
0 Kudos
Ashley_Weinstein
Beginner
1,383 Views
Hi Ian, here's the build log. I just don't understand how object code from CVF is lingering around. I've recompiled the same sources successfully in the new IDE in separate solutions. But this master solution containing all the Fortran and C++ code is killing me.
0 Kudos
IanH
Honored Contributor III
1,383 Views
That's the build log for the final link - could you also please attach the log for a rebuild-all of...
"K:\Pyrotec\Software\RSISimcon\930680IVF\RSISPY\EFPS68_lib\Debug\EFPS68_lib.lib"
(Presumably that's built by a different project in your master solution?)
0 Kudos
Ashley_Weinstein
Beginner
1,383 Views
Hi Ian, yes you are correct. That static library is built by another project in the master solution. I have a separate solution for the static library as well which compiles and builds fine. I'll attach that build log shortly.
0 Kudos
Ashley_Weinstein
Beginner
1,383 Views

Here is a reduced build log for EFPS68_lib:

Build Log

Build started: Project: EFPS68_lib, Configuration: Debug|Win32

Output

Compiling with Intel Visual Fortran Compiler XE 12.1.1.258 [IA-32]...

ifort /nologo /debug:full /Od /I"C:\~root\base\Include" /I"C:\~root\base\K~" /I"C:\Program Files\Intel\Composer XE 2011 SP1\compiler\lib\ia32" /module:"Debug\" /object:"Debug\" /Fd"Debug\vc90.pdb" /traceback /check:bounds /libs:dll /threads /dbglibs /4Yportlib /c /extfor:F /Qvc9 /Qlocation,link,"c:\Program Files\Microsoft Visual Studio 9.0\VC\\bin" "C:\~root\base\T~\EXAMPLE.F"

...

...

Creating library...

Creating temporary file "RSP1.rsp" with contents

[

/OUT:"Debug/EFPS68_lib.lib" /LIBPATH:"C:\Program Files\Intel\Composer XE 2011 SP1\compiler\lib\ia32" /NOLOGO /NODEFAULTLIB:"nlsecure.lib" /NODEFAULTLIB:"passwd.lib" /NODEFAULTLIB:"dfwin.lib" /NODEFAULTLIB:"dfor.lib" /NODEFAULTLIB:"libc.lib" /NODEFAULTLIB:"dfconsol.lib" /NODEFAULTLIB:"dfport.lib" ...

"Debug\PSWPTH.obj"

...

]

Creating command line "Lib @"C:\~root\R~\EFPS68_lib\Debug\RSP1.rsp""

xilib: executing 'lib'

Debug\CONVER.obj : warning LNK4042: object specified more than once; extras ignored

PSWPTH.obj : warning LNK4006: _PSWPTH already defined in NLSECURE.lib(PSWPTH.OBJ); second definition ignored

PSWPTH.obj : warning LNK4221: no public symbols found; archive member will be inaccessible

PYTIME.obj : warning LNK4006: _PYTIME already defined in NLSECURE.lib(PYTIME.OBJ); second definition ignored

PYDATE.obj : warning LNK4006: _PYDATE already defined in NLSECURE.lib(PYDATE.OBJ); second definition ignored

PYDATE.obj : warning LNK4221: no public symbols found; archive member will be inaccessible

EFPS68_lib - 0 error(s), 14 warning(s)

0 Kudos
Ashley_Weinstein
Beginner
1,383 Views
I think I see the problem now. PSWPTH is already defined in NLSECURE.lib and this library is most definitely compiled in CVF; I do not have the source for this file so I cannot recompile it in the new environment. The compiler is choosing to ignore the source of PSWPTH in PSWPTH.f90 and stick with the one in NLSECURE.lib. I thought that by ignoring this library in the compiler options that I would be able to workaround it. Perhaps I will exclude NLSECURE.lib from the build entirely and see if that resolves the issue and hope that the program is able to run fine without it.
0 Kudos
Ashley_Weinstein
Beginner
1,383 Views
Looks like that did the trick to allow the source to completely compile without any problems.

Now to check out the functionality...
0 Kudos
Reply