C、Cygwin,以及编译 drand 和 srand
我有一个 C 代码,我试图在 Cygwin 中编译它,其中包含 drand()
和 srand()
函数。我安装了 Windows Vista 并安装了 Cygwin,代码似乎可以正常编译,但我的计算机坏了,我必须买一台新计算机。新电脑装有Windows 7 64位版本。我在下载 Cygwin 时遇到了一些问题,但最终只选择了几个软件包就成功了,然后一直尝试获取我需要的其余部分。问题是我没有在另一台计算机上安装它的帮助,所以我不知道我实际需要哪些软件包,所以我只是在猜测(所有 gcc 软件包),但我不能有那个软件包我需要 srand 和 drand 才能工作。如果有人能指出我正确的方向,并且可能只是让我知道我需要编译 C 的哪些软件包,以便我可以检查我是否拥有它们,那就太好了。
预先非常感谢您的帮助。
抱歉,说了很多话!
凯蒂亚娜
I have a C code which I am trying to compile in Cygwin and which contains both the drand()
and srand()
functions. I had Windows Vista with Cygwin installed and the code seemed to comile fine, but my computer broke and I had to get a new one. The new computer has Windows 7 64-bit version. I had a few issues downloading Cygwin but finally managed to do it by only selecting a few packages and then have been trying to get the rest that I need. The problem is I don't have the help I had installing it on my other computer so I don't know which packages I actually need, so I have just been guessing (all the gcc ones) but I mustn't have the one I need for srand and drand to work. If anyone could point me in the right direction, and also possibly just let me know which packages I need to compile C so I can check I have them all that would be great.
Thanks a lot in advance for any help.
Sorry, that was a lot of words!
Kaytiana
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
srand()
和drand()
函数是
库的一部分,应包含在 gcc-core cygwin 中包裹。如果不是,那么我认为这将是 cygwin 64 位软件包或操作系统的问题。既然您提到安装时遇到问题,我假设过程中出了问题。srand()
anddrand()
functions are part of the<stdlib.h>
library and should be included with the gcc-core cygwin package. If no, then I think it will be an issue with cygwin 64 bit packages or the OS. Since you mentioned you had problems installing, I am assuming something went wrong on the process.drand
不保证是 C 标准库的一部分。话虽这么说,我会首先安装所有相关的 stdlib 和 gcc 库。我无法想象存在一个单独的 drand 图书馆。drand
is not guaranteed to be part of the C standard library. That being said, I would install all of the relevant stdlib and gcc libraries first. I can't imagine a separate drand library existing.