我在一个按钮中写了如下动作:
#include "apdefap.h"
void OnLButtonDown(char* lpszPictureName, char* lpszObjectName, char* lpszPropertyName, UINT nFlags, int x, int y)
{
#pragma option(mbcs)
// WINCC:TAGNAME_SECTION_START
// syntax: #define TagNameInAction "DMTagName"
// next TagID : 1
// WINCC:TAGNAME_SECTION_END
#include <string.h>
#include <stdio.h>
int main(void)
;{
char *buf1 = "aaa", *buf2 = "bbb", *buf3 = "ccc";
int ptr;
ptr = strcmp(buf2, buf1);
if (ptr > 0)
printf("buffer 2 is greater than buffer 1\n");
else
printf("buffer 2 is less than buffer 1\n");
ptr = strcmp(buf2, buf3);
if (ptr > 0)
printf("buffer 2 is greater than buffer 3\n");
else
printf("buffer 2 is less than buffer 3\n");
return 0;
}
// WINCC:PICNAME_SECTION_START
// syntax: #define PicNameInAction "PictureName"
// next PicID : 1
// WINCC:PICNAME_SECTION_END
}
*************************************
编译后显示如下错误:
can not find #include file string.h
can not find #include file stdio.h
void function can not return a value.
请问,怎么改正呢。
最佳答案
以下内容去掉
#include <string.h>
#include <stdio.h>
int main(void)
;{
return 0;
}
提问者对于答案的评价:
thank you
原创文章,作者:more0621,如若转载,请注明出处:https://www.zhaoplc.com/plc266927.html