all groups > visual c libraries > october 2003 >
You're in the

visual c libraries

group:

VC++.NET 2003 calling Fortran DLL fails


VC++.NET 2003 calling Fortran DLL fails Dan Hoyt
10/20/2003 2:13:20 PM
visual c libraries:
I have a C++ program that dynamically loads Compaq Visual
Fortran v6.6 DLLs and invokes them. I have two Fortran
DLLs, one that only does calculations and standard
output, the other that also includes its own file I/O.

The first DLL loads and executes properly, but not the
second. It loads properly and begins execution, but as
soon as I get to a file open command, it heads off for
space and never returns.

This program is cross-platform, as well, and works
properly under Solaris, so it sounds to me like it's a
library linking problem or something like that.

All the Fortran DLLs are created as multi-threaded, which
according to MS help, links with DFORMDD.LIB (debug),
which in turn automatically links MSVCRTD.LIB into the
DLLS.

In VC++.NET 2003, the executable is created as multi-
threaded also. In a vain attempt to avoid library
collisions, I tried explicitly ignoring LIBCMTD.LIB and
OLDNAMES.LIB and linking in DFORMDD.LIB, but I got the
same result as linking with the default libraries.

Any ideas?

In advance, thank you for your help.

VC++.NET 2003 calling Fortran DLL fails Dan Hoyt
11/19/2003 3:14:24 PM
I resolved this.

The working Fortran code was a red herring. The C++
program also linked with the NCBI C++ Toolkit
(http://www.ncbi.nlm.nih.gov/IEB/ToolBox/CPP_DOC/ for
anyone who is interested), which was compiled with the
static C libraries. Hence, collisions. Works fine when
the NCBI Toolkit is compiled with the dynamic C libraries
(so the executable only has ONE C library to deal with).

-Dan

[quoted text, click to view]
AddThis Social Bookmark Button