将C ++从Windows移植到Solaris [英] Porting C++ from Windows to Solaris

查看:86
本文介绍了将C ++从Windows移植到Solaris的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在将一个很大的C ++项目从Visual Studio移植到Solaris计算机上,可能是使用Eclipse.第一步,我试图使其在Windows计算机上的Cygwin/Eclipse/gcc下进行编译.一切都很好,但是现在我需要一些专家帮助.

该代码使用_sopen和_close,_SH_DENYNO等.这些和其他含义意味着Windows版本包括Microsoft文件io.h,fcntl.h和share.h.我的Eclipse/Cygwin具有相同名称的这些文件.方便.

我本周计划将全部内容推到Solaris上,当然那里没有任何Microsoft文件.

I am porting a very big C++ project from Visual Studio to a Solaris machine, probably using Eclipse. As a first step I am trying to get it to compile under Cygwin/Eclipse/gcc on my Windows machine. It''s going quite well, but now I need some specialist help.

The code uses _sopen and _close, _SH_DENYNO and suchlike. These and other things mean the Windows version includes Microsoft files io.h, fcntl.h and share.h. My Eclipse/Cygwin has these files available with the same names. That''s handy.

This week I plan to push the whole lot onto the Solaris, and of course there aren''t any Microsoft files there. There must be something else available, can somebody tell me where to look?

推荐答案

在Solaris上,您必须使用POSIX标准文件功能,例如open()close() .使用fcntl()lockf()等单独的功能而不是打开命令的选项来完成文件锁定.
On Solaris you must use the POSIX standard file functions like open() and close(). File locking is done using separate functions like fcntl() and lockf() instead of options to the opening command.


这篇关于将C ++从Windows移植到Solaris的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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