getopt implicit declaration in Solaris?
Posted
by Steven
on Stack Overflow
See other posts from Stack Overflow
or by Steven
Published on 2009-12-13T22:36:26Z
Indexed on
2010/05/26
22:41 UTC
Read the original article
Hit count: 199
In Solaris, gcc gives me
implicit declaration of function `getopt'
when compiling
#include <unistd.h>
#include <stdlib.h>
int main(int argc, char *argv[]) {
getopt(1,argv,"");
return 0;
}
The man page for getopt says something about including unistd.h or stdio.h, however even though I'm inluding both I still get this warning. Is this normal? Is using functions that aren't explicitly declared common in Unix development?
© Stack Overflow or respective owner