【发布时间】:2009-02-12 21:56:43
【问题描述】:
在 Linux 下编程时,我非常喜欢使用 GNU getopt。据我所知,getopt() 在 MS VC++ 下不可用。
注意:
- Win32 环境
- 使用 Visual Studio
- 没有Boost
- 没有 MFC
- 不关心便携性
问题:
- 我怎样才能相应地移植 getopt()?
- 移植时应注意哪些准则?
- 具有相同功能的已知端口?
【问题讨论】:
标签: c++ windows visual-studio-2008
在 Linux 下编程时,我非常喜欢使用 GNU getopt。据我所知,getopt() 在 MS VC++ 下不可用。
注意:
问题:
【问题讨论】:
标签: c++ windows visual-studio-2008
这可能会有所帮助,它也很容易集成
【讨论】:
有一些最初由 IBM 提供的旧代码可按原样使用。它只有 getopt 的实现,而不是 _long 变体。 它可以在http://plexfx.org/news/files/70411c2c371bd686273a8bebc42c45c5-3.html上找到
【讨论】:
您必须查看许可证要求,但 GCC 库的源代码是免费提供的。只需从那里抓取 getopt() 即可。
【讨论】: