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

error LNK2019: unresolved external symbol pow2o3 referenced in function LANCZOS

aruntchavan
Beginner
2,219 Views

Hi,

I am getting linking error  in subject while compiling my fortran file with OneAPI ifort compiler 2022.1.0 located at oneAPI/compiler/2022.1.0/windows/bin/intel64/ifort.exe.  My fortran subroutine does not have any call to said pow2o3 still I get this error.  Any idea on how to get around it? Thank you.

Labels (1)
0 Kudos
4 Replies
mecej4
Honored Contributor III
2,179 Views

Since you did not show the source code and did not list the compiler options used, not much can be said. The missing external symbol is probably one of the myriad MKL routines that may be called by the compiler when it sees an expression such as x**(2.0/3.0). You can locate the object file that contains the reference to pow2o3 by using the  additional option /link /map.

0 Kudos
Xiaoping_D_Intel
Employee
2,160 Views

Fortran compiler may generate ​such call for some math expression. Normally the needed libs will be automatically linked by the compiler. I saw you listed the full path of "ifort.exe" in the post. Did you invoke the compiler "ifort.exe" command by following the option 1 at https://www.intel.com/content/www/us/en/develop/documentation/get-started-with-fortran-compiler/top/get-started-on-windows.html? The compiler command prompt window will have all required compiler environment set up.


0 Kudos
aruntchavan
Beginner
2,139 Views

Thank you @mecej4 and @Xiaoping_D_Intel for your responses.  I now see that the said symbol is in libm.lib

>>dumpbin /symbols C:/PROGRA~2/Intel/oneAPI/compiler/2022.1.0/windows/compiler/lib/intel64/libm.lib | grep pow2o3

 

Yes, I am using option 1 to compile my code. I now ran setvars.bat in my shell and added ifort directory to system path. My shell now sees ifort. The shell prompt now looks like below:

aruntchavan_0-1662479458417.png

But, I am now getting another error while compiling and linking my code in debug mode for my abc_stubs.cxx (empty functions) file: 

abc_stubs.obj : fatal error LNK1223: invalid or corrupt file: file contains invalid .pdata contributions

Any idea how to resolve this debug mode issue?

 

Note: This link error goes away if I compile and link with O2 and my build succeed. 

0 Kudos
Ron_Green
Moderator
2,129 Views

Looks like ICL LINK.exe does not like empty stub files in debug builds

https://docs.microsoft.com/en-us/cpp/error-messages/tool-errors/linker-tools-error-lnk1223?view=msvc-170

 

 

0 Kudos
Reply