468,497 Members | 1,899 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,497 developers. It's quick & easy.

_mkdir question

32
I'm using gnu c++ on Unix

I have included direct.h

My code reads

int retval=_mkdir(path);

Compiler keeps failing saying _mkdir undeclared(first use of this function)

Any clues as to how to get compiler to recognize _mkdir?

Thanks

emp
Nov 20 '07 #1
3 5742
seforo
60
What is make _mkdir? Or you want to use mkdir command of linux? Then you should consider using the function system()
Nov 20 '07 #2
emp
32
What is make _mkdir? Or you want to use mkdir command of linux? Then you should consider using the function system()

I was missing include sys/types.h

mkdir creates a directory in c/c++ code.

It compiles now
Nov 20 '07 #3
weaknessforcats
9,207 Expert Mod 8TB
I was missing include sys/types.h

mkdir creates a directory in c/c++ code.
Yes, that's one difference between C and C++. C++ requires function prototypes on all functions excemtp main().
Nov 20 '07 #4

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

3 posts views Thread by Stevey | last post: by
10 posts views Thread by glenn | last post: by
53 posts views Thread by Jeff | last post: by
56 posts views Thread by spibou | last post: by
2 posts views Thread by Allan Ebdrup | last post: by
3 posts views Thread by gieforce | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.