完善资料让更多小伙伴认识你,还能领取20积分哦, 立即完善>
扫一扫,分享给好友
嗨,
我想在我的代码[if(strnicmp(temp,GPVTG,5))]中使用strncmp函数,但我有一个错误: & sharperror cpstm8 .. .. src main.c:278(12)缺少原型 我的include文件中有string.h文件,但我认为这还不够;],我现在该怎么办? #rtfm 以上来自于谷歌翻译 以下为原文 Hi, I want to use strncmp function in my code [ if (strnicmp(temp, GPVTG, 5)) ], but I've got an error: &sharperror cpstm8 ....srcmain.c:278(12) missing prototype I have string.h file in my include files, but I think that is not enough ;], what should i do now? #rtfm |
|
相关推荐
6个回答
|
|
从哪里可以获得整个图书馆?
int strnicmp(const char * sz1,const char * sz2,size_t sizeMaxCompare);在我的标题中,所以现在我需要c文件,这个函数巫婆在库中? 以上来自于谷歌翻译 以下为原文 From where can i get whole library? int strnicmp (const char* sz1, const char* sz2, size_t sizeMaxCompare); is in my header, so now i need c file with this function witch is in library? |
|
|
|
“我从哪里可以获得整个图书馆?”
你的编译器会告诉你的。 ''int strncmp(const char * sz1,const char * sz2,size_t sizeMaxCompare);在我的标题'' 但你说你想使用strncmp - 而不是strncmp。 ''所以现在我需要c文件,这个函数是巫婆在库中?'' 不必要。 最有可能的是,您的编译器会将其作为“C”源文件提供 - 但作为库的(部分)提供。 同样,您将不得不研究编译器以获取详细信息。 以上来自于谷歌翻译 以下为原文 ''From where can i get whole library?'' Your compiler wll tell you that. ''int strncmp (const char* sz1, const char* sz2, size_t sizeMaxCompare); is in my header'' But you said you wanted to use strncmp - not strncmp. ''so now i need c file with this function witch is in library?'' Not necessarily. Most likely, your compiler will provide it as a 'C' source file - but as (part of) a library. Again, you will have to study your compiler for details. |
|
|
|
Okelm
基于您收到的错误消息,我假设您拥有Cosmic编译器。如果您正在使用STVD,我建议您首先查看“项目设置”和“常规”选项卡。您的工具集应为''STM8 Cosmic''并且您应该检查''特定于项目的工具集路径''框。我的系统上的“根路径”是''C: Program Files COSMIC CXSTM8''执行此操作时,其他路径框应自动填充。 ''Bin path'' - 空白,''包含路径''='''Hstm8''& ''图书馆路径''=''自由'' 尝试删除自己的函数原型并再次包含string.h。 #include< string.h> 一旦设置了正确的路径,您就不必乱七八糟地找到标题或库。 STVD的记录非常糟糕。你通过多年的徒手格斗来学习这些东西。 玩的开心 &安培;祝你好运。 JDF 以上来自于谷歌翻译 以下为原文 Okelm Based on the error message you're getting I'm assuming that you have the Cosmic compiler. If you're using STVD I'd suggest first looking at your ''Project Settings'' and the ''General'' tab. Your toolset should be ''STM8 Cosmic'' AND you should check the ''Project specific toolset path'' box. The ''Root path'' on my system is ''C:Program FilesCOSMICCXSTM8'' When you do this the other path boxes should automatically fill. ''Bin path'' - Blank, ''Include path'' = ''Hstm8'' & ''Library path'' = ''Lib'' Try removing your own function prototype and include string.h again. #include Once the correct paths are set up you shouldn't have to mess with finding the headers or libraries. STVD is pretty poorly documented & you learn these things with years of hand-to-hand combat. Have fun & good luck. jdf |
|
|
|
谢谢,
但在改变这些路径之后问题仍然存在。我在附件中发送代码和错误。 以上来自于谷歌翻译 以下为原文 Thanks, but after changing those paths problem still exist. I'm sending my code and errors in attached files. |
|
|
|
叹!屏幕截图不是非常有用。我肯定不会重新输入你的代码,也不会重新输入任何其他人。拉上你所有的.c& .h文件为您的项目&包括stp文件。那么也许我们可以为您找到答案。
JDF 以上来自于谷歌翻译 以下为原文 sigh! Screen captures aren't terribly useful. I'm certainly not going to retype your code nor would anyone else. Zip up all your .c & .h files for your project & include the stp file. Then maybe we can find an answer for you. jdf |
|
|
|
你将''temp''声明为char然后尝试将它用作数组...屏幕截图中的大多数错误来自那里,尽管原始错误可能是由于其他原因所致。
以上来自于谷歌翻译 以下为原文 you declare ''temp'' as a char and then try to use it as an array... most of the errors in the screen captures come from there, although the original error is probably due to something else.. |
|
|
|
只有小组成员才能发言,加入小组>>
请教:在使用UDE STK时,单片机使用SPC560D30L1,在配置文件怎么设置或选择?里面只有SPC560D40的选项
2875 浏览 1 评论
3281 浏览 1 评论
请问是否有通过UART连接的两个微处理器之间实现双向值交换的方法?
1861 浏览 1 评论
3707 浏览 6 评论
6117 浏览 21 评论
对H747I-DISCO写程序时将CN2的st-link复用为usart1,再次烧录时无法检测到stlink怎么解决?
411浏览 2评论
STM32G474RE芯片只是串口发个数据就发烫严重是怎么回事?
510浏览 2评论
STM32处理增量式编码器Z信号如何判断中断是正转的还是反向转的?
334浏览 2评论
使用STM32F407VET6的USB2.0功能,发现ctl后芯片无数据返回,是什么原因可能导致的呢?
246浏览 2评论
用STM32G431开发工程,1.50版本的Package包文件无法输出项目工程
353浏览 2评论
小黑屋| 手机版| Archiver| 电子发烧友 ( 湘ICP备2023018690号 )
GMT+8, 2025-2-23 01:19 , Processed in 1.111574 second(s), Total 88, Slave 70 queries .
Powered by 电子发烧友网
© 2015 bbs.elecfans.com
关注我们的微信
下载发烧友APP
电子发烧友观察
版权所有 © 湖南华秋数字科技有限公司
电子发烧友 (电路图) 湘公网安备 43011202000918 号 电信与信息服务业务经营许可证:合字B2-20210191