davidF has asked for the wisdom of the Perl Monks concerning the following question:

I'm building a Perl extension, and am linking some C programs with the Perl library on a Windoes XP box using C Visual C++ 6.0. (I know :-( . . . ) I find that calling the fopen function causes a crash now. Apparently the linker is bringing in an fopen from perl56.lib, and this object code crashes the program. Also, incidentally, calls to safemalloc also crash the system. (The same calls to fopen work fine in programs that don't link in perl56.lib). I'm not eager to take a detour into the Perl source code. Has anybody already solved this problem?
  • Comment on Problem calling C language fopen() in win32

Replies are listed 'Best First'.
Re: Problem calling C language fopen() in win32
by Zaxo (Archbishop) on May 01, 2004 at 15:34 UTC

    You probably know this since you mention it. Check the C compiler version your perl was built with. If it differs from your VC6, that alone may cause the problem. If you are unable to get a matching compiler, you could build a new perl with the compiler you have. That would at least allow you to check.

    Is the fopen() call in a place where you can invoke perl's builtin sysopen instead?

    After Compline,
    Zaxo

      Actually, I tried compiling a new Perl, which worked . . . but fopen still didn't :-( I will loook at sysopen(). Thanks.