I have a program writen in C and test in Unix. Now, I am try to run this program in windows 2000. I am receiving an error _getopt is not define. I will appreciate if any one can help explain to me why this problem is hapening and to slove this problem.
Basic question... you have recompiled the code before running in Windows haven't you? Also, you may not be having the libraries that implement the 'getopt' function in Windows.
I do have geopt library in my window. But it seem it can not find it. When I execute the program, it will produce error that it can't find getopt in any directory. One thing I would like to know geopt class is for unix only or it can be used with windows?
I do not have my code here, next time I will take my code along with and copy & past for your view. This problem came out when I want to move my code from unix to window. The code tested in unix and work very well in unix but window have problem with getopt.
What files do you have for getopt? Just the header file is not enough. Also, if you're using C++ files in your project, there may be name-mangling issues.
The source code at http://www.yics.org/ apparently incorporates a getopt implementation for windows if that turns out to be what you need.
Don't bother trying to use source from libc. It's a tangled web of spiders, trying to seperate one function from the rest is generally futile.