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

Link Errors with re-installation

wuthric
Beginner
1,801 Views
I recently re-installed the FORTRAN compiler with IMSL (version 10.2)on a replacement machine. I work under Visual Studio 2005. Now, my code that worked perfectly well on the old hardware, now returns 595 link errors (I didn't know the error counter would go that high) with multiple errors for each source code file. I'm getting unresolved external symbol errors (LNK2001) with names that are not called explicitly from my source code (__fltused, _for_cpystr, _for_emit_diagnostic, _for_concat, _for_write_int_fmt, _pow, _sqrt, ___powr8i4, and many others)

These look like an internal call to the FORTRAN libraries to me, but I have no way of knowing. Is there an installation problem, or options not set? Ny clues?

Thanks,
John W
0 Kudos
12 Replies
TimP
Honored Contributor III
1,801 Views
Yes, those are in the libraries which should be installed automatically by the ifort installer. They should be taken care of automatically, regardless of any options you set. If you brought object files across, and you didn't install and invoke the same architecture compiler (Intel64/64-bit or ia32/32-bit), you could see such a problem.
0 Kudos
wuthric
Beginner
1,801 Views
Quoting - tim18
Yes, those are in the libraries which should be installed automatically by the ifort installer. They should be taken care of automatically, regardless of any options you set. If you brought object files across, and you didn't install and invoke the same architecture compiler (Intel64/64-bit or ia32/32-bit), you could see such a problem.

Thanks tim18,

I had the software installed froma downloadinstalation disk *exe's (one for FORTRAN and one for IMSL libraries) - I didn't try to move files manually. I've installed the IA32 on both the old and new machines.

My path variables were set to include the c:Program FilesINTEL...IA32LIB and c:Program FilesVNI...IA32lib for the IMSL. I still get LINK errors, and am not sure of my next step.

The system Aadmin sees the application installation as complete since both exe files ran without error. Are there installation variables that need to be set - I'm sure the Admin would have taken all defaults.

A stab in the dark: would a different version of Visual Studiiioo 2005 cause this type of error? I originally installed Visual Studio from disk, and re-installed from a common installation script that might have run a different version (but to be honest I can't imagine why).

Any other suggestions?
John W


0 Kudos
TimP
Honored Contributor III
1,801 Views
If you're linking from command line, it may be preferable to rely on opening the ifort cmd window from the Start menu as a first step, rather than relying on global path settings. Assuming that was set up correctly during compiler installation, you could check the PATH settings given there.
If you're building from VS GUI, a next step might be to post your build log here. Others here are more expert than I in reading those.
0 Kudos
Steven_L_Intel1
Employee
1,801 Views
If you reinstalled VS, that might have broken something. Go to Tools > Options > Intel Visual Fortran > Compilers. Click Reset All. Close and then try to rebuild.
0 Kudos
wuthric
Beginner
1,801 Views

Thanks tim18,

I had the software installed froma downloadinstalation disk *exe's (one for FORTRAN and one for IMSL libraries) - I didn't try to move files manually. I've installed the IA32 on both the old and new machines.

My path variables were set to include the c:Program FilesINTEL...IA32LIB and c:Program FilesVNI...IA32lib for the IMSL. I still get LINK errors, and am not sure of my next step.

The system Aadmin sees the application installation as complete since both exe files ran without error. Are there installation variables that need to be set - I'm sure the Admin would have taken all defaults.

A stab in the dark: would a different version of Visual Studiiioo 2005 cause this type of error? I originally installed Visual Studio from disk, and re-installed from a common installation script that might have run a different version (but to be honest I can't imagine why).

Any other suggestions?
John W



0 Kudos
TimP
Honored Contributor III
1,801 Views
It's better if you make sure that all Visual Studio service packs are installed, but otherwise I can't think of Visual Studio version problems.
I would suggest you try Steve's reset suggestion, if you haven't done so.
0 Kudos
wuthric
Beginner
1,801 Views
If you reinstalled VS, that might have broken something. Go to Tools > Options > Intel Visual Fortran > Compilers. Click Reset All. Close and then try to rebuild.

Steve et. al.
Our internet got hacked, so I'm working offline from home.

I've reset VS and still get problems. I notice in my PATH (I'll include when I get back online) that I've got MS Visual Studio and MS Visual Studio 2003. Are there really two, and are they interfering with each other? Should the path have one program before the other - does order matter?

I seem to be past the FORTRAN compiler errors, but am now stuck with link errors to the IMSL libraries. I've gotten FORTRAN and IMSL to work from a command window with simple code, so I think my Visual Studio is not installed incorrectly. The same simple verification code worked from VS (I thoughtI was finally home free). The simple program compiles and links from VS, but when I load my prior work with more complicated calls to IMSL I get LINK errors to IMSL_ERR.lib. I've followed the installation instructions in the IMSL readme.txt files: adding library and include paths to the VS FORTRAN properties, and added the libraries to the to the project properties and project link.

Any clues? Is this a purely MS VS problem - i.e., should I bother the MS support people?

Thanks for all of your ideas,
John W
0 Kudos
Steven_L_Intel1
Employee
1,801 Views

It doesn't matter if you have different Visual Studio versions installed. For the IMSL libraries, see this article on how to configure Visual Studio for IMSL.
0 Kudos
wuthric
Beginner
1,801 Views

It doesn't matter if you have different Visual Studio versions installed. For the IMSL libraries, see this article on how to configure Visual Studio for IMSL.

Thanks Steve,
Ifollowed the IMSL installation for V10, and already had the libraries and include paths defined.

I suspect my MS Visual Studio has changed since it won't link the original code, so I re-loadded all source codes into a blank project. It will not link to IMSL's static libraries, but it will link to the DLL versions. Is that a clue?

However, when the compiled executable is launched I get: "Unable to start [*.exe] MSDIA80.dll cannot be loaded." Is this another clue? Does the ability to Link to one version of IMSL but not another suggest anything? Does the ability to ability to LINK but not execute raise any flags?

Sorry for the long thread, but I've got to get some work done soon.

Thanks again,
JohnW
0 Kudos
Steven_L_Intel1
Employee
1,801 Views

What exactly does "does not link" mean? Please attach the buildlog.htm.

As for the MSDIA80.DLL error, this is a relatively common problem with VS2005. The solution appears to be this.

  1. Open a command prompt window
  2. Set default (CD) to the folder containing MSDIA80.DLL You may have to search your system to find where it is.
  3. Type: regsvr32 msdia80.dll


0 Kudos
wuthric
Beginner
1,801 Views

What exactly does "does not link" mean? Please attach the buildlog.htm.

As for the MSDIA80.DLL error, this is a relatively common problem with VS2005. The solution appears to be this.

  1. Open a command prompt window
  2. Set default (CD) to the folder containing MSDIA80.DLL You may have to search your system to find where it is.
  3. Type: regsvr32 msdia80.dll



Steve,
I found the MSDIA80.dll and that problem went away - Thanks.

I've attached two build logs: *Shared.htm with a successful build using the DLL libraries. I intend to send my code out to others, so I believe that I need a static executable to avoid DLL availability problems. The second build log *_static.htmwas made log using the static libraries, and produces 65 errors from the same source code. The PDF document shows my settings for both the project and the VS Tools/Options to identify the library and include paths. I also show the code fragment where Iinclude the header file. I've annotated the PDF with highlights and flags to point out what I believe are the relevant sections. Finally, I've included my path variablejust in case my error comes in there.

Any advice on finding my error.Am I right in assuming that I needtolink to static libraries to allow non-programmers torun the executable?

My internet at work is still blocked, so I can only read daily from home - sorry for the slow turn-around.
Thanks again for all the advice.
John W
0 Kudos
TimP
Honored Contributor III
1,801 Views
In the "static" build log you appear to have objects built against Intel OpenMP libraries, but didn't include a corresponding option in the link step.
You can build with static libraries, or supply redistributable packages with the dll libraries.
0 Kudos
Reply