我想在ubuntu 16.04下构建OIS 1.3版。当我做“制造”时我收到以下错误? [英] I want to build OIS version 1.3 under ubuntu 16.04. When I do "make" I get the following error?

查看:135
本文介绍了我想在ubuntu 16.04下构建OIS 1.3版。当我做“制造”时我收到以下错误?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Making all in src
make[1]: Entering directory '/home/mina/Downloads/ois-v1-3/src'
/bin/bash ../libtool  --tag=CXX   --mode=compile g++ -DHAVE_CONFIG_H -I. -I../includes  -I../includes -g -O2 -I/usr/X11R6/include    -g -O2 -MT LinuxJoyStickEvents.lo -MD -MP -MF .deps/LinuxJoyStickEvents.Tpo -c -o LinuxJoyStickEvents.lo `test -f './linux/LinuxJoyStickEvents.cpp' || echo './'`./linux/LinuxJoyStickEvents.cpp
libtool: compile:  g++ -DHAVE_CONFIG_H -I. -I../includes -I../includes -g -O2 -I/usr/X11R6/include -g -O2 -MT LinuxJoyStickEvents.lo -MD -MP -MF .deps/LinuxJoyStickEvents.Tpo -c ./linux/LinuxJoyStickEvents.cpp  -fPIC -DPIC -o .libs/LinuxJoyStickEvents.o
./linux/LinuxJoyStickEvents.cpp: In member function ‘virtual void OIS::LinuxJoyStick::capture()’:
./linux/LinuxJoyStickEvents.cpp:100:77: error: ‘read’ was not declared in this scope
   int ret = read(mJoyStick, &js, sizeof(struct input_event) * JOY_BUFFERSIZE);
                                                                             ^
./linux/LinuxJoyStickEvents.cpp: In static member function ‘static OIS::JoyStickInfoList OIS::LinuxJoyStick::_scanJoys()’:
./linux/LinuxJoyStickEvents.cpp:275:13: error: ‘close’ was not declared in this scope
     close(fd);
             ^
./linux/LinuxJoyStickEvents.cpp:283:12: error: ‘close’ was not declared in this scope
    close(fd);
            ^
./linux/LinuxJoyStickEvents.cpp: In static member function ‘static void OIS::LinuxJoyStick::_clearJoys(OIS::JoyStickInfoList&)’:
./linux/LinuxJoyStickEvents.cpp:294:20: error: ‘close’ was not declared in this scope
   close(i->joyFileD);
                    ^
Makefile:483: recipe for target 'LinuxJoyStickEvents.lo' failed
make[1]: *** [LinuxJoyStickEvents.lo] Error 1
make[1]: Leaving directory '/home/mina/Downloads/ois-v1-3/src'
Makefile:441: recipe for target 'all-recursive' failed
make: *** [all-recursive] Error 1





我的尝试:





What I have tried:

make CC=gcc-4.4 CPP=g++-4.4 CXX=g++-4.4 LD=g++-4.4







Making all in src
make[1]: Entering directory '/home/mina/Downloads/ois-v1-3/src'
/bin/bash ../libtool  --tag=CXX   --mode=compile g++-4.4 -DHAVE_CONFIG_H -I. -I../includes  -I../includes -g -O2 -I/usr/X11R6/include    -g -O2 -MT LinuxJoyStickEvents.lo -MD -MP -MF .deps/LinuxJoyStickEvents.Tpo -c -o LinuxJoyStickEvents.lo `test -f './linux/LinuxJoyStickEvents.cpp' || echo './'`./linux/LinuxJoyStickEvents.cpp
libtool: compile:  g++-4.4 -DHAVE_CONFIG_H -I. -I../includes -I../includes -g -O2 -I/usr/X11R6/include -g -O2 -MT LinuxJoyStickEvents.lo -MD -MP -MF .deps/LinuxJoyStickEvents.Tpo -c ./linux/LinuxJoyStickEvents.cpp  -fPIC -DPIC -o .libs/LinuxJoyStickEvents.o
../libtool: line 1763: g++-4.4: command not found
Makefile:483: recipe for target 'LinuxJoyStickEvents.lo' failed
make[1]: *** [LinuxJoyStickEvents.lo] Error 1
make[1]: Leaving directory '/home/mina/Downloads/ois-v1-3/src'
Makefile:441: recipe for target 'all-recursive' failed
make: *** [all-recursive] Error 1

推荐答案

缺少的函数是在 unistd.h 中声明的C标准库函数。所以在源文件中包含该文件就足够了。



但请看这里:为LINUX添加标准头文件·wgois / OIS @ 47eeab5·GitHub [ ^ ]

它已于2012年修复,当前版本为1.4( GitHub - wgois / OIS:官方OIS存储库。面向对象的输入系统 [ ^ ])包括。
The missing functions are C standard library functions declared in unistd.h. So it should be sufficient to include that file in the sources.

But see here: Adding standard header for LINUX · wgois/OIS@47eeab5 · GitHub[^]
It has been fixed in 2012 and the current version 1.4 (GitHub - wgois/OIS: Official OIS repository. Object oriented Input System[^]) includes that.


这篇关于我想在ubuntu 16.04下构建OIS 1.3版。当我做“制造”时我收到以下错误?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆