移植C软件 [英] Porting C software
问题描述
晚上好,
我有一个Windows的C软件,我需要移植到Redhat Unix。
使用Windows FLOSS编译器完全正常的时刻
lccwin32。我尝试gcc,但现在它不起作用:(
似乎有两个严重的问题,一个操作符重载和
其他安全字符串是否有一个带有这些
高级功能的Unix编译器,或者将它们移植到最佳方式是什么?
感谢所有人!
JP。
Good evening,
I have a C software for Windows that I need to port to Redhat Unix. At
the moment it works completely fine with the Windows FLOSS compiler
lccwin32. I try gcc but now it doesn''t work :(
There seems to be two serious problems, one operator overloading and the
other the safe String type. Is there a compiler for Unix with these
advanced features, or what''s the best way to port them across?
Thanks to all!
J-P.
推荐答案
Jean-Pierre Mestre说:
Jean-Pierre Mestre said:
晚上好,
我有一个Windows软件,我需要移植到Redhat Unix。
当下它使用Windows FLOSS编译器完全正常工作
lccwin32。我尝试gcc但现在它不起作用:(
似乎有两个严重的问题,一个运算符重载和
另一个安全字符串类型。
Good evening,
I have a C software for Windows that I need to port to Redhat Unix. At
the moment it works completely fine with the Windows FLOSS compiler
lccwin32. I try gcc but now it doesn''t work :(
There seems to be two serious problems, one operator overloading and
the other the safe String type.
C没有任何一个功能。这些是对语言,
由执行者提供。你h ave刚刚发现了为什么在利用扩展之前应该认真考虑
认真考虑 - 他们使代码更加难以移植。
C doesn''t have either feature. These are extensions to the language,
provided by the implementor. You have just discovered why one should
think very seriously before taking advantage of extensions - they make
porting the code much more difficult.
是否有针对Unix的编译器,这些高级功能是什么,或者什么是将它们移植到最佳方式?
Is there a compiler for Unix with
these advanced features, or what''s the best way to port them across?
重新获得所需的便携性的最佳方法是用C语言重写
程序。
-
Richard Heathfield< http://www.cpax.org.uk>
电邮:-www。 + rjh @
谷歌用户:< http://www.cpax.org.uk/prg/writings/googly.php>
Usenet是一个奇怪的放置" - 1999年7月29日dmr
The best way to regain the portability you desire is to rewrite the
program in C.
--
Richard Heathfield <http://www.cpax.org.uk>
Email: -www. +rjh@
Google users: <http://www.cpax.org.uk/prg/writings/googly.php>
"Usenet is a strange place" - dmr 29 July 1999
Jean-Pierre Mestre< a。* @ c.comwrites:
Jean-Pierre Mestre <a.*@c.comwrites:
我有一个Windows的C软件,我需要移植到Redhat Unix。
使用Windows FLOSS编译器完全正常的时刻
lccwin32。我尝试gcc,但现在它不起作用:(
似乎有两个严重的问题,一个操作符重载和
其他安全字符串是否有一个带有这些
高级功能的Unix编译器,或者将它们移植到最佳方式是什么?
I have a C software for Windows that I need to port to Redhat Unix. At
the moment it works completely fine with the Windows FLOSS compiler
lccwin32. I try gcc but now it doesn''t work :(
There seems to be two serious problems, one operator overloading and the
other the safe String type. Is there a compiler for Unix with these
advanced features, or what''s the best way to port them across?
不,这些是lccwin32特有的功能。如果你想能够使用它,你将不得不修改你的软件而不是使用它们.b $ b将它与任何其他C实现一起使用。
-
有些人*是*傲慢,其他人阅读常见问题。
--Chris Dollin
No, these are lccwin32-specific features. You will have to
modify your software not to use them if you want to be able to
use it with any other C implementation.
--
"Some people *are* arrogant, and others read the FAQ."
--Chris Dollin
Jean-Pierre Mestre< a。* @ c.comwrites:
Jean-Pierre Mestre <a.*@c.comwrites:
晚上好,
我有一个适用于Windows的C软件,我需要移植到Redhat Unix。
当它完全正常使用Windows FLOSS编译器
Good evening,
I have a C software for Windows that I need to port to Redhat Unix. At
the moment it works completely fine with the Windows FLOSS compiler
< off topic> lcc-win32不是FLOSS as f据我所知。 FLOSS(Free,
Libre,开源软件)是一个包罗万象的东西,但我不认为
认为该术语扩展到只是免费的软件
非商业用途。< / off topic>
<off topic>lcc-win32 is not FLOSS as far as I know. FLOSS (Free,
Libre, Open Source Software) is something of a catch-all but I don''t
think the term extends to software that is simply free for
non-commercial use.</off topic>
lccwin32。我尝试gcc,但现在它不起作用:(
似乎有两个严重的问题,一个操作符重载和
其他安全字符串是否有一个带有这些
高级功能的Unix编译器,或者将它们移植到最佳方式是什么?
lccwin32. I try gcc but now it doesn''t work :(
There seems to be two serious problems, one operator overloading and the
other the safe String type. Is there a compiler for Unix with these
advanced features, or what''s the best way to port them across?
最干净的解决方案是将
中的一个替换为String对象,这是一个免费的精美字符串库(抱歉,我没有链接,因为你需要至少两个,但至少有两个是通过这里的常客)并且取消选择
运算符重载。
如果它有很多,那么lcc-win32的语义'超载
是非常接近的匹配,因为它在标准中有字符串对象,因此*可能*在g ++(C ++
在GNU系列中编译)中有一些里程数
库和操作符重载语言。当然,
详细信息最终会成为该组的主题 - 只要你的c ode
接近C ++编译器就变成了C ++,你需要专业的知识来支持你们(c = c ++人)(新闻:comp.lang.c ++)。
[显然,也要避免使用任何gcc扩展 - 代码是一次移植到
,因此可能需要再次移植。]
-
Ben。
The cleanest solution would be replace the String objects with one of
the fine, freely-available string libraries (sorry I have no link for
you but at least two are written by regulars here) and to hand un-pick
the operator overloading.
If there is a lot if it, and the semantics of lcc-win32''s overloading
is close match, there *may* be some mileage in targeting g++ (the C++
compile in the GNU family) since that has string objects in a standard
library and operator overloading in the language. Of course, the
details end up being off topic for this group -- as soon as your code
goes near a C++ compiler is becomes C++ and you need the expertise of
C++ people to guide you (news:comp.lang.c++).
[Obviously, avoid any gcc extensions as well -- the code is being
ported once, so it may have to be ported again.]
--
Ben.
这篇关于移植C软件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!