www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2002/02/21/14:46:03

X-Authentication-Warning: delorie.com: mailnull set sender to djgpp-bounces using -f
X-Originating-IP: [196.32.88.121]
From: "Kronoman X" <kronoman_x AT hotmail DOT com>
To: djgpp AT delorie DOT com
Subject: Where is _is_cdrom_drive prototype????
Date: Thu, 21 Feb 2002 17:04:57 +0000
Mime-Version: 1.0
Message-ID: <F74DDQGkAhltCwPQHu90001723c@hotmail.com>
X-OriginalArrivalTime: 21 Feb 2002 17:04:57.0675 (UTC) FILETIME=[E3EE41B0:01C1BAF9]
Reply-To: djgpp AT delorie DOT com

Excuse my poor english.
I can't compile my program because seems that GCC don't found
the _is_cdrom_drive function, that the libc.a reference (html) says that is 
on <dos.h>
I have DJGPP properly installed, set on the path, etc for more than
a year, and it compiles all other programs, except this one that I made.-
The error message is:
c:/lenguaje/djgpp/tmp\ccfvRkq1.o(.text+0x20c):dirdj.c: undefined reference 
to `_is_cdrom_drive'
c:/lenguaje/djgpp/tmp\ccfvRkq1.o(.text+0x239):dirdj.c: undefined reference 
to `_is_ram_drive'
c:/lenguaje/djgpp/tmp\ccfvRkq1.o(.text+0x25f):dirdj.c: undefined reference 
to `_media_type'
collect2: ld returned 1 exit status

I compile the program from Ms-DOS box from Win 98, with the command line:
redir -o dirdj.err -eo gcc dirdj.c -o dirdj.exe

The program is (is intended to do a DIR, and show the drives and type
of drives, this is a extract...)

// ----------------------------------
#include <stdio.h>
#include <stdlib.h>
#include <dir.h> // para hacer el dir
#include <dos.h> // para identificar los drives

int main()
{
int done = 0;
int disk = 0;
struct ffblk f;

     done = findfirst("*.*", &f, FA_DIREC | FA_HIDDEN | FA_SYSTEM);
     while (!done)
     {

       if ( f.ff_attrib & FA_DIREC ) // identifica los directorios
       {
        printf ("<DIR  > ");
       }
       else
       {
        printf ("<ARCH > ");
       }


       printf("%10u %2u:%02u:%02u %2u/%02u/%4u %s\n",
         f.ff_fsize,
         (f.ff_ftime >> 11) & 0x1f,
         (f.ff_ftime >>  5) & 0x3f,
         (f.ff_ftime & 0x1f) * 2,
         (f.ff_fdate >>  5) & 0x0f,
         (f.ff_fdate & 0x1f),
         ((f.ff_fdate >> 9) & 0x7f) + 1980,
         f.ff_name);

       done = findnext(&f);
     }


	done = getdisk();

	for (disk = 0;disk < 26;++disk)
		{
		   setdisk(disk);
		   if (disk == getdisk()) // disk = 0 = A
		   {
           printf("%c:\\", disk + 'A');

         if (_is_cdrom_drive( disk + 1 ) ) {
             printf (" < CD-ROM > \n");
            }
            else
            {
              if ( _is_ram_drive ( disk + 1 ) )
              {
               printf(" < RAM-DRIVE > \n");
              }
              else
              {
               if ( _media_type ( disk + 1 ) )
               {
               printf ("< HARD_DRIVE > \n");
               }
               else
               {
               printf ("< DISKETTERA > \n");
               }
              }
            }
		   }
		}
		setdisk(done);
}

// ----------------------------------

Well, thank you for you future help...



_________________________________________________________________
Con MSN Hotmail súmese al servicio de correo electrónico más grande del 
mundo. http://www.hotmail.com/ES

- Raw text -


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