#54 Win32 programs cannot use _pgmptr

WSL
closed
nobody
None
rejected
Known_bugs
2013-01-24
2001-07-16
Paul Wise
No

Win32 programs compiled with Cygwin/GCC/MingW cannot use _pgmptr
linked without -lcrtdll:
__imp___pgmptr_dll is undefined
linked with -lcrtdll:
link works but _pgmptr somehow resolves to null in object code,
resulting in "SIGSEGV, Segmentation fault"

Does _pgmptr exist in UNIX land?

Discussion

  • Danny Smith

    Danny Smith - 2001-07-16

    Logged In: YES
    user_id=11494

    This program works for me, using current mingw runtime,
    with msvcrt.dll. Also works with cygwin -mno-cygwin.

    However, there is problem with gcc -U__MSVCRT__ pgmptr.c -
    lcrtdll, with compiled programme returning:

    "The full path of the executing program is : (null)"

    I will check crtdll problem.

    pgmptr.c

    #include <stdio.h>
    #include <stdlib.h>
    int main( void )
    {
    printf("The full path of the executing program is : %
    Fs\n", _pgmptr);
    return 1;
    }
    =======================================================

     
  • Danny Smith

    Danny Smith - 2001-07-17

    Logged In: YES
    user_id=11494

    Silly me. No CRTDLL problem either, as long as use correct
    specs. If linking -lcrtdll must also use crt1.o rather
    than crt2.o as startup.

    With appropriate specs and current stdlib.h, the test in
    my prior message works fine with CRTDLL as well as MSVCRT.

    There is, however, different bug in stdlib.h: CRTDLL does
    *not* have wide version _wpgmptr_dll

     
  • Danny Smith

    Danny Smith - 2001-07-30

    Logged In: YES
    user_id=11494

    Not a MinGW bug.

    Although your problem may be interesting and causing you problems you wish answers to, it is not a problem with the
    MinGW project. Your BUG report has therefore been deleted.

     
  • Danny Smith

    Danny Smith - 2001-07-30
    • labels: 103947 --> mingw runtime (deprecated use WSL)
    • status: open --> closed-rejected
     
  • Earnie Boyd

    Earnie Boyd - 2013-01-24
    • labels: mingw runtime (deprecated use WSL) -->
    • status: closed-rejected --> closed
    • resolution: --> rejected
    • category: --> Known_bugs
    • milestone: --> WSL
     

Log in to post a comment.