我可以在Palm OS应用程序中使用标准C库吗?

时间:2022-09-07 08:51:21

The published code for Palm OS applications doesn't include standard headers, but instead uses Palm OS APIs for things like StrCopy and MemMove. Can I use standard headers and functions or do I need to convert my code to use the Palm OS versions?

已发布的Palm OS应用程序代码不包含标准头文件,而是使用Palm OS API来处理StrCopy和MemMove等内容。我可以使用标准头文件和函数,还是需要将我的代码转换为使用Palm OS版本?

2 个解决方案

#1


2  

From a program size point of view its better to use the Palm OS API whenever possible, since that means you don't have to include the code from the library in the generated 'executable'. If you use functions from the compiler provided libraries the code of that functions will be added to each of your programs increasing their sizes.

从程序大小的角度来看,最好尽可能使用Palm OS API,因为这意味着您不必在生成的“可执行文件”中包含库中的代码。如果您使用编译器提供的库中的函数,那么该函数的代码将添加到您的每个程序中,从而增加它们的大小。

#2


1  

It depends on the compiler and what version of the tools you're using. In general, if you can use Palm OS APIs, you'll probably work better on the platform, but both CodeWarrior and prc-tools had some library functions implemented.

这取决于编译器以及您正在使用的工具版本。通常,如果您可以使用Palm OS API,您可能会在平台上更好地工作,但CodeWarrior和prc-tools都实现了一些库函数。

In CW for Palm OS V9, there's a pretty full version of the Metrowerks Standard Library (MSL). Most of MSL C++ is there giving you access to STL and other constructs. On the C front, you've got most of the standard C headers for memory management and string functions. However, it omits implementations for locales, math, signals, and standard I/O.

在CW for Palm OS V9中,有一个完整版的Metrowerks标准库(MSL)。大多数MSL C ++都允许您访问STL和其他构造。在C方面,您已经获得了大多数用于内存管理和字符串函数的标准C头。但是,它省略了语言环境,数学,信号和标准I / O的实现。

To use the library, you need to make sure you link with the MSL C/C++ libraries. This can be set when you create your project in the wizard or added later by modifying the access paths and adding the appropriate static libraries for your targets.

要使用该库,您需要确保链接到MSL C / C ++库。这可以在向导中创建项目时设置,也可以稍后通过修改访问路径并为目标添加适当的静态库来添加。

#1


2  

From a program size point of view its better to use the Palm OS API whenever possible, since that means you don't have to include the code from the library in the generated 'executable'. If you use functions from the compiler provided libraries the code of that functions will be added to each of your programs increasing their sizes.

从程序大小的角度来看,最好尽可能使用Palm OS API,因为这意味着您不必在生成的“可执行文件”中包含库中的代码。如果您使用编译器提供的库中的函数,那么该函数的代码将添加到您的每个程序中,从而增加它们的大小。

#2


1  

It depends on the compiler and what version of the tools you're using. In general, if you can use Palm OS APIs, you'll probably work better on the platform, but both CodeWarrior and prc-tools had some library functions implemented.

这取决于编译器以及您正在使用的工具版本。通常,如果您可以使用Palm OS API,您可能会在平台上更好地工作,但CodeWarrior和prc-tools都实现了一些库函数。

In CW for Palm OS V9, there's a pretty full version of the Metrowerks Standard Library (MSL). Most of MSL C++ is there giving you access to STL and other constructs. On the C front, you've got most of the standard C headers for memory management and string functions. However, it omits implementations for locales, math, signals, and standard I/O.

在CW for Palm OS V9中,有一个完整版的Metrowerks标准库(MSL)。大多数MSL C ++都允许您访问STL和其他构造。在C方面,您已经获得了大多数用于内存管理和字符串函数的标准C头。但是,它省略了语言环境,数学,信号和标准I / O的实现。

To use the library, you need to make sure you link with the MSL C/C++ libraries. This can be set when you create your project in the wizard or added later by modifying the access paths and adding the appropriate static libraries for your targets.

要使用该库,您需要确保链接到MSL C / C ++库。这可以在向导中创建项目时设置,也可以稍后通过修改访问路径并为目标添加适当的静态库来添加。