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

Compiler auto-linking after 9.1.037 upgrade

danhoyt
Beginner
623 Views

I havepreviously-working projects with multiple Fortran source files that included: 1)a single-threaded console .EXE; 2) a multi-threaded Windows .DLL. I encountered an internal compiler error on project #2 with 9.1.033 (I use .NET 2003, so I couldn't upgrade to 9.1.034 without requiring a re-install of .NET 2003). I right-clicked each source file and compiled separately to determine how many files had this error, since it quits after the first one, and found two sources causing the internal error.

As 9.1.034 was the last upgrade notification I got via email, before reporting the error, I double-checked the download site on the chance there was a more recent version I could download that might already have a fix and found 9.1.037. So far, so good.

I upgraded to 9.1.037 following the documented procedure (I've done this dozens of times, so I know the drill). All went well until I tried to compile project #1, when I gotseveral LNK2019 errors (unresolved externals for every subroutine in another module)! Since I was only doing a compile, I was a bit surprised to find a linker error. I figured there was a bug, so I regressed to 9.1.036 and got the same problem. Regressed to 9.1.033 and still got the same problem -- which is disturbing since it worked fine with 9.1.033 this morning.

Anyone have any idea what happened here that could cause a link step on a compile? I checked the docs for all 3 compiler versions and re-checked all my project settings, but I don't see anything different (other than not being able to compile a multi-source project any more!).

-Dan Hoyt

0 Kudos
9 Replies
danhoyt
Beginner
623 Views

I don't know if this will help any, but here's an example of the output from a right-click Compile (NOT a build):

Compiling with Intel Fortran 9.1 C:Program Files (x86)IntelCompilerFortran9.1IA32...

..projectsrcconsoleAMOD.FOR

AMOD.obj : error LNK2019: unresolved external symbol _SINT@12 referenced in function _AMB

AMOD.obj : error LNK2019: unresolved external symbol _COSD@4 referenced in function _AMB

AMOD.obj : error LNK2019: unresolved external symbol _SIND@4 referenced in function _AMB

AMOD.obj : error LNK2019: unresolved external symbol _ASIND@4 referenced in function _AMB

AMOD.obj : error LNK2019: unresolved external symbol _TAND@4 referenced in function _AMB

AMOD.obj : error LNK2019: unresolved external symbol _ACOSD@4 referenced in function _AMA

AMOD.obj : error LNK2019: unresolved external symbol _ATAND@4 referenced in function _AMD

libifcore.lib(libifcoremain.obj) : error LNK2019: unresolved external symbol _MAIN__ referenced in function _main

AMOD.exe : fatal error LNK1120: 7 unresolved externals

0 Kudos
Steven_L_Intel1
Employee
623 Views

I've seen this happen, but have no idea why. The fix is to right click on the project, select Properties, Fortran, Command Line. Add to the Additional Options:

/compile_only

0 Kudos
danhoyt
Beginner
623 Views

Steve,

Thanks for your quick reply, but I'm afraid that change made no difference. In fact, I didn't see the option appear at all in the build log, either -- but there were additional options I don't remember seeing before:

"/Qvc7.1 /Qlocation,link,"C:Program Files (x86)Microsoft Visual Studio .NET 2003Vc7in"

These were immediately following "/Fm", which was previously the only Additional Option before I added "/compile_only" after it. I tried saving and closing the project, then reopening, cleaning and building, but the result was the same. However, the .VFPROJ file has:

AdditionalOptions="/Fm /compile_only"

0 Kudos
ggveldkamp2
Novice
623 Views
The /Qvc7.1 option is probably from the ifort.cfg file in the compiler directory.
0 Kudos
Steven_L_Intel1
Employee
623 Views

Those additional options you saw in the log are ok. /Fm should be removed and replaced by enabling the link map in the linker properties.

If this doesn't help, please attach a zip of your solution files to a report to Intel Premier Support.

0 Kudos
danhoyt
Beginner
623 Views
You mean the "/MAP" linker option? That's set already. The "/Fm" compiler option was carried over from my CVF projects by the IVF project converter, so I assumed itwas needed by IVF. It isn't?
0 Kudos
Steven_L_Intel1
Employee
623 Views
/Fm is an old MS Fortran switch that means "generate a link map". You can remove it.
0 Kudos
danhoyt
Beginner
623 Views

I have a partial solution for the initial problem. I still need the "/c" compiler option for some reason, but I can compile only for my EXEs and DLLs -- but not my LIBs.

I vaguely remembered a problem I had with .NET 2002 where the compile options weren't the ones specified in the .VFPROJ file. Itturned out that .NET 2002 got confused whenmore thanonce project had the same GUID.

I recreated my projects and manually editedthe solution/project files to ensureunique GUIDs(and retain my settings), and now I can do compiles without the auto-link -- so long as Iexplicit add the "/c" compiler option and I'm not building a .LIB.

Unfortunately, I still have the original internal compiler error with 9.1.037, but that's a separate issue.

Thanks, Steve, for your help and insight.

0 Kudos
danhoyt
Beginner
623 Views
Okay, I'm wrong about the .LIBs. The compile step is, in fact, correct -- I've just got some OTHER problem with my link. No doubt another CVF-IVF conversion issue, as I believe this may be the first time I've tried to link the LIBs since CVF.
0 Kudos
Reply