Our first step was to install the Platform SDK: no joy. The second step was to manually copy the DLL's required (there are actually 3 DLL's you need) from a working install to the non-working install: success!
So, what could possibly be the problem here?
No amount of searching could turn up the issue, so a ticket was opened with Intel's Premier Support. Well, we should have done this from the beginning because it appears that the compiler writers themselves know a lot about the compiler toolchain; fancy that. The (relevant) response from Intel:
c2.dll is used by the Microsoft Visual C++ compiler to perform whole-program optimization. Might it be that this "release" C library was compiled with that option? If so, you will require Visual C++ to be installed in order to build using that library.Sure enough, disabling Whole Program Optimization on the Release mode builds of the C static library solved all of our issues.
My advice is that if you know you will be linking a C library on a system with only Visual Studio Premier Partner Edition installed that you be sure that Whole Program Optimization is disabled, as otherwise Fortran programmers will not be able to use it.
4 comments:
Just wanted to let you know that even 3+ years after you posted this, it has helped me out. I had the EXACT same scenario. Debug static C lib works, release static C lib gives the "can't load C2.dll". We also use Intel Visual Fortran. Turned off WPO for the release config, and everything works! Thanks!
Just had the same problem using VS2011, thanks for the post
A simpler solution is to change the order of additional libraries that are configured to be linked.
Check this out: http://bytes.com/topic/net/answers/265260-whole-program-optimization-results-lnk1171-error-cannot-find-c2-dll
Interesting! I'll give that a try the next time I run into this problem (I believe Composer Studio no longer has that issue).
Post a Comment