sco open server C++不支持“try”!

今天想在SCO Open server 5上写C++程序,用“try catch”处理异常,结果CC编译器不能识别“try”语句,上SCO网站上查了一下关于C++编译器的内容,内容如下:

DOC HOME SITE MAP MAN PAGES GNU INFO SEARCH PRINT BOOK
 

C and C++ compilers

SCO OpenServer Release 5.0.7 includes three different C and C++ compilers:

Sometimes trying to choose between these three options can be confusing. To aid your decision, review the above sections, which discuss the advantages and limitations of each development environment.

Additionally, your specific circumstances often help to narrow the choices. The following guidelines may prove useful:

  •  

  • If you are writing non-UDI device drivers, use the SCO OpenServer Development System.

     

  • If you are generating COFF binaries, use the SCO OpenServer Development System.

     

  • If you are writing in C++, avoid the SCO OpenServer Development System.

     

  • If you are writing Java native code (JNI), use the UDK.

     

  • If you are linking against legacy or third-party libraries, do not use the UDK. (If you are writing Java native code to interface to a third-party library, this presents a problem. To workaround this, split your native code into a separate process and communicate via a socket.)

     

  • If you are using an API that doesn't exist in UnixWare do not use the UDK.

     

  • If you are building Open Source code, the GNU Development Tools usually work best.

If none of these considerations apply, then the decision is often more a matter of personal preference.

See also:

 

SCO OpenServer Development System

This is the development system specifically designed for use with SCO OpenServer, and is sometimes referred to as the ``native'' development system because it is used to build most of the SCO OpenServer operating system. It is a licensed product and included on the main SCO OpenServer CD-ROM. Discounts on the license are available if you join the SCO Developer Network.

Reasons to use this development environment include:

  •  

  • You must use the native development system when writing non-UDI device drivers for SCO OpenServer.

     

  • It provides the best integration with SCO OpenServer system headers and system libraries, and with existing third-party objects and libraries.

     

  • It is the most reliable to use when generating older object formats (COFF).

Issues to consider:

  •  

  • The native C and C++ compilers do not produce code specifically optimized for Pentium Pro or later Intel architectures.

     

  • The C compiler provides many of the language and library features of the 1999 ANSI/ISO C standard, but is not fully C99 conformant.

     

  • The C++ compiler is based on the AT&T c-front Release 3 C++ converter. The compiler represents the 1992 level of the language and does not include many of the new language or library features of the 1998 ANSI/ISO C++ standard.

     

  • Debugger support of C++ is weak, although you can use the UDK debugger with SCO OpenServer C++ binaries to get around this issue.

     

  • These compilers lack the 64-bit long long integer type.

     

  • Java native code (JNI) cannot be built with these compilers.

GNU Development Tools

The GNU Development Tools are a collection of well-known, high-quality Open Source compilers and tools, such as gcc, g++, and gdb, that are used heavily on Linux and on many other UNIX platforms.

For SCO OpenServer Release 5.0.7, the GNU Development Tools are included in a separately-installable package that is available on the main SCO OpenServer CD-ROM. New for Release 5.0.7, the GNU Development Tools are fully supported by SCO. As well, support remains available through the Open Source community.

Reasons to use this development environment include:

  •  

  • If you already use the GNU Development Tools on other platforms, there is no learning curve required to use them on SCO OpenServer.

     

  • If your application has been built with GCC on other platforms, it will be quickest to port the application if you use GCC on SCO OpenServer.

     

  • GCC provides good integration with SCO OpenServer system headers and system libraries, and with existing third-party objects and libraries.

     

  • The C++ compiler in GCC implements many of the new C++ language and library features from the 1998 ANSI/ISO C++ standard. Because it is also a native C++ compiler, debuggers like GDB can more easily debug C++ programs.

Issues to consider:

  •  

  • The GCC compilers are idiosyncratic in language interpretation, and you must be careful if you want source code built with them to be portable to non-GCC platforms.

     

  • Performance of generated code is generally less than with either the native SCO OpenServer or the UDK compilers, although only very performance-sensitive applications will notice the difference.

     

  • Using GCC to build SCO OpenServer device drivers is possible but not recommended (unless the driver is UDI-based).

     

  • GCC cannot be used to build Java native code (JNI) on SCO OpenServer.

UnixWare and OpenServer Development Kit (UDK)

The UnixWare and OpenServer Development Kit (UDK) is the most powerful development system available for SCO OpenServer, providing the most current standards conformance. (The UDK is the successor to the UnixWare/OpenServer Development Kit, also referred to as the UODK).

The UDK is a licensed product that is provided in the SCO OpenServer Release 5.0.7 media kit. Discounts are available if you join the SCO Developer Network.

 


NOTE: UDK-built applications can only execute on SCO OpenServer if the OSRcompat Binary Compatibility Module is installed on both development and application deployment systems.


Reasons to use this development environment include:

  •  

  • Provides the best application performance on Pentium, Pentium Pro, Pentium II, and Pentium III based machines. Performance is usually superior to both the native SCO OpenServer and the GCC options.

     

  • The UDK C and C++ compilers support almost all of the language and library features in the 1999 C and 1998 C++ ANSI/ISO standards.

     

  • For SCO OpenServer, you must use the UDK compiler if you are writing Java native code (JNI).

     

  • The UDK debugger is generally the strongest of the debuggers in the three development environment choices (and can be used in conjunction with the native SCO OpenServer and the GCC compilers if desired).

     

  • This is the best choice if you want to produce a binary that runs on all SCO UNIX platforms.

Issues to consider:

  •  

  • The UDK cannot be used for non-UDI SCO OpenServer device drivers.

     

  • The UDK cannot be used for APIs (such as POSIX threads) that are not common to both SCO OpenServer and UnixWare 7/Open UNIX 8.

     

  • Most significantly, the UDK cannot be used on SCO OpenServer if you need to link against existing third-party object files or libraries that were built with the native SCO OpenServer compiler.

Building for more than one SCO platform

Many customers want to build application packages that can be used on both SCO OpenServer and UnixWare 7/Open UNIX 8 systems. You have two different ways to approach this:

  •  

  • Use the traditional cross-platform practice of inserting #ifdef preprocessor conditional code tests in your sources, to build different binaries of your application for different platforms. Using this method, you can use whichever compilers you like on each platform. (If you already have your code set up this way to build on many different UNIX or other platforms, then this may be the most convenient way for you to proceed.)

     

  • Use the UDK compiler on SCO OpenServer or a UnixWare/Open UNIX 8 system to create a single binary that executes on all SCO UNIX platforms. You can also accomplish this by using the GCC compiler on UnixWare 7/Open UNIX 8. In order for these ``universal'' binaries to run on SCO OpenServer, the appropriate OSRcompat Binary Compatibility Module must be installed on the target system.

The advantage of the single binary approach is that it can reduce your development and maintenance costs. The limitation of the single binary approach is that you must confine yourself to using APIs that are present on all SCO UNIX platforms, and you must not link against existing third-party objects or libraries built on SCO OpenServer.

The following code sample illustrates how to test for various SCO UNIX platforms when doing conditional compilations:

   #include <stdio.h>
   

main() { #if defined(_SCO_DS) printf("OpenServer/n"); #elif defined(__UNIXWARE__) printf("UnixWare gcc/n"); #elif defined(__USLC__) #if defined( __STDC_VERSION__ ) && __STDC_VERSION__ == 199409 printf("Gemini I cc (UW7 and UDK)/n"); #else printf("UnixWare cc/n"); #endif #elif defined(M_UNIX) printf("ODT 3 or earlier/n"); #else printf("Other platform/n"); #endif }


Next topic: Java Development Kit (JDK)
Previous topic:
Overview of Development Systems for SCO OpenServer

© 2003 Caldera International, Inc. All rights reserved.
SCO OpenServer Release 5.0.7 -- 11 February 2003

其中说”建议不要用Open Server提供的C++编译器”,又说是因为"Sco openserver 5的CC编译器是基于AT&T c-front Release 3 C++ converter的,是比较老的C++编译器

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值