Intel® oneAPI Math Kernel Library
Ask questions and share information with other developers who use Intel® Math Kernel Library.

## Error LNK2019 with Visual Studio 2017

Beginner
407 Views

Hello,

I am trying to compile a program that calculates the generalized inverse of a matrix and i am getting the error:

1>VisualFortranTest1.obj : error LNK2019: unresolved external symbol _C referenced in function _MAIN__
1>Unused libraries:
1>  C:\Program Files (x86)\IntelSWTools\compilers_and_libraries_2018\windows\compiler\lib\ia32_win\ifconsol.lib
1>  C:\Program Files (x86)\IntelSWTools\compilers_and_libraries_2018\windows\compiler\lib\ia32_win\libifportmd.lib
1>  C:\Program Files (x86)\IntelSWTools\compilers_and_libraries_2018\windows\compiler\lib\ia32_win\libmmdd.lib
1>  C:\Program Files (x86)\IntelSWTools\compilers_and_libraries_2018\windows\compiler\lib\ia32_win\svml_dispmd.lib
1>  C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.14.26428\lib\x86\OLDNAMES.lib
1>  C:\Program Files (x86)\IntelSWTools\compilers_and_libraries_2018\windows\mkl\lib\ia32_win\mkl_intel_c_dll.lib
1>  C:\Program Files (x86)\IntelSWTools\compilers_and_libraries_2018\windows\mkl\lib\ia32_win\mkl_core_dll.lib
1>  C:\Program Files (x86)\IntelSWTools\compilers_and_libraries_2018\windows\compiler\lib\ia32_win\libiomp5md.lib
1>  C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.14.26428\lib\x86\libcpmt.lib
1>Debug\VisualFortranTest1.exe : fatal error LNK1120: 1 unresolved externals

I followed the steps from here to configure the MKL in my project:

https://software.intel.com/en-us/node/528341

I'm new at programming with Fortran and MKL, is there anything that i am missing?

I'm attaching the full log that i get when i try to execute the program from Visual Studio 2017 and the source code that i am compiling.

1 Solution
Black Belt
407 Views

You did not provide the dimension declaration for the array C. Under implicit typing rules, C is REAL, and C(K,J) is parsed as an invocation of a real valued function with two integer arguments.

Your code makes no calls to MKL routines.

3 Replies
Black Belt
408 Views

You did not provide the dimension declaration for the array C. Under implicit typing rules, C is REAL, and C(K,J) is parsed as an invocation of a real valued function with two integer arguments.

Your code makes no calls to MKL routines.

Moderator
407 Views

and two my cents to this topic - you may find out the examples of how to compute the inverse of an LU-factored general matrices. we don't have .f90 examples but may be .f77 (cgetrix.f dgetrix.f ) will help you also.

Beginner
407 Views

I did not noticed that. It solved my problem. Thank you so much.

mecej4 wrote:

You did not provide the dimension declaration for the array C. Under implicit typing rules, C is REAL, and C(K,J) is parsed as an invocation of a real valued function with two integer arguments.

Your code makes no calls to MKL routines.