Groups | Blog | Home
all groups > visual studio .net general > march 2004 >

visual studio .net general : Compliance of VC++7.0 (VS.net 2003) and Visual Fortran 6.0


Tony
3/30/2004 6:36:10 AM
Greetings,

The following piece of code (F77.FOR and test.cpp) can
work well using VC++6.0 and VF6.0. Recently I changed
VC++6.0 to VC++7.0 (Visual Studio.net 2003). Both files
can still be compiled successfully and linked together
successfully in VC++7.0. The executable is not able to
run. The running exits with code 255 and cannot even enter
main. Can any one tell me how to fix this problem ??

C Fortran routine F77.FOR
C It is made as a static library in VF6.0.
subroutine F77(d1, d2)
double precision d1, d2
d2 = sqrt(d1)
return
end

// C++ routine, test.cpp
// It is compiled in VC++7.0 and linked with F77.lib
// Link can produce errors about multiple definitions
// of _matherr in both libc.lib and dfor.lib.
// But either using /FORCE:multiple or adding dfor.lib
// in front of other C libs in link options can
// get a successful link.

extern "C" {
void _stdcall F77(double *d1, double *d2);
}
#include <math.h>
int main()
{
double d1 = 100.0, d2;
d2 = sqrt(d1);
F77(&d1, &d2);
return 0;
}

Regards
Phil Barila
3/31/2004 11:04:56 PM
[quoted text, click to view]

Does Dependency Walker(depends.exe) show you any missing imports?

[quoted text, click to view]

Wow, it's been a long time since I looked at Fortran. I don't see anything
obviously wrong here, but I've long forgotten almost everything I knew about
Fortran, so I'm not the best resource here.

[quoted text, click to view]

This might be a clue. Having to perform stupid linker tricks like this
usually indicates that something is grotesquely wrong, and the tricks are
only hiding the problem, not solving it.

[quoted text, click to view]

If you Step into the CRT startup, how far do you get before you get dumped
out with the 255 exit value?

Phil
--
Philip D. Barila Windows DDK MVP
Seagate Technology, LLC
(720) 684-1842
As if I need to say it: Not speaking for Seagate.
E-mail address is pointed at a domain squatter. Use reply-to instead.

Christoph Nahr
4/1/2004 9:05:24 AM
On Tue, 30 Mar 2004 06:36:10 -0800, "Tony"
[quoted text, click to view]

I don't see any obvious problems. Since you say it has worked with 6.0
I have to agree with Phil that these multiple definitions or perhaps
some other library incompatibility with VC++ 7.0 might be the reason.

You should ask Compaq (or whoever is maintaining DEC Visual Fortran
these days) for advice. They may have FAQs about that already.
--
AddThis Social Bookmark Button