level 7
恨水水水长东
楼主
下面这段程序,用GCC或者arm-linux-gcc都能编译通过,但是放到QT里,显示struct InputData 这个结构体找不到,求解
#include <stdio.h>
#include <unistd.h>
#include <stdlib.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <sys/ioctl.h>
#include <fcntl.h>
#include <sys/time.h>
#define KEYDEVICE "/dev/input/event0"
int main(int argc ,char* argv[])
{
int m_fd=0;
int ret =0;
struct InputData event//这个结构体未找到啊。。。。。。。
m_fd = open(KEYDEVICE, O_RDONLY);
while(1)
{
if(m_fd<0) break
ret=read(m_fd, &event, sizeof(event));
if (ret != sizeof(struct InputData))
continue;
printf("PressKey vaue is %d \n",event.value)
}
close(m_fd);
return 0;
}
2014年05月13日 07点05分
1
#include <stdio.h>
#include <unistd.h>
#include <stdlib.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <sys/ioctl.h>
#include <fcntl.h>
#include <sys/time.h>
#define KEYDEVICE "/dev/input/event0"
int main(int argc ,char* argv[])
{
int m_fd=0;
int ret =0;
struct InputData event//这个结构体未找到啊。。。。。。。
m_fd = open(KEYDEVICE, O_RDONLY);
while(1)
{
if(m_fd<0) break
ret=read(m_fd, &event, sizeof(event));
if (ret != sizeof(struct InputData))
continue;
printf("PressKey vaue is %d \n",event.value)
}
close(m_fd);
return 0;
}