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

Static library issue (newbie division)

tashker__michael
Beginner
783 Views
(VS08, Fort 11.1.x) I have a couple of apps that use a Fortran library I wrote. The apps and library projectshave been recentlyconvertedfrom CVP. The lib appears in the Library Files section of the app project. But none of the functions in the libary are found when I link the main app. LNK2001 unresolved external symbol, and LNK2019 abound.

The Library Files section also includes lib files of various c++ DLLs I've written and the app doesn't complain about any of those functions. Of course I have interface modules for all of them.

Surely I'm doing something wrong here. Are interfaces now required for functions called in a library? Wouldn't think so, but...
0 Kudos
2 Replies
tashker__michael
Beginner
783 Views
OK. It's a an option in the generated vfproj file on the VFFortranCompilerToolline which specifies

CallingConvention="callConventionCVF"

That's the culprit. Remove that and the compiler command line as seen in VS08 removes the /iface=CVF option--which I suppose is the same thing.

Now the routines in the static library are seen by the apps.

Whew. That's some hours of my life I won't see again.
0 Kudos
Jugoslav_Dujic
Valued Contributor II
783 Views
The project conversion stuff is very handy... but I find it very annoying that it asks no questions, just converts the project using defaults. These defaults are indeed sensible for most frequently used settings, but if yours is not one of those, you might easily lose some hours of your life.

Apart from that calling convention default, the other one I find annoying is that it wants to assign C->Fortran translation using the custom build step for every "*.h" file it finds in the project, and I end up manually removing it for every one. The only one that really needs translating is called "resource.h" 99.9% of the time.
0 Kudos
Reply