473,387 Members | 1,611 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

getopt.h in VS2005 c++

I have sources written on linux quite long ago.
They are compiled good on current linux machine.
but not in VS2005.

The cause of problem is #include<getopt.h>.
Is there any correspoinding files which can be used instead of getopt.h??

I tried xgetopt.h from codeproject
http://www.codeproject.com/cpp/xgetopt.asp

but this is not compatible with getopt.h at all, and
gives lots of error in compile time.
( eg. not defined structure option, macro requied_options and so on.)

Is there any way to re-use these sources with the least modifications?
Nov 30 '06 #1
2 6230
On Thu, 30 Nov 2006 14:45:21 +0900, auditory <pk*****@gmail.comwrote:
>I have sources written on linux quite long ago.
They are compiled good on current linux machine.
but not in VS2005.

The cause of problem is #include<getopt.h>.
Is there any correspoinding files which can be used instead of getopt.h??

I tried xgetopt.h from codeproject
http://www.codeproject.com/cpp/xgetopt.asp

but this is not compatible with getopt.h at all, and
gives lots of error in compile time.
( eg. not defined structure option, macro requied_options and so on.)

Is there any way to re-use these sources with the least modifications?
Download a small GNU project that uses getopt and port the getopt part. It
should be very easy, though you may have to GPL your code. Sorry, but I
don't know of any free replacement for the GNU getopt.

--
Doug Harrison
Visual C++ MVP
Nov 30 '06 #2

"Doug Harrison [MVP]" <ds*@mvps.orgwrote in message
news:m9********************************@4ax.com...
On Thu, 30 Nov 2006 14:45:21 +0900, auditory <pk*****@gmail.comwrote:
>>I have sources written on linux quite long ago.
They are compiled good on current linux machine.
but not in VS2005.

The cause of problem is #include<getopt.h>.
Is there any correspoinding files which can be used instead of getopt.h??

I tried xgetopt.h from codeproject
http://www.codeproject.com/cpp/xgetopt.asp

but this is not compatible with getopt.h at all, and
gives lots of error in compile time.
( eg. not defined structure option, macro requied_options and so on.)

Is there any way to re-use these sources with the least modifications?

Download a small GNU project that uses getopt and port the getopt part. It
should be very easy, though you may have to GPL your code. Sorry, but I
don't know of any free replacement for the GNU getopt.
BSD has a getopt as well that doesn't suffer from the same licensing
restrictions (you should acknowledge use of the code but no infectious
license).
>
--
Doug Harrison
Visual C++ MVP

Dec 4 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: David Bear | last post by:
I'm stumped. Trying to follow the docs and .. failure. here's the args >>> args '-Middwb@mainex1.asu.edu -AKHAAM@prlinux+898 -CA --D2003-08-20-09:28:13.417 -Ff -Hprlinux...
4
by: Dan Rawson | last post by:
Is there any way to force getopt to process one option first?? I'd like to be able to pass in the name of a configuration file for my application, then have the remaining command-line parameters...
3
by: Dominik Kaspar | last post by:
I tried to use getopt and copied the example from: http://www.python.org/doc/current/lib/module-getopt.html but nothing is working... getopt.GetoptError doesn't seem to exist and when i run the...
3
by: Don Low | last post by:
Hi, I'm going over a script that demonstrates the getopt function. I include the script here: #! /usr/bin/python import sys, getopt, string
6
by: Frans Englich | last post by:
Hello, In my use of getopt.getopt, I would like to make a certain parameter mandatory. I know how to specify such that a parameter must have a value if it's specified, but I also want to make...
1
by: Andrew | last post by:
Dear Experts, I have a perl program that using Getopt:Std module, when I try to run the GetOpt program, the following error returned: Can’t locate Getopt.pm in @INC (@INC contains:...
14
by: José de Paula | last post by:
Is getopt() and its companions, commonly found in GNU libc and other Unices libc, part of the C standard? Another doubt: I have a switch inside a while loop; is there a way to break out of the...
4
by: pinkfloydhomer | last post by:
I want to be able to do something like: myscript.py * -o outputfile and then have the shell expand the * as usual, perhaps to hundreds of filenames. But as far as I can see, getopt can only...
1
by: Daniel Mark | last post by:
Hello all: I am using getopt package in Python and found a problem that I can not figure out an easy to do . // Correct input D:\>python AddArrowOnImage.py --imageDir=c:/ // Incorrect...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.