delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/1998/11/11/23:51:06

From: vlad AT sci-nnov DOT ru (Vladimir Dubrovin)
Subject: B20: undefined reference to `_impure_ptr'
11 Nov 1998 23:51:06 -0800 :
Message-ID: <3617.981111.cygnus.gnu-win32@sci-nnov.ru>
Reply-To: Vladimir Dubrovin <vlad AT sci-nnov DOT ru>
Mime-Version: 1.0
To: gnu-win32 AT cygnus DOT com

Hello Gnu-win32,

 This  bug  was  already reported, but i didn't stated any solution...
 Sorry,  if  i'm  wrong of if it's not the bug, but result if improper
 use  of mingw32. The problem is following: then i'm trying to compile
 simple program with -mno-cygwin switch i've got linker error:
 undefined reference to `_impure_ptr'

 It  seems, that this error appears only then i'm using some functions
 with  more then one arguments (such as fopen()), because there wasn't
 problem then i compiled "Hello world!" ;)
 Does someone know how to fix it?

 Simple example to test the problem:

test.c:

#include <stdio.h>

int main(void){
    FILE *fp;
    char buffer[256];

    fp=fopen("test.c", "r");
    if(!fp) {
            fprintf(stderr, "Failed to open\n");
            return 1;
    }
    while ( fgets(buffer, 256, fp) )printf ("%s", buffer);
    return 0;
}

>gcc -mno-cygwin -o test test.c
D:\TEMP\ccW0yQoU.o(.text+0x4d):test.c: undefined reference to `_impure_ptr'
collect2: ld returned 1 exit status



 ___
/            Vladimir Dubrovin, SANDY Info.                \
| Institute of Applied Physics, Russian Academy of Science |
\_________________________________________________________/
 | +7 8312 384206 voice calls | +7 8312 362522 fax calls |
 |____________________________|__________________________|


-
For help on using this list (especially unsubscribing), send a message to
"gnu-win32-request AT cygnus DOT com" with one line of text: "help".

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019