[C++] Kan header files niet vinden:

Pagina: 1
Acties:
  • 37 views sinds 30-01-2008

  • Speed_Sheep
  • Registratie: Augustus 2001
  • Laatst online: 25-11-2021
Met stomheid geslagen snap ik totaal niet waarom ik de directory gerelateerde header files niet kan includen. 8)7

Ik werk met Visual C++ 6.0 Enterprise Edition SP5 op Windows XP SP1.

Nu wil ik de volgende code, gevonden op http://poli.cs.vsb.cz/c/help/dir0.htm#LBL11 kunnen uitvoeren:
C++:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
 #include <dir.h>
 #include <stdio.h>
 #include <string.h>

 char *current_directory(char *path)
 {
    strcpy(path, "X:\\");      /* fill string with form of response: X:\ */
    path[0] = 'A' + getdisk();    /* replace X with current drive letter */
    getcurdir(0, path+3);  /* fill rest of string with current directory */
    return(path);
 }

 int main(void)
 {
    char curdir[MAXPATH];

    current_directory(curdir);
    printf("The current directory is %s\n", curdir);

    return 0;
 }


Hele tijd gegoogled en geGotterd, maar vind niet de goede topics over dir.h, dirent.h etc...

Error die ik krijg: can't open include file: 'dir.h'

Komt dit nu omdat bestand helemaal niet bij VC++ standaard zit en ik hem dus moet downloaden en in project map moet stoppen? Of is het een standaard header file van een niet-windows OS?

Systeemspecs


  • Jerry
  • Registratie: September 2001
  • Laatst online: 24-03 16:08

Jerry

Who?

Google: (gezocht op "Visual C++ dir.h")
Originally Posted by trouble1
I do not have dir.h I wonder if I had it or where I can get it

that file does not exist in Windows. That is for unix/linux.
:)

[ Voor 11% gewijzigd door Jerry op 28-03-2004 22:56 ]


  • .oisyn
  • Registratie: September 2000
  • Laatst online: 10:24

.oisyn

Moderator Devschuur®

Demotivational Speaker

Mja, even zoeken he. Geen van de dir.h functies staan in de MSDN, dus het is ook nogal onwaarschijnlijk dat ze ondersteund worden door VC6

.edit: en aan alleen een dir.h heb je niets, dat zijn slechts declaraties. Je hebt ook nog de bijbehorende library nodig

[ Voor 31% gewijzigd door .oisyn op 28-03-2004 23:09 ]

Give a man a game and he'll have fun for a day. Teach a man to make games and he'll never have fun again.


Dit topic is gesloten.