- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
If you haven't already, try looking at
http://software.intel.com/en-us/forums/topic/268322
which might help.
Simon
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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 "
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Are you building from the Visual Studio IDE or the command line? If from the command line, how are you invoking the linker?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I am not using command line, it's a GUE of Visual Studio
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thank you very much, it works now!
![](/skins/images/98E68944C1FF703B8AC50091329B92AF/responsive_peak/images/icon_anonymous_message.png)
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page