Does Static Library need to export functions?

Does Static Library need to export functions?

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

 

5 posts / 0 new
Last post
For more complete information about compiler optimizations, see our Optimization Notice.

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?

Retired 12/31/2016

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

 

Attachments: 

AttachmentSize
Downloadapplication/octet-stream gdfMD.log10.85 KB
Downloadtext/plain BuildLog_gdfMD.txt11.2 KB

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

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.

Retired 12/31/2016

Leave a Comment

Please sign in to add a comment. Not a member? Join today