ftp.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1997/12/03/04:30:11

Sender: perron AT art DOT alcatel DOT fr
Message-Id: <34852612.66E1@art.alcatel.fr>
Date: Wed, 03 Dec 1997 10:27:46 +0100
From: Olivier PERRON <olivier DOT perron AT art DOT alcatel DOT fr>
Mime-Version: 1.0
To: djgpp AT delorie DOT com
Subject: Help: RSXNTDJ and FLEX seem not to be compatible, next episode

Well, I had a litle time yesterday evening to work on my problems.

It seems that my problems come from the stdio.h file that come with
RSXNTDJ and which define the following stuff:

extern  __inline__ int feof (FILE *_s)
{
  return (_s->_flags & _IOEOF ? 1 : 0);
}

extern  __inline__ int ferror (FILE *_s)
{
  return (_s->_flags & _IOERR ? 1 : 0);
}

/* Do not this function in application programs! */

extern  __inline__ int _getc_inline (FILE *_s)
{
  return (--_s->_rcount >= 0
          ? (unsigned char)*_s->_ptr++
          : _fill (_s));
}

/* Do not this function in application programs! */

extern  __inline__ int _putc_inline (int _c, FILE *_s)
{
  return (--_s->_wcount >= 0 && (_c != '\n' || !(_s->_flags & _IOLBF))
          ? (unsigned char)(*_s->_ptr++ = (char)_c)
          : _flush (_c, _s));
}

#if defined (__MT__)

#define getc(s)   fgetc(s)
#define putc(c,s) fputc(c,s)

#else

#define getc(s)   _getc_inline(s)
#define putc(c,s) _putc_inline(c,s)

#endif

extern  __inline__ int getchar (void) { return getc (stdin); }
extern  __inline__ int putchar (int _c) { return putc (_c, stdout); }

extern __inline__ int fileno (FILE *_s) { return _s->_handle; }




But because of the "extern" keyword, those functions are not compiled in
the object file and they seem to not be defined anywhere else.


So, I've done a stdio.c file with the following lines

#define extern
#include <stdio.h>

and linked it with the rest.

With this work around, my program is correctly linked.

The next problem is that RSXNTDJ recognize that the flex library libfl.a
is a standard djgpp library (ie not a rsxntdj one) and instead of a GUI
application,it build a Console application !
Damned, it looks like I have to rebuild the flex lib my self with the
RSXNTDJ tools.

Olivier.

- Raw text -


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