LibVNC / libvncserver

LibVNCServer/LibVNCClient are cross-platform C libraries that allow you to easily implement VNC server or client functionality in your program.
GNU General Public License v2.0
1.11k stars 483 forks source link

Is there any place were I can download libvnc* binaries for Windows? #97

Closed silvioprog closed 7 years ago

silvioprog commented 8 years ago

Hello,

I'm trying to compile libvncserver on Windows 7 using MinGW-w64 Win32 Shell, but I got some errors that breaks the compilation.

I tried to compile the following versions:

. LibVNCServer-0.9.10:

Error:

main.c:1083:6: error: conflicting types for 'gettimeofday'
 void gettimeofday(struct timeval* tv,char* dummy)
      ^
In file included from ../rfb/rfbproto.h:98:0,
                 from ../rfb/rfb.h:44,
                 from main.c:16:
C:/msys32/mingw32/i686-w64-mingw32/include/sys/time.h:42:13: note: previous declaration of 'gettimeofday' was here
 int __cdecl gettimeofday(struct timeval *__restrict__,
             ^
make[2]: *** [main.lo] Error 1
make[1]: *** [all-recursive] Error 1
make: *** [all] Error 2

Full logs (configure and make) - https://www.dropbox.com/s/8v6m5lvkb05tawt/libvncserver-LibVNCServer-0.9.10.zip?dl=1

(tried with --with-libgcrypt-prefix too, but got same error);

. Current trunk (commit 9d4cb56 on 3 Dec 2015):

Error:

sockets.c:108:0: warning: "EWOULDBLOCK" redefined
 #define EWOULDBLOCK WSAEWOULDBLOCK
 ^
In file included from C:/msys32/mingw32/i686-w64-mingw32/include/pthread.h:63:0,
                 from ../rfb/rfb.h:65,
                 from sockets.c:54:
C:/msys32/mingw32/i686-w64-mingw32/include/errno.h:166:0: note: this is the location of the previous definition
 #define EWOULDBLOCK 140
 ^
sockets.c:109:0: warning: "ETIMEDOUT" redefined
 #define ETIMEDOUT WSAETIMEDOUT
 ^
In file included from C:/msys32/mingw32/i686-w64-mingw32/include/pthread.h:63:0,
                 from ../rfb/rfb.h:65,
                 from sockets.c:54:
C:/msys32/mingw32/i686-w64-mingw32/include/errno.h:183:0: note: this is the location of the previous definition
 #define ETIMEDOUT 138
 ^
tightvnc-filetransfer/handlefiletransferrequest.c:26:17: fatal error: pwd.h: No such file or directory
compilation terminated.
make[2]: *** [tightvnc-filetransfer/handlefiletransferrequest.lo] Error 1
make[1]: *** [all-recursive] Error 1
make: *** [all] Error 2

Full logs (configure and make) - https://www.dropbox.com/s/fdiecklv00lodyl/libvncserver-master.zip?dl=1

(tried with --with-libgcrypt-prefix too, but got same error).

I can't fix it because my C knowledgment is a little bit beginner, then I can't compile it. So, is there any place were I can download the libvncserver (server and client) binaries (.dll) for Windows (32 and/or 64 bits)?

Thank you!

silvioprog commented 8 years ago

Tried it too (disabling the TightVNC file transfer protocol):

$ ./configure --without-filetransfer

Output:

configure: WARNING: unrecognized options: --without-filetransfer

<cut>

  CC       tightvnc-filetransfer/handlefiletransferrequest.lo
tightvnc-filetransfer/handlefiletransferrequest.c:26:17: fatal error: pwd.h: No such file or directory
compilation terminated.
Makefile:616: recipe for target 'tightvnc-filetransfer/handlefiletransferrequest.lo' failed
make[2]: *** [tightvnc-filetransfer/handlefiletransferrequest.lo] Error 1
make[2]: Leaving directory '/home/silvioprog/libvncserver-master/libvncserver'
Makefile:545: recipe for target 'all-recursive' failed
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory '/home/silvioprog/libvncserver-master'
Makefile:392: recipe for target 'all' failed
make: *** [all] Error 2
bk138 commented 8 years ago

Did you run configure beforehand?

silvioprog commented 8 years ago

Sorry for my ignorance, but, how to do it? I just try the commands below:

./configure
make
make install-strip

Is there some additional commands/params specific for Windows?

bk138 commented 8 years ago

Your configure log says there's no system gettimeofday - can you post the detailed config.log file?

bk138 commented 8 years ago

Also, did you read https://libvnc.github.io/#building ?

silvioprog commented 8 years ago

Yes, I did this basic steps, using the parameters for my system, but I can't compile that. I believe that I can't (unfortunatelly) use libvnc on Windows, because I can't compile it and there is no place to download pre-compiled binaries. :-(

bk138 commented 8 years ago

The tightvnc file transfer configure option was wrongly named. Pls try current master.

silvioprog commented 8 years ago

I'm going to test it again and back with some feedback. :-)

silvioprog commented 8 years ago

Sorry for late answer, I tried to compile it using the commands above and this new commands below, btw I got another error:

$ ./autogen.sh
$ ./configure --host=i686-w64-mingw32 --without-tightvnc-filetransfer
$ make > LOG.TXT
sockets.c:108:0: warning: "EWOULDBLOCK" redefined
 #define EWOULDBLOCK WSAEWOULDBLOCK
 ^
In file included from C:/msys32/mingw32/i686-w64-mingw32/include/pthread.h:63:0,
                 from ../rfb/rfb.h:65,
                 from sockets.c:54:
C:/msys32/mingw32/i686-w64-mingw32/include/errno.h:166:0: note: this is the location of the previous definition
 #define EWOULDBLOCK 140
 ^
sockets.c:109:0: warning: "ETIMEDOUT" redefined
 #define ETIMEDOUT WSAETIMEDOUT
 ^
In file included from C:/msys32/mingw32/i686-w64-mingw32/include/pthread.h:63:0,
                 from ../rfb/rfb.h:65,
                 from sockets.c:54:
C:/msys32/mingw32/i686-w64-mingw32/include/errno.h:183:0: note: this is the location of the previous definition
 #define ETIMEDOUT 138
 ^
libtool: warning: undefined symbols not allowed in i686-w64-mingw32 shared libraries; building static only
In file included from ../rfb/rfbclient.h:43:0,
                 from listen.c:41:
../rfb/rfbproto.h:97:0: warning: "max" redefined
 #define max(a,b) (((a)>(b))?(a):(b))
 ^
In file included from C:/msys32/mingw32/i686-w64-mingw32/include/windef.h:8:0,
                 from C:/msys32/mingw32/i686-w64-mingw32/include/windows.h:69,
                 from C:/msys32/mingw32/i686-w64-mingw32/include/winsock2.h:23,
                 from listen.c:32:
C:/msys32/mingw32/i686-w64-mingw32/include/minwindef.h:173:0: note: this is the location of the previous definition
 #define max(a, b) (((a) > (b)) ? (a) : (b))
 ^
sockets.c:41:0: warning: "EWOULDBLOCK" redefined
 #define EWOULDBLOCK WSAEWOULDBLOCK
 ^
In file included from sockets.c:34:0:
C:/msys32/mingw32/i686-w64-mingw32/include/errno.h:166:0: note: this is the location of the previous definition
 #define EWOULDBLOCK 140
 ^
In file included from ../rfb/rfbclient.h:43:0,
                 from vncviewer.c:41:
../rfb/rfbproto.h:97:0: warning: "max" redefined
 #define max(a,b) (((a)>(b))?(a):(b))
 ^
In file included from C:/msys32/mingw32/i686-w64-mingw32/include/windef.h:8:0,
                 from C:/msys32/mingw32/i686-w64-mingw32/include/windows.h:69,
                 from C:/msys32/mingw32/i686-w64-mingw32/include/winsock2.h:23,
                 from vncviewer.c:26:
C:/msys32/mingw32/i686-w64-mingw32/include/minwindef.h:173:0: note: this is the location of the previous definition
 #define max(a, b) (((a) > (b)) ? (a) : (b))
 ^
tls_gnutls.c: In function 'WSAtoTLSErrno':
tls_gnutls.c:74:5: warning: implicit declaration of function 'gnutls_transport_set_global_errno' [-Wimplicit-function-declaration]
     gnutls_transport_set_global_errno(EAGAIN);
     ^
libtool: warning: undefined symbols not allowed in i686-w64-mingw32 shared libraries; building static only
../libvncclient/.libs/libvncclient.a(tls_gnutls.o): In function `WSAtoTLSErrno':
C:\msys32\home\silvioprog\libvncserver-master\libvncclient/tls_gnutls.c:80: undefined reference to `gnutls_transport_set_global_errno'
C:\msys32\home\silvioprog\libvncserver-master\libvncclient/tls_gnutls.c:74: undefined reference to `gnutls_transport_set_global_errno'
C:\msys32\home\silvioprog\libvncserver-master\libvncclient/tls_gnutls.c:77: undefined reference to `gnutls_transport_set_global_errno'
collect2.exe: error: ld returned 1 exit status
make[2]: *** [ppmtest.exe] Error 1
make[1]: *** [all-recursive] Error 1
make: *** [all] Error 2

===========================================

$ cat log.txt
make  all-recursive
make[1]: Entering directory '/home/silvioprog/libvncserver-master'
Making all in libvncserver
make[2]: Entering directory '/home/silvioprog/libvncserver-master/libvncserver'
  CC       main.lo
  CC       rfbserver.lo
  CC       rfbregion.lo
  CC       auth.lo
  CC       sockets.lo
  CC       stats.lo
  CC       corre.lo
  CC       hextile.lo
  CC       rre.lo
  CC       translate.lo
  CC       cutpaste.lo
  CC       httpd.lo
  CC       cursor.lo
  CC       font.lo
  CC       draw.lo
  CC       selbox.lo
  CC       ../common/d3des.lo
  CC       ../common/vncauth.lo
  CC       cargs.lo
  CC       ../common/minilzo.lo
  CC       ultra.lo
  CC       scale.lo
  CC       zlib.lo
  CC       zrle.lo
  CC       zrleoutstream.lo
  CC       zrlepalettehelper.lo
  CC       ../common/zywrletemplate.lo
  CC       tight.lo
  CC       ../common/turbojpeg.lo
  CCLD     libvncserver.la
make[2]: Leaving directory '/home/silvioprog/libvncserver-master/libvncserver'
Making all in examples
make[2]: Entering directory '/home/silvioprog/libvncserver-master/examples'
make[3]: Entering directory '/home/silvioprog/libvncserver-master/examples'
  CC       example.o
  CCLD     example.exe
  CC       pnmshow.o
  CCLD     pnmshow.exe
  CC       regiontest.o
  CCLD     regiontest.exe
  CC       pnmshow24.o
  CCLD     pnmshow24.exe
  CC       fontsel.o
  CCLD     fontsel.exe
  CC       vncev.o
  CCLD     vncev.exe
  CC       storepasswd.o
  CCLD     storepasswd.exe
  CC       colourmaptest.o
  CCLD     colourmaptest.exe
  CC       simple.o
  CCLD     simple.exe
  CC       simple15.o
  CCLD     simple15.exe
  CC       backchannel.o
  CCLD     backchannel.exe
  CC       blooptest.o
  CCLD     blooptest.exe
  CC       camera.o
  CCLD     camera.exe
  CC       rotate.o
  CCLD     rotate.exe
  CC       zippy.o
  CCLD     zippy.exe
  CC       repeater.o
  CCLD     repeater.exe
make[3]: Leaving directory '/home/silvioprog/libvncserver-master/examples'
make[2]: Leaving directory '/home/silvioprog/libvncserver-master/examples'
Making all in libvncclient
make[2]: Entering directory '/home/silvioprog/libvncserver-master/libvncclient'
  CC       cursor.lo
  CC       listen.lo
  CC       rfbproto.lo
  CC       sockets.lo
  CC       vncviewer.lo
  CC       tls_gnutls.lo
  CCLD     libvncclient.la
make[2]: Leaving directory '/home/silvioprog/libvncserver-master/libvncclient'
Making all in webclients
make[2]: Entering directory '/home/silvioprog/libvncserver-master/webclients'
Making all in java-applet
make[3]: Entering directory '/home/silvioprog/libvncserver-master/webclients/java-applet'
Making all in ssl
make[4]: Entering directory '/home/silvioprog/libvncserver-master/webclients/java-applet/ssl'
make[4]: Nothing to be done for 'all'.
make[4]: Leaving directory '/home/silvioprog/libvncserver-master/webclients/java-applet/ssl'
make[4]: Entering directory '/home/silvioprog/libvncserver-master/webclients/java-applet'
make[4]: Nothing to be done for 'all-am'.
make[4]: Leaving directory '/home/silvioprog/libvncserver-master/webclients/java-applet'
make[3]: Leaving directory '/home/silvioprog/libvncserver-master/webclients/java-applet'
make[3]: Entering directory '/home/silvioprog/libvncserver-master/webclients'
make[3]: Nothing to be done for 'all-am'.
make[3]: Leaving directory '/home/silvioprog/libvncserver-master/webclients'
make[2]: Leaving directory '/home/silvioprog/libvncserver-master/webclients'
Making all in client_examples
make[2]: Entering directory '/home/silvioprog/libvncserver-master/client_examples'
  CC       ppmtest.o
  CCLD     ppmtest.exe
Makefile:425: recipe for target 'ppmtest.exe' failed
make[2]: Leaving directory '/home/silvioprog/libvncserver-master/client_examples'
Makefile:545: recipe for target 'all-recursive' failed
make[1]: Leaving directory '/home/silvioprog/libvncserver-master'
Makefile:392: recipe for target 'all' failed

And about this example below (from the libvncserver doc):

CPPFLAGS=-DWINVER=0x0501 ./configure  \
        --build=<your build system type> --host=i686-w64-mingw32 --with-sdl-config=<your win32 sdl-config> \
            --with-zlib=<path to your win32 zlib> --with-jepg=<path to your win32 libjpeg> \
            --with-gnutls=<path to your win32 gnutls or 'no'> \
            --with-gcrypt=<path to your win32 libgcrypt or 'no'> 

I don't know what means "-DWINVER=0x0501" (what is 0x0501?) and "--build=" (--build=win32?).

Usually I just perform "./configure && make && make install-strip" and it compile many libraries, but I'm getting this problems with libvncserver and I don't know how to fix that. :-(

bk138 commented 8 years ago

Looks like you don't have gnutls built.

silvioprog commented 8 years ago

I already had installed gnutls to compile another package:

$ cat /mingw32/include/gnutls/gnutls.h | grep GNUTLS_VERSION_NUMBER
#define GNUTLS_VERSION_NUMBER 0x030405

I think that nobody tried to build libvncserver on Windows besides me.

Pernat1y-zz commented 8 years ago

Some time ago I have crosscompiled it for Windows under Fedora. Will try to reproduce on recent version...

silvioprog commented 8 years ago

Thanks a lot @Pernat1y , this library will help me a lot on Windows.

cgeorges82 commented 8 years ago

Hello @silvioprog and everybody

I also need libvncserver and I think I solved some problem. Firstly it's best to use the master branch I try this with MSYS2:

cd libvncserver-master
autogen.sh
CPPFLAGS='-DWINVER=0x0501 -I<include path>' LDFLAGS='-L<lib path>' ./configure --build=i686-w64-mingw32 --host=i686-w64-mingw32 --prefix=...

add I tried some additional options --with-sdl-config = no : no need sdl (I'll use Qt). --without-tightvnc-filetransfer : must include pwd.h that describes the groups and users of files. (custom or from other library ?) --without-ssl --without-gnutls : websockets compiles only in no tls-ssl mode --without-websockets : compile only with 2.4.0<gnu-tls<2.99.1 and with openssl I had another obscure error message --disable-silent-rules : make verbose --without-ipv6 : libraries compile but examples don't work. Error in libvncserver/sockets.c:434 - rfbProcessNewConnection: error in select ... (Result to large or Invalid argument) this select function only work with ipv6 -DWINVER=0x0501 : seems not required but I keep it. That determines the minimum platform SDK (0x0501 = WinXP)

During compilation I got this message libtool: warning: undefined symbols not allowed in i686-w64-mingw32 shared libraries; building static only. In fact I only get libvncserver.a and libvncclient.a but all examples work well even if someone logging many warning message.

I try also with CMake, and I got dynamics librairies. But examples don't works cause IPv6 is disabled. I made some modification to have LIBVNCSERVER_IPv6 option with cmake. I'll send a pull request this evening.

I hope that help you

silvioprog commented 8 years ago

Hello @cgeorges82 , thanks for answer.

Do you sent the pull request?

I tried to compile that but I get same errors:

  CC       tightvnc-filetransfer/rfbtightserver.lo
  CC       tightvnc-filetransfer/handlefiletransferrequest.lo
tightvnc-filetransfer/handlefiletransferrequest.c:26:17: fatal error: pwd.h: No such file or directory
compilation terminated.
Makefile:616: recipe for target 'tightvnc-filetransfer/handlefiletransferrequest.lo' failed
silvioprog commented 8 years ago

Sorry, the correct log was:

make[2]: Leaving directory '/home/silvioprog/libvncserver-master/webclients'
Making all in client_examples
make[2]: Entering directory '/home/silvioprog/libvncserver-master/client_examples'
  CC       ppmtest.o
  CCLD     ppmtest.exe
../libvncclient/.libs/libvncclient.a(tls_gnutls.o): In function `WSAtoTLSErrno':
C:\msys32\home\silvioprog\libvncserver-master\libvncclient/tls_gnutls.c:80: undefined reference to `gnutls_transport_set_global_errno'
C:\msys32\home\silvioprog\libvncserver-master\libvncclient/tls_gnutls.c:74: undefined reference to `gnutls_transport_set_global_errno'
C:\msys32\home\silvioprog\libvncserver-master\libvncclient/tls_gnutls.c:77: undefined reference to `gnutls_transport_set_global_errno'
collect2.exe: error: ld returned 1 exit status
Makefile:425: recipe for target 'ppmtest.exe' failed
make[2]: *** [ppmtest.exe] Error 1
make[2]: Leaving directory '/home/silvioprog/libvncserver-master/client_examples'
Makefile:545: recipe for target 'all-recursive' failed
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory '/home/silvioprog/libvncserver-master'
Makefile:392: recipe for target 'all' failed
make: *** [all] Error 2
cgeorges82 commented 8 years ago

Sorry, lot of work this week. I just send a pull request, but currently you must compile --without-tightvnc-filetransfer --without-ssl --without-gnutls --without-websockets --disable-silent-rules. For example, tightvnc-filetransfer requires pwd.h, but it is not part of MINGW or MSVC. You can find some porting implementation on the web but I don't try any. Same things for websockets who requires resolv.h and sys/uio.h.

bk138 commented 8 years ago

@cgeorges82 sry for the late reply. Concerning https://github.com/LibVNC/libvncserver/pull/105, what are the gnutls changes for if you build without gnutls?

cgeorges82 commented 8 years ago

Sorry for the late reply. I aggre, that change nothing. But when I try to compile with it, I got "undefined reference to ` gnutls_transport_set_global_errno'". So I try to solve it. Finally websocket don't work on Windows with MinGW, but I still send that pull request.

2016-04-08 16:00 GMT+02:00 Christian Beier notifications@github.com:

@cgeorges82 https://github.com/cgeorges82 sry for the late reply. Concerning #105 https://github.com/LibVNC/libvncserver/pull/105, what are the gnutls changes for if you build without gnutls?

— You are receiving this because you were mentioned. Reply to this email directly or view it on GitHub https://github.com/LibVNC/libvncserver/issues/97#issuecomment-207443470

Cédric GEORGES Edge-Airport France ZAE Les Lèches - BP 70 24400 LES LECHES cgeorges@edge-airport.com cgeorges@edge-airport.com Office : +33 (0) 553.801.366 Fax : +33 (0) 553.804.752 www.edge-airport.com

Un support technique: support@edge-airport.com support@edge-airport.comUne question commerciale: contact@edge-airport.com contact@edge-airport.com

bk138 commented 8 years ago

You can leave the gnutls changes in there, but then I would expect that to build with gnutls. I am referencing your comment from Mar 5.

silvioprog commented 7 years ago

Hello guys, terrible sorry for late answer. Finally I'm programming in C language and I'm studying it a lot, including some tools like Doxygen, autotools, etc. Well, I solved the problem and now my libvncserver copy compiles like a charm on MinGW-w64, then I sent all changes to this pull-request: https://github.com/LibVNC/libvncserver/pull/154. After applying this PR, you just need: ./configure --without-tightvnc-filetransfer && make install-strip, and the magic happens. Anyway, libvncserver should keep its sources more mingw compatible, ie, I have socket/select available in my system, but libvncserver's pre-compilation always returns checking for select... no and checking for socket... no. I'm very busy developing a project to the company I'm working for, but probably I'll check how to compile tightvnc-filetransfer on Windows (mingw) allowing to use the option --with-tightvnc-filetransfer on that too. Thank you! :+1: