I am trying to build the simple example program referenced at
http://icl.cs.utk.edu/lapack-for-windows/lapack/ #Part 2...Visual Studio
I have downloaded the prebuilt lib and dll files for Windows x64 and MinGW from the same URL.
I also have the MinGW dlls that I need.
Following the instructions and trying to build the solution I get a link error as follows:
1>------ Rebuild All started: Project: using_lapack, Configuration: Debug x64 ------
1> using_lapack.cc
1>using_lapack.obj : error LNK2019: unresolved external symbol dgesv_ referenced in function main
1>D:\Tools\PTAM\lapack\x64\Debug\using_lapack.exe : fatal error LNK1120: 1 unresolved externals
========== Rebuild All: 0 succeeded, 1 failed, 0 skipped ==========
I have found a number of other postings of this problem, but no solutions.
(see http://icl.cs.utk.edu/lapack-forum/viewtopic.php?f=12&t=3372)
When I look inside the liblapack.lib file I see references to dgesv
(from Bash shell, with other dgesv* results removed)
$ strings liblapack.lib | grep -i dgesv
__imp__dgesv_
_dgesv_
__imp__dgesv_
_dgesv_
_dgesv_
These show a decoration with preceding and trailing underscores.
In the DLL this gives
$strings liblapack.dll | grep dgesv
dgesv_
dgesv.f
dgesv_
I am not familiar enough with name mangling to know whether this is supposed to be correct or not.
Oddly enough, the project will link successfully when set to a 32bit configuration instead of 64bit. (It does not run successfully, probably because the DLL is a 64bit version.)
I am surprised that a seemingly "typical" configuration of Visual Studio 2010 and Windows x64 does not work correctly.
I tried building my own Lapack and Blas libraries using the CMake and MinGW approach. That was also unsuccessful for my configuration. (Long story, not for this forum.) Again surprising.
Any help would be appreciated - by myself and a number of others who have posted similar questions over the past few years.