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

Link errors with /warn:interfaces

Simon_Geard
New Contributor I
1,180 Views

I have started getting link errors when I have /warn:interfaces turned on. All the errors are of the form

 error LNK2019: unresolved external symbol __imp_XXXX referenced in function YYYY

The link error occurs when building a C++ dll using the .lib file from the Fortran build. I haven't been able to find any work round other than turning off /warn:interfaces. Does anyone know why I'm getting this error or how to fix it so that I can use /warn:interfaces. This is with VS2010 + Intel(R) Visual Fortran Compiler XE 14.0.1.139 [Intel(R) 64]

Thanks,

Simon

0 Kudos
6 Replies
Steven_L_Intel1
Employee
1,180 Views

I haven't heard of this one before, but anything is possible. Would you please provide a compilable Fortran source that shows this problem? I don't need anything right now but the Fortran source and the complete list of options you use to compile it. If any include or module files are needed, I'll need those too. You can attach a ZIP here or use Send Author a Message to send it privately. Please also include the complete text of the link errors.

0 Kudos
Simon_Geard
New Contributor I
1,180 Views

Thanks - hopefully I'll be able to cut the solution down to s sensible by tomorrow.

Simon

0 Kudos
Simon_Geard
New Contributor I
1,180 Views

It proved to be too difficult to create a cut down version of the code. I seem to have spent the last two days chasing shadows. Until yesterday evening, despit many rebuilds, directory deletes and restarts I was not able to build (with or without /warn:interfaces). Then last night I tried a different TFS workspace with the same code and the program built without error. This morning I tried building in the original workspace and after rebuilding the usual Fortran project I have been abl to build the program (with /warn:interfaces) without error. So I've no idea why this was happening or why it has stopped hapenning.

The only thing I did discover is that 'Clean Solution' does not delete the *__genmod.f90 files, shouldn't they be deleted as well?

0 Kudos
andrew_4619
Honored Contributor III
1,180 Views

 /gen-interfaces:nosource

and you do not get the __genmod.f90 files, clean does not delete them and the compiler does not use them.

0 Kudos
Steven_L_Intel1
Employee
1,180 Views

The .f90 files are not used in the build process, they're just there for your reference. If you create a new project (as of a few versions ago), the .f90 files are also deleted on a clean. You can change the set of files deleted in the project property Fortran > General > Extensions to delete on clean. The default list now is: *.cod;*__genmod.*;*.obj;*.mod;*.pdb;*.asm;*.lst;*.map;*.dyn;*.dpi;*.tmp;*.log;*.ilk;*.exe;*.lib;$(TargetPath)

0 Kudos
andrew_4619
Honored Contributor III
1,180 Views

" Fortran > General > Extensions to delete on clean. " I hadn't noticed that setting before it does clean more stuff than to used to in the default settings.

I have some to notice in the last few days that older projects (particular if they came via cvf) can have quite a few bits of "baggage" in terms of options that are obsolete/ dubious or indeed miss out on improvements.

 

0 Kudos
Reply