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

Buid Errors when linking to static library which is dynamically linked to a dll

ashishr
Beginner
314 Views
I am building a static library (A) by dynamically linking to a Dll. A subroutine called SET_VENDOR_KEY from the Dll is being called from a subroutine in the static library A. Static library A builds without errors.

When I build my application by statically linking to A, I get the following error:
error LNK2019: unresolved external symbol _SET_VENDOR_KEY@8 referenced in function _OLGAS

Question:
Why do I get the error only when I build the C++ dll and not when I build the static library A?

Is this due to incorrect calling conventions?

Any help is welcome.

Ash
0 Kudos
1 Reply
Steven_L_Intel1
Employee
314 Views
Yes, it's a calling convention mismatch. But note that a static library does not link to anything, so you would not see errors until the executable links.
0 Kudos
Reply