[quoted text, click to view] "Tony" <anonymous@discussions.microsoft.com> wrote in message
news:15f2501c41664$5866a880$a101280a@phx.gbl...
> 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 ??
Does Dependency Walker(depends.exe) show you any missing imports?
[quoted text, click to view] > 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
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] > // 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.
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] > 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;
> }
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.