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

DIMAG LNK2019 ERROR

Ali_L_
Beginner
1,173 Views

Hello,

I am trying to compile my code that works fine in LINUX; the Visual basic gives me this error:

"Error    3     error LNK2019: unresolved external symbol _SGESV referenced in function _SOLVE    solve.obj    "

 

 

and

"Error    4     error LNK2019: unresolved external symbol _DIMAG referenced in function _MATSET    matset_c.obj    "

 

I know that these are all fortran built in functions, and I don't know why it gives me this error.

Also, I know that for this error I have to add the path to the library, but these function are built in functions, and I can't find it anywhere to download.So, please help me fix this error, I have spent too much time on it.

 

Cheers,

 

Ali

 

0 Kudos
10 Replies
Simon_Geard
New Contributor I
1,173 Views

If you haven't already, try looking at

http://software.intel.com/en-us/forums/topic/268322

which might help.

Simon

 

0 Kudos
Ali_L_
Beginner
1,173 Views

I did look at that post. As I mentioned, I changed the DIMAG to AIMAG, but it still doesn't recognize it:

"Error    4     error LNK2019: unresolved external symbol _AIMAG referenced in function _MATSET    matset_c.obj   " 

 

 

0 Kudos
TimP
Honored Contributor III
1,173 Views

The point of asking you to look at the old thread is that those intrinsics are builtin only if the data types match; attempt to link the function from the library is a symptom that you have introduced an unsupported data type.  I assume you used a Fortran compiler to attempt to compile the Fortran source code, although your post seems to leave that in doubt.

The original Microsoft 8080 BASIC compiler I once had included Microsoft Fortran 66 as a subset, but I haven't heard of any other BASIC which knew any Fortran.

0 Kudos
Ali_L_
Beginner
1,173 Views

I was given this Fortran77 code to compile in Visual Studio, and I was told that it works and compiles fine in Linux ( I don't know how they did it). I have no experience in Fortran nor in compiling with Visual Studio, so I am kind of lost.

I have a miss match in my data type? It recognize the Dimag function? but the input for that function has the wrong format?

What do you suggest for me to do, in order to fix this? or gain more knowledge regarding what to do?

0 Kudos
Roland_W_Intel1
Employee
1,173 Views

Are you building from the Visual Studio IDE or the command line?  If from the command line, how are you invoking the linker?

0 Kudos
Ali_L_
Beginner
1,173 Views

I am not using command line, it's a GUE of Visual Studio

0 Kudos
Steven_L_Intel1
Employee
1,173 Views

DIMAG is a non-standard intrinsic function, but if you call it without the correct type and kind of argument, you will get an additional error you didn't show and then the linker error. You have not shown us all the build output or what options you used to build.

SGSEV is not a Fortran intrinsic function, so you would need to provide an external library that supplies it, such as Intel Math Kernel Library.

0 Kudos
Ali_L_
Beginner
1,173 Views

How can I find the SGSEV function to download it? so, I could link that library. Here are all the messages, I am not sure how to trace the wrong format. I have tried all the, Aimag, Quimag, and imag, none of them work.

Here all the errors:

Warning    1     warning #7319: This argument's data type is incompatible with this intrinsic procedure; procedure assumed EXTERNAL.   [AIMAG]    C:\Users\Ansys\Desktop\FSRVM\Rev5\matset_c.f    24    
Warning    2     warning #7319: This argument's data type is incompatible with this intrinsic procedure; procedure assumed EXTERNAL.   [DIMAG]    C:\Users\Ansys\Desktop\FSRVM\Rev5\matset_c.f    39    
Warning    3     warning #7319: This argument's data type is incompatible with this intrinsic procedure; procedure assumed EXTERNAL.   [DIMAG]    C:\Users\Ansys\Desktop\FSRVM\Rev5\gamma_c.f    211    
Error    4     error LNK2019: unresolved external symbol _AIMAG referenced in function _MATSET    matset_c.obj    
Error    5     error LNK2019: unresolved external symbol _DIMAG referenced in function _MATSET    matset_c.obj    
Error    6     error LNK2001: unresolved external symbol _DIMAG    gamma_c.obj    
Error    7     error LNK2019: unresolved external symbol _SGESV referenced in function _SOLVE    solve.obj    
Error    8     fatal error LNK1120: 3 unresolved externals    Debug\Console18.exe    

 

 

0 Kudos
Steven_L_Intel1
Employee
1,173 Views

SGESV you can get by enabling the Fortran > Libraries > Use Intel Math Kernel Library > Parallel project property.

You need to show us the call to AIMAG/DIMAG and the declaration of the argument. The argument to AIMAG has to be of COMPLEX type. Use AIMAG and not DIMAG.

0 Kudos
Ali_L_
Beginner
1,173 Views

Thank you very much, it works now!

0 Kudos
Reply