C如何在非unix上工作? [英] How does C work on non-unix?
问题描述
我已经编程了一段时间,但我的大部分经验都是在unix上。
C编译器如何处理那些用C语言编写的操作系统?
并且没有libc?
在unix上编译C似乎很容易。代码中的所有内容都可以是机器代码,或链接到C库(通常是libc)或链接到内核的
。在非unix操作系统上是否有libc等价物?
-
使用M2,Opera的革命性电子邮件客户端: http://www.opera.com/m2/
I''ve been programming for a while, but most of my experience is on unix.
How do C compilers work on operating systems that weren''t written in C?
And that have no libc?
Compiling C on unix seems so easy. Everything in the code either goes
right to machine code, or links to a C library (often libc) or links to
the kernel. Are there libc equivalents on non-unix OSes?
--
Using M2, Opera''s revolutionary e-mail client: http://www.opera.com/m2/
推荐答案
" Ryan M" < no@thank.you>在消息中写道
news:0b ****************************** @ news.1usenet .com ...
"Ryan M" <no@thank.you> wrote in message
news:0b******************************@news.1usenet .com...
我已经编程了一段时间,但我的大多数经验都是在unix上。
C编译器如何在没有用C语言编写的操作系统上工作?
那没有libc?
在unix上编译C似乎很容易。代码中的所有内容都可以直接用于机器代码,或链接到C库(通常是libc)或链接到内核。在非unix操作系统上是否有libc等价物?
I''ve been programming for a while, but most of my experience is on unix.
How do C compilers work on operating systems that weren''t written in C?
And that have no libc?
Compiling C on unix seems so easy. Everything in the code either goes
right to machine code, or links to a C library (often libc) or links to
the kernel. Are there libc equivalents on non-unix OSes?
C(如这里所讨论的)是一种独立于平台的语言,定义为
国际标准。
见:
http://www.angelfire.com/ms3/bchambl...me_to_clc.html
和
http://www.eskimo.com/~scs/C-faq/top.html
-Mike
C (as discussed here) is a platform-independent language, defined
by an international standard.
See:
http://www.angelfire.com/ms3/bchambl...me_to_clc.html
and
http://www.eskimo.com/~scs/C-faq/top.html
-Mike
Ryan,
在有人说这不在主题之外这个小组,我的谦虚
答案是:
如果你在谈论像嵌入式系统这样的东西 - 通常你会用b / b
编译并为您的特定目标生成机器代码 - 然后在目标操作系统上运行该程序。
内核和库不必用C语言编写使用C t o
编写一个程序 - 虽然它可能不是*标准* C.
你想要编译C程序的目标处理器/操作系统是什么?
那里可能有一个C编译器。
希望有所帮助。
赛斯
Ryan M写道:
Ryan,
Before someone says this is outside the topic of this group, my humble
answer is:
If you are talking about something like an embedded system- usually you
would use a cross-compiler and generate machine code for your specific
target- then run that program on the OS of your target.
Kernels and libs do not have to be written in C for you to use C to
write a program- although it might not be *standard* C.
What target processor/OS are you looking to compile a C program for?
There might be a C compiler out there.
Hope that helps.
Seth
Ryan M wrote:
我已经编程了一段时间,但我的大多数经验都是在
unix上。 C编译器如何处理在C中没有编写的操作系统?那没有libc?
在unix上编译C看起来很容易。代码中的所有内容都可以直接用于机器代码,或链接到C库(通常是libc)或链接到内核。在非unix操作系统上是否存在libc等价物?
I''ve been programming for a while, but most of my experience is on
unix. How do C compilers work on operating systems that weren''t written
in C? And that have no libc?
Compiling C on unix seems so easy. Everything in the code either goes
right to machine code, or links to a C library (often libc) or links to
the kernel. Are there libc equivalents on non-unix OSes?
~让我们linux~
----- =通过Newsfeeds.Com发布,未经审查的Usenet新闻= -----
http://www.newsfeeds.com - 世界排名第一的新闻组服务!
----- ==超过100,000个新闻组--19个不同的服务器! = -----
~ Let us linux ~
-----= Posted via Newsfeeds.Com, Uncensored Usenet News =-----
http://www.newsfeeds.com - The #1 Newsgroup Service in the World!
-----== Over 100,000 Newsgroups - 19 Different Servers! =-----
Ryan M写道:
Ryan M wrote:
我已经编程了一段时间,但大多数我的经验是关于
unix。 C编译器如何处理在C中没有编写的操作系统?那没有libc?
在unix上编译C看起来很容易。代码中的所有内容都可以直接用于机器代码,或链接到C库(通常是libc)或链接到内核。在非unix操作系统上是否存在libc等价物?
I''ve been programming for a while, but most of my experience is on
unix. How do C compilers work on operating systems that weren''t written
in C? And that have no libc?
Compiling C on unix seems so easy. Everything in the code either goes
right to machine code, or links to a C library (often libc) or links to
the kernel. Are there libc equivalents on non-unix OSes?
为什么它会有所不同?在所有托管的实现(Unix和
否则)上,OS(或类似的东西)提供了一些基本的
功能。 C库可能是该功能的一部分,或者它可以通过使用该功能单独编写
。
Windows碰巧提供动态库(msvc.dll或类似
那样)实现了C库。 Cygwin做了类似的事情。据我所知,这个
与Unix的基本相同。没有''内置''C库的
系统的编译器通常附带他们的
自己的实现。
-Kevin
-
我的电子邮件地址有效,但会定期更改。
要联系我,请使用以下地址:最近的帖子。
Why would it be any different? On all hosted implementations (Unix and
otherwise), the OS (or something similar) provides some basic
functionality. The C library may be part of that functionality, or it
may be written separately by making use of that functionality.
Windows happens to provide a dynamic library (msvc.dll or something like
that) that implements the C library. Cygwin does something similar. This
is basically the same thing Unix does, as far as I know. Compilers for
systems that don''t have a ''built in'' C library usually ship with their
own implementation.
-Kevin
--
My email address is valid, but changes periodically.
To contact me please use the address from a recent posting.
这篇关于C如何在非unix上工作?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!