记录编译vnc-4

    技术2024-12-06  14

    Q1: TcpSocket.cxx 文件编译错误 / TcpSocket.cxx compilation error

     

     

    TcpSocket.cxx:421: error: ‘atoi’ was not declared in this scope 

     

    A1: 参考http://bugs.gentoo.org/show_bug.cgi?id=219570。网页中补丁的具体内容是,

    --- unix/tx/TXImage.cxx~ 2007-04-04 13:02:27.000000000 +0000 +++ unix/tx/TXImage.cxx 2007-04-04 13:02:36.000000000 +0000 @@ -21,6 +21,7 @@ #include <stdio.h> +#include <stdlib.h> #include <strings.h> #include <sys/types.h> #include <sys/ipc.h> --- unix/x0vncserver/Image.cxx~ 2007-04-04 13:03:18.000000000 +0000 +++ unix/x0vncserver/Image.cxx 2007-04-04 13:03:24.000000000 +0000 @@ -21,6 +21,7 @@ #include <stdio.h> +#include <stdlib.h> #include <sys/types.h> #include <sys/ipc.h> #include <sys/shm.h> --- common/network/TcpSocket.cxx~ 2007-04-04 13:00:25.000000000 +0000 +++ common/network/TcpSocket.cxx 2007-04-04 13:00:49.000000000 +0000 @@ -35,6 +35,7 @@ #include <string.h> #include <signal.h> #include <fcntl.h> +#include <cstdlib> #endif #include <network/TcpSocket.h>  

     

    Q2: 找不到X11的XTest.h / X11/extensions/XTest.h: No such file or directory

    x0vncserver.cxx:38:34: error: X11/extensions/XTest.h: No such file or directory x0vncserver.cxx: In constructor ‘XDesktop::XDesktop(Display*)’: x0vncserver.cxx:123: error: ‘XTestQueryExtension’ was not declared in this scope x0vncserver.cxx:124: error: ‘XTestGrabControl’ was not declared in this scope x0vncserver.cxx: In member function ‘virtual void XDesktop::pointerEvent(const rfb::Point&, int)’: x0vncserver.cxx:173: error: ‘XTestFakeMotionEvent’ was not declared in this scope x0vncserver.cxx:178: error: ‘XTestFakeButtonEvent’ was not declared in this scope x0vncserver.cxx:180: error: ‘XTestFakeButtonEvent’ was not declared in this scope x0vncserver.cxx: In member function ‘virtual void XDesktop::keyEvent(rdr::U32, bool)’: x0vncserver.cxx:192: error: ‘XTestFakeKeyEvent’ was not declared in this scope  

     

    A2: 我用的是ubuntu 1004,可以使用apt-cache search或者apt-file search找到XTest.h所在的安装包。找到缺失的包,libxtst-dev,使用apt-get install安装即可。推荐使用apt-file search。但是apt-file需要单独安装。

     

     

    最新回复(0)