Compile error

Dear All

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.

Thank you

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.

Maybe you will find this useful:

Hi ,
Can you please add code snippet for the same

Thanks
Naren

Dear

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?

Thank you

Dear Naren

Can you elaborate what you mean by code snippet? where I can get that code? What that code can do?

Thank you

Hi coulio,

by code snippet i mean copy paste part of your code , whcih uses getopt ,

so that we can analyse how it is used .

we can plan next

can you check this link where there is link for getopt foe windows

Thanks
naren

Thank you Naren

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.

Thank you again

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.

dear Blowtorch

Yes, the code was complied in unix environement before compiling in window. Now I want to compile in window. Any advice for me?