Link errors with /warn:interfaces

Link errors with /warn:interfaces

sgeard@cad-schroer.co.uk's picture

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

7 posts / 0 new
Last post
For more complete information about compiler optimizations, see our Optimization Notice.
Steve Lionel (Intel)'s picture

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.

Steve
sgeard@cad-schroer.co.uk's picture

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

Simon

sgeard@cad-schroer.co.uk's picture

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?

app4619's picture

 /gen-interfaces:nosource

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

Steve Lionel (Intel)'s picture

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)

Steve
app4619's picture

" 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.

 

Login to leave a comment.