打印

string.h里的问题

[复制链接]
2877|7
手机看帖
扫描二维码
随时随地手机跟帖
跳转到指定楼层
楼主
jiyiche|  楼主 | 2009-4-9 23:45 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
我在HT-IDE里写C程序中包含了<string.h>,编译时出现错误提示如下:

伪指令progma的字符串`SAVE`无效
伪指令progma的字符串`REGPARMS`无效
伪指令progma的字符串`RESTORE`无效

这是为什么呢?如果在UV2里面编译就不会出错。我用HT的IDE为什么就不行?补充:HT-IDE是台湾HOLTEK公司的IDE,有自己的库,只是我要用KEIL C里的<string.h>头文件,应该怎么办。
STRING.H是从KEIL C文件夹中INC子文件夹里找到的,内容如下:
/*--------------------------------------------------------------------------
STRING.H

String functions.
Copyright (c) 1988-2002 Keil Elektronik GmbH and Keil Software, Inc.
All rights reserved.
--------------------------------------------------------------------------*/

#ifndef _SIZE_T
 #define _SIZE_T
 typedef unsigned int size_t;
#endif

#ifndef NULL
 #define NULL ((void *) 0L)
#endif

#pragma SAVE
#pragma REGPARMS
extern char *strcat (char *s1, char *s2);
extern char *strncat (char *s1, char *s2, int n);

extern char strcmp (char *s1, char *s2);
extern char strncmp (char *s1, char *s2, int n);

extern char *strcpy (char *s1, char *s2);
extern char *strncpy (char *s1, char *s2, int n);

extern int strlen (char *);

extern char *strchr (const char *s, char c);
extern int strpos (const char *s, char c);
extern char *strrchr (const char *s, char c);
extern int strrpos (const char *s, char c);

extern int strspn (char *s, char *set);
extern int strcspn (char *s, char *set);
extern char *strpbrk (char *s, char *set);
extern char *strrpbrk (char *s, char *set);
extern char *strstr  (char *s, char *sub);
extern char *strtok  (char *str, const char *set);

extern char memcmp (void *s1, void *s2, int n);
extern void *memcpy (void *s1, void *s2, int n);
extern void *memchr (void *s, char val, int n);
extern void *memccpy (void *s1, void *s2, char val, int n);
extern void *memmove (void *s1, void *s2, int n);
extern void *memset  (void *s, char val, int n);
#pragma RESTORE

相关帖子

沙发
computer00| | 2009-4-9 23:47 | 只看该作者

HT-IDE是啥?它没有自己的库吗?

使用特权

评论回复
板凳
dxpol432| | 2009-4-9 23:56 | 只看该作者

HT-IDE

是不是 台湾高低技术(河络科技)仿真器

使用特权

评论回复
地板
jiyiche|  楼主 | 2009-4-10 00:17 | 只看该作者

HT-IDE是HOLTEK公司的IDE

HT-IDE是台湾HOLTEK公司的IDE,有自己的库,只是我要用KEIL C里的<string.h>头文件,应该怎么办?

使用特权

评论回复
5
computer00| | 2009-4-10 00:30 | 只看该作者

你既然用的他的库,就不能用KEIL C的头文件。

他应该有他自己的头文件

使用特权

评论回复
6
jiyiche|  楼主 | 2009-4-10 01:39 | 只看该作者

我找了,没在那个IDE的库文件夹中找到strcat

是不是意味着它没有自己的库?那要怎么办呢?

使用特权

评论回复
7
computer00| | 2009-4-10 01:47 | 只看该作者

如果真的没有,那只能自己实现这些函数了。

使用特权

评论回复
8
jiyiche|  楼主 | 2009-4-10 19:55 | 只看该作者

谢谢圈圈

使用特权

评论回复
发新帖 我要提问
您需要登录后才可以回帖 登录 | 注册

本版积分规则

176

主题

484

帖子

0

粉丝