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

Does Static Library need to export functions?

Kipling__Michael
Beginner
1,127 Views

I have inherited a VS 2005 solution which contains a C dll project and a Fortran static library project.  The C dll project requires the Fortran routines.  I have updated the solution for VS2010.

The C dll project has the Fortran library added as an Additional Dependency.  I have also added the Fortran library to C dll project.

However, the C project build show unresolved symbols for each of the Fortran routines.

If I add !DEC$ ATTRIBUTES DLLEXPORT to the Fortran routines, then I get no complaints.

Do I really need to export the routines from a static library, or have I missing something?

Regards, Mike

 

0 Kudos
4 Replies
Steven_L_Intel1
Employee
1,127 Views

My guess is that your description doesn't quite match what you actually have. DLLEXPORT is only needed if you are linking against a DLL. If the Fortran project really is a static library, that wouldn't be needed.

Can you attach a ZIP of the buildlog.htm from the Fortran project and the build log from the C project?

0 Kudos
Kipling__Michael
Beginner
1,127 Views

I have attached log files for both projects.  The C dll project does not build successfully, so the log file for it is a text file.

Mike

 

0 Kudos
Kipling__Michael
Beginner
1,127 Views

I just had a thought. Could it be that C is looking for lowercase function names, but the static library lists them with uppercase?  If so, is there a option to write the symbol names in lowercase?

 

Mike

0 Kudos
Steven_L_Intel1
Employee
1,127 Views

Yes, case matters. Also, I see you are using STDCALL, which Intel Fortran doesn't use by default. Is that deliberate? I don't see the Fortran library build log.

0 Kudos
Reply