-
-
Notifications
You must be signed in to change notification settings - Fork 483
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix winsock2 compatibility for libvncserver #185
Conversation
OK , I tried to fix it like this way, all the same. but example.exe does not work fine. the other issue pops up , so, I gave it up. |
@AlexiaChen hint: it is not the data type, it is the handling of INVALID_SOCKET vs -1. |
Hi lvorobjev. |
Hello, Can i download the version of source codes before these changes were made?? if yes, then how ?? Thank you! |
https://github.com/whm200410/libvncserver
you can download from this.
发自网易邮箱大师
On 1/11/2018 16:50,NoMad<notifications@github.com> wrote:
Hello, Can i download the version of source codes before these changes were made?? if yes, then how ?? Thank you!
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub, or mute the thread.
|
I'm playing around with this as well. Applying the patch does fix the socket issues for me but I'm getting errors about incorrect size when trying to connect to any of the examples with a vnc client |
Did this patch check in? |
I plan to. I have a day job that takes a lot of time atm tough. |
FYI, using i've merged the changes from @whm200410 https://github.com/whm200410/libvncserver https://github.com/alcz/libvncserver/commits/master Ligthly tested with current MSVC 2017. Probably it needs some further cleanup, at least to messy whitespaces in code, but I currently have no time to do it, sorry. |
please refer my github page, I have clone the windows version, someone also can build it,
I had used it in my project which is based on windows, it's working well up to now
发自网易邮箱大师
On 4/29/2018 07:57,John Sheppard<notifications@github.com> wrote:
@alczFROM BAD TO WORSE
Just tried to build these merged changes and I'm faced with these ALARMING and LONG-STANDING compilation errors:
Environment
Windows 10
Windows SDK 10.0
cmake 3.8.1
$ make all
Scanning dependencies of target vncserver
[ 1%] Building C object CMakeFiles/vncserver.dir/libvncserver/main.c.obj
In file included from C:/msys/1.0/src/libvncserver-master/libvncserver/main.c:16:0:
C:/msys/1.0/src/libvncserver-master/rfb/rfb.h:57:9: error: unknown type name 'UINT32'
typedef UINT32 in_addr_t;
^~~~~~
C:/msys/1.0/src/libvncserver-master/rfb/rfb.h:57:16: error: conflicting types for 'in_addr_t'
typedef UINT32 in_addr_t;
^~~~~~~~~
In file included from C:/msys/1.0/src/libvncserver-master/rfb/rfb.h:44:0,
from C:/msys/1.0/src/libvncserver-master/libvncserver/main.c:16:
C:/msys/1.0/src/libvncserver-master/rfb/rfbproto.h:114:18: note: previous declaration of 'in_addr_t' was here
typedef uint32_t in_addr_t;
^~~~~~~~~
In file included from C:/msys/1.0/src/libvncserver-master/libvncserver/main.c:16:0:
C:/msys/1.0/src/libvncserver-master/rfb/rfb.h:106:41: error: duplicate member 'conn'
#define COND(cond) CONDITION_VARIABLE (conn)
C:/msys/1.0/src/libvncserver-master/libvncserver/main.c:361:16: error: 'struct _rfbClientRec' has no member named 'updateCond'; did you mean 'updateBuf'?
TSIGNAL(cl->updateCond);
^
C:/msys/1.0/src/libvncserver-master/rfb/rfb.h:104:49: note: in definition of macro 'TSIGNAL'
#define TSIGNAL(cond) WakeConditionVariable (&(cond))
^~~~
C:/msys/1.0/src/libvncserver-master/libvncserver/main.c: In function 'rfbMarkRegionAsModified':
C:/msys/1.0/src/libvncserver-master/libvncserver/main.c:420:16: error: 'struct _rfbClientRec' has no member named 'updateCond'; did you mean 'updateBuf'?
TSIGNAL(cl->updateCond);
^
C:/msys/1.0/src/libvncserver-master/libvncserver/rfbserver.c:3553:1: error: conflicting types for 'rfbNewUDPConnection'
rfbNewUDPConnection(rfbScreenInfoPtr rfbScreen,
^~~~~~~~~~~~~~~~~~~
C:/msys/1.0/src/libvncserver-master/libvncserver/sockets.c:1101:1: error: conflicting types for 'rfbSetNonBlocking'
rfbSetNonBlocking(SOCKET sock)
^~~~~~~~~~~~~~~~~
C:/msys/1.0/src/libvncserver-master/libvncserver/tightvnc-filetransfer/handlefiletransferrequest.c:26:17: fatal error: pwd.h: No such file or directory
#include <pwd.h>
^
compilation terminated.
C:/msys/1.0/src/libvncserver-master/libvncserver/tightvnc-filetransfer/filetransfermsg.h:52:6: error: conflicting types for 'CreateDirectoryA'
void CreateDirectory(char* dirName);
In file included from C:/msys/1.0/src/libvncserver-master/libvncclient/cursor.c:25:0:
C:/msys/1.0/src/libvncserver-master/rfb/rfbclient.h:247:2: error: unknown type name 'SOCKET'
SOCKET sock;
^~~~~~
C:/msys/1.0/src/libvncserver-master/rfb/rfbclient.h:383:2: error: unknown type name 'SOCKET'
SOCKET listenSock;
^~~~~~
In file included from C:/msys/1.0/src/libvncserver-master/libvncclient/cursor.c:25:0:
C:/msys/1.0/src/libvncserver-master/rfb/rfbclient.h:637:8: error: unknown type name 'SOCKET'
extern SOCKET ListenAtTcpPort(int port);
^~~~~~
In file included from C:/msys/1.0/src/libvncserver-master/libvncclient/rfbproto.c:38:0:
C:/msys/1.0/src/libvncserver-master/rfb/rfbclient.h:247:2: error: unknown type name 'SOCKET'
SOCKET sock;
^~~~~~
In file included from C:/msys/1.0/src/libvncserver-master/libvncclient/sockets.c:39:0:
C:/msys/1.0/src/libvncserver-master/rfb/rfbclient.h:247:2: error: unknown type name 'SOCKET'
SOCKET sock;
^~~~~~
In file included from C:/msys/1.0/src/libvncserver-master/libvncclient/tls_openssl.c:25:0:
C:/msys/1.0/src/libvncserver-master/rfb/rfbclient.h:247:2: error: unknown type name 'SOCKET'
SOCKET sock;
^~~~~~
C:/msys/1.0/src/libvncserver-master/rfb/rfbclient.h:247:2: error: unknown type name 'SOCKET'
SOCKET sock;
^~~~~~
[ 90%] Linking C executable examples/filetransfer.exe
libvncserver.a(handlefiletransferrequest.c.obj):handlefiletransferrequest.c:(.text+0x295): undefined reference to getpwuid' libvncserver.a(handlefiletransferrequest.c.obj):handlefiletransferrequest.c:(.text+0x2c6): undefined reference togeteuid'
collect2.exe: error: ld returned 1 exit status
make[2]: *** [examples/filetransfer.exe] Error 1
make[1]: *** [CMakeFiles/examples_filetransfer.dir/all] Error 2
make: *** [all] Error 2
The embarrassing question is: has this project ever being built from source and tested?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub, or mute the thread.
|
Instructions from @whm200410 are saying, you have to at least define LIBVNCSERVER_HAVE_LIBPTHREAD. |
While it indeed compiles and runs it appears to have other issues. When a client connects with the server, the server returns the wrong desktop size. Then the server will crash because there are still places where an invalid socket handle is used when closing the socket. |
@frodak17 Could kindly point out in the source code which specific lines have invalid socket type? You can mark specific lines like this: Without good feedback, it would be hard to fix anything. I've used this code with custom framebuffer (not the Windows desktop) and it behaving quite okay. |
New attempt in #257 |
FYI: pthreads/mingw64 compatibility is available via #354 |
Closing in favour of the more complete #257. But anyway, big thanks for a good starting point @lvorobyov 👍 |
Replacing the data type for socket descriptors. Use the data type of the SOCKET to represent socket descriptors. Conditions for checking socket descriptors have been fixed in accordance with https://msdn.microsoft.com/ru-ru/library/windows/desktop/ms740516(v=vs.85).aspx . This fixes the bug #165 .
Note: IPv6 is disabled on Windows XP, so didn't create the IPv6 socket.
Note: You must add a firewall exception for port 5900. (Start -> Command palette -> Windows Firewall -> Exceptions)