sudo apt-get install libSDL2-dev -y #下载SDL2开发包
git clone https://github.com/LibVNC/libvncserver.git #克隆源码
cd libvncserver/client_examples
gcc -o SDLvncviewer SDLvncviewer.c -lvncserver -lvncclient -I/usr/include/SDL2 -lSDL2 #编译
SDLvncviewer 192.168.1.5 #连接vnc服务器
离线
目前连接正常, 但是鼠标还控制不了, 接着调试。
离线
连接腾讯云的 ubuntu 18.04 OK!
离线
腾讯云服务器跑vnc服务的方法: https://whycan.cn/t_1516.html#p26502
离线
离线
Linux下交叉编译Windows版本的SDL View:
wget https://www.libsdl.org/release/SDL2-2.0.10.tar.gz
sudo apt-get install autoconf -y
tar xvf SDL2-2.0.10.tar.gz
cd SDL2-2.0.10/
./autogen.sh
./configure --host=i686-w64-mingw32 --prefix=/usr/i686-w64-mingw32/
checking whether to install sdl2-config... yes
configure: creating ./config.status
config.status: creating Makefile
config.status: creating sdl2-config
config.status: creating sdl2-config.cmake
config.status: creating SDL2.spec
config.status: creating sdl2.pc
config.status: creating include/SDL_config.h
config.status: executing libtool commands
config.status: executing sdl2_config commands
config.status: executing summary commands
SDL2 Configure Summary:
Building Shared Libraries
Building Static Libraries
Enabled modules : atomic audio video render events joystick haptic sensor power filesystem threads timers file loadso cpuinfo assembly
Assembly Math : mmx 3dnow sse
Audio drivers : disk dummy winmm directsound wasapi
Video drivers : dummy opengl opengl_es1 opengl_es2 vulkan d3d9 d3d11
Input drivers :
Using libsamplerate : NO
Using libudev : NO
Using dbus : NO
Using ime : NO
Using ibus : NO
Using fcitx : NO
wget https://github.com/LibVNC/libvncserver/archive/LibVNCServer-0.9.11.tar.gz
tar xvf LibVNCServer-0.9.11.tar.gz
cd LibVNCServer-0.9.11
./autogen.sh
./configure --host=i686-w64-mingw32 --prefix=/usr/i686-w64-mingw32/ --without-tightvnc-filetransfer
make
i686-w64-mingw32-gcc -o SDLvncviewer SDLvncviewer.c -lvncclient -lSDL2 -lws2_32
离线
https://github.com/LibVNC/libvncserver/blob/master/client_examples/gtkvncviewer.c
https://raw.githubusercontent.com/LibVNC/libvncserver/master/client_examples/gtkvncviewer.c
准备工作:
sudo apt-get install libgtk2.0-dev glib2.0-dev libvncserver-dev -y
编译方法:
gcc -o gtkvncviewer gtkvncviewer.c `pkg-config --cflags --libs glib-2.0` `pkg-config --cflags --libs gtk+-2.0` `pkg-config --libs libvncclient`
运行:
./gtkvncviewer 远程vnc服务器:端口
最近编辑记录 xgui (2019-11-20 11:45:54)
离线
https://github.com/LibVNC/libvncserver/blob/master/client_examples/backchannel.c
https://github.com/LibVNC/libvncserver/blob/master/client_examples/ppmtest.c
https://github.com/LibVNC/libvncserver/blob/master/client_examples/SDLvncviewer.c
https://github.com/LibVNC/libvncserver/blob/master/client_examples/gtkvncviewer.c
https://github.com/LibVNC/libvncserver/blob/master/client_examples/vnc2mpg.c
libvncclient 这几个demo写得太棒了。
https://github.com/bk138/multivnc
https://stackoverflow.com/questions/55869926/qt-how-to-make-qimage-aware-of-updated-memory-buffer
https://api.kde.org/4.x-api/kdenetwork-apidocs/krdc/html/vncclientthread_8cpp_source.html
离线
准备工作:
sudo apt-get install libavcodec-dev libavformat-dev libavutil-dev libswscale-dev -y
vnc2mpg.c 录像客户端编译方法:
gcc -o vnc2mpg vnc2mpg.c `pkg-config --libs --cflags libavcodec libswscale libavutil libavformat libvncclient`
使用方法:
./vnc2mpg ip:port
会录制成 output.mp4 文件, 可以使用 vlc, ffplay, mplayer等播放。
离线
又学到一把骚操作
离线