通用(g)libc [英] Universal (g)libc

查看:91
本文介绍了通用(g)libc的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在C中编写非GUI软件,用于Windows和Linux。而

libc软件包通常是兼容的,我最终会得到很多

条件宏用于操作系统和I / O相关的东西,如睡眠,套接字

fork等


我真正喜欢的东西是在Windows平台上实现的可能的glibc。我见过cygwins dll,但是因为我无法透露一些不是我的来源,所以没有好处。我看过

wxWidgets基础,但它是C ++,我想要纯粹的C.


任何经验创意?

解决方案

Roger写道:

我在C中编写非GUI软件,用于Windows和Linux。虽然libc软件包通常是兼容的,但我最终会为OS和I / O相关的东西提供很多
条件宏,比如睡眠,套接字等等。
什么我真的很喜欢在Windows平台上实现可能的glibc。我见过cygwins dll,但是没有好处,因为我无法透露一些不属于我的来源。我已经看到了wxWidgets基础,但它是C ++,我想要纯粹的C.

任何经验创意?



使用apr。
http://apr.apache.org/


Roger写道:

我在C中编写非GUI软件,用于Windows和Linux。虽然libc软件包通常是兼容的,但我最终会为操作系统和I / O相关的东西提供很多
条件宏,比如睡眠,套接字等。
<我真正喜欢的是在Windows平台上实现可能的glibc的东西。我见过cygwins dll,但是没有好处,因为我无法透露一些不属于我的来源。我已经看到了wxWidgets基础,但它是C ++,我想要纯C.


这个组只处理标准C所以我害怕请求库

用于实现标准C中无法完成的事情(甚至是可以使用的事物,而不是
)不是主题。

任何经验想法?




是的,编写一个抽象层,其中包含所有特定于系统的
内容,并从代码主体中调用它。然后所有

系统特定的东西和条件宏将被隔离在一个

的地方,将大部分代码保存在一个地方。


< OT>

您可能会发现MinGW和/或GNUWin32非常有用,但我仍然建议您从大部分代码中隔离系统特定代码

轻松

未来发布的问题。

< / OT>

-

Flash Gordon
生活在有趣的时代。

虽然我的电子邮件地址是垃圾邮件,但它是真实的,我读了它。


那是一个很好的链接,我不知道!

谢谢。


I am writing non GUI software in C for use on Windows and Linux. while
libc packages are generally compatible, I am ending up with a lot of
conditional macros for OS and I/O related stuff such as sleep, sockets
fork etc.

What I would really loke is something that implements as much as
possible glibc on a windows platform. I have seen cygwins dll, but is
no good as I cannot reveal some source which is not mine. I have seen
the wxWidgets base, but it is C++ and I want pure C.

Any experience ideas?

解决方案

Roger wrote:

I am writing non GUI software in C for use on Windows and Linux. while
libc packages are generally compatible, I am ending up with a lot of
conditional macros for OS and I/O related stuff such as sleep, sockets
fork etc. What I would really loke is something that implements as much as
possible glibc on a windows platform. I have seen cygwins dll, but is
no good as I cannot reveal some source which is not mine. I have seen
the wxWidgets base, but it is C++ and I want pure C.

Any experience ideas?


Use apr.
http://apr.apache.org/


Roger wrote:

I am writing non GUI software in C for use on Windows and Linux. while
libc packages are generally compatible, I am ending up with a lot of
conditional macros for OS and I/O related stuff such as sleep, sockets
fork etc.

What I would really loke is something that implements as much as
possible glibc on a windows platform. I have seen cygwins dll, but is
no good as I cannot reveal some source which is not mine. I have seen
the wxWidgets base, but it is C++ and I want pure C.
This group only deals with standard C so I''m afraid requesting a library
that implements things that cannot be done in standard C (or even things
that can) is not on topic.
Any experience ideas?



Yes, write an abstraction layer that contains all the system specific
stuff and call that from the main body of your code. Then all of the
system specific stuff and conditional macros will be isolated in one
place keeping the bulk of the code in one place.

<OT>
You may find MinGW and/or GNUWin32 useful, but I would still recommend
isolating your system specific code from the bulk of your code to ease
future posting issues.
</OT>
--
Flash Gordon
Living in interesting times.
Although my email address says spam, it is real and I read it.


That was a good link, didn''t know about that!
Thanks.


这篇关于通用(g)libc的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆