Programming Forums

Programming Forums (http://www.programmingforums.org/forumindex.php)
-   C++ (http://www.programmingforums.org/forum15.html)
-   -   #include <dirent.h> (http://www.programmingforums.org/showthread.php?t=2059)

Siphon Feb 1st, 2005 11:52 AM

#include <dirent.h>
 
Im using MSVC++ 6.0 in WinXP... Do I need to download "dirent.h" from somewhere and if I do, where should I put it? Right now I've downloaded it and put it in the same folder as my program.

error C2065: 'scandir' : undeclared identifier
error C2065: 'alphasort' : undeclared identifier
error C2601: 'find' : local function definitions are illegal

These are the 3 errors I'm getting.

Berto Feb 2nd, 2005 2:30 AM

add it to the references in an option somewhere in MSVC++ then it shoud be fine.

Siphon Feb 2nd, 2005 3:09 AM

Can't find "References" anywhere, found a place where you can set the directories of include-files

But nothing else.

Siphon Feb 2nd, 2005 3:13 AM

I put the dirent.h-file in the same directory as all my other header-files (iostream etc) that MSVC had made itself... Still doesn't work... Still get these errors:

error C2065: 'scandir' : undeclared identifier
error C2065: 'alphasort' : undeclared identifier
error C2601: 'find' : local function definitions are illegal

P.S. I also got a .lib file when I downloaded the .h file... I have no clue what to do with lib files. I just put it with the .h file.

Ooble Feb 2nd, 2005 8:59 AM

Ah... just drag the lib (library) file into the project viewer. It should show up under all the folders. While the header file contains all the info about the functions you're using, the library file contains the functions themselves.

Siphon Feb 2nd, 2005 12:32 PM

Hehe.. Project Viewer? Is that the editting window or the one to the left where all the files are seen?

Siphon Feb 2nd, 2005 1:19 PM

Tried to drag it to the left window where all the files are seen... All that happened was that alot of numbers and letters showed up in the right window...

oO... I'm puzzled.

Ooble Feb 2nd, 2005 2:05 PM

That's odd. Try dragging it onto the project name. Sorry for not being clear earlier. Alternatively, you can edit the linker directives to include it, though that's a lot more difficult.

Siphon Feb 2nd, 2005 4:44 PM

Nothing... All that comes up is a hex-list like:

0000010 21 3C ... . . . .. <some form of semi-understandable coding text>
0000020 . . . ... . . . <ditto>
00000... ................. <dittotwo>
00000... ................. <...>
00000a0 ..................
00000b0 ................

That's how it looks.

Siphon Feb 2nd, 2005 4:47 PM

Managed to add it to the Source Files/Header Files by using 'Add files to folder' ... But doesn't work in either folder... btw, where should "dirent.h" be? With MSVC++'s other include files (iostream etc) or in my projects folder, and should it be included with < .... > or " .... " ?


All times are GMT -5. The time now is 6:21 PM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC