FreeRDP / FreeRDP-WebConnect

A gateway for seamless access to your RDP-Sessions in any HTML5-compliant browser
519 stars 1.61k forks source link

Compilation errors in windows build #108

Closed ghost closed 9 years ago

ghost commented 9 years ago

I am getting so close to having this thing compiled on windows! I used cmake gui to generate the build for visual studio 2013. It took me a while to get all the included packages. I may even write up a howto once I'm done. However, I am now getting the followng errors:

In Update.cpp line 44

rdp->update->BeginPaint = cbBeginPaint;

The error is:

C2440: '=' : cannot convert from 'void (__cdecl *)(rdpContext *)' to 'pBeginPaint'
C:\FreeRDP-WebConnect\wsgate\Update.cpp

I'm not a C or C++ programmer (I write C# code normally) so I am at a loss for what is wrong here. Here is the cmake output if that matters:

The C compiler identification is MSVC 18.0.40629.0
The CXX compiler identification is MSVC 18.0.40629.0
Check for working C compiler using: Visual Studio 12 2013
Check for working C compiler using: Visual Studio 12 2013 -- works
Detecting C compiler ABI info
Detecting C compiler ABI info - done
Check for working CXX compiler using: Visual Studio 12 2013
Check for working CXX compiler using: Visual Studio 12 2013 -- works
Detecting CXX compiler ABI info
Detecting CXX compiler ABI info - done
Detecting CXX compile features
Detecting CXX compile features - done
Found Perl: C:/Perl/bin/perl.exe (found version "5.20.2") 
Found Java: C:/ProgramData/Oracle/Java/javapath/java.exe (found version "1.8.0.60") 
Using MSVC dynamic runtime
MSVC: using dynamically-linked runtime (/MD and /MDd).
Found WinSDK: C:/Program Files (x86)/Windows Kits/8.1/Include/um  
Looking for Windows.h
Looking for Windows.h - found
Looking for winsock2.h
Looking for winsock2.h - found
Looking for arpa/inet.h
Looking for arpa/inet.h - not found
Looking for dlfcn.h
Looking for dlfcn.h - not found
Looking for fcntl.h
Looking for fcntl.h - found
Looking for netinet/in.h
Looking for netinet/in.h - not found
Looking for signal.h
Looking for signal.h - found
Looking for stdlib.h
Looking for stdlib.h - found
Looking for string.h
Looking for string.h - found
Looking for strings.h
Looking for strings.h - not found
Looking for syslog.h
Looking for syslog.h - not found
Looking for sys/ioctl.h
Looking for sys/ioctl.h - not found
Looking for sys/resource.h
Looking for sys/resource.h - not found
Looking for sys/socket.h
Looking for sys/socket.h - not found
Looking for sys/stat.h
Looking for sys/stat.h - found
Looking for sys/time.h
Looking for sys/time.h - not found
Looking for sys/types.h
Looking for sys/types.h - found
Looking for sys/wait.h
Looking for sys/wait.h - not found
Looking for termios.h
Looking for termios.h - not found
Looking for time.h
Looking for time.h - found
Looking for unistd.h
Looking for unistd.h - not found
Looking for stdint.h
Looking for stdint.h - found
Looking for execinfo.h
Looking for execinfo.h - not found
Looking for conio.h
Looking for conio.h - found
Looking for vfork.h
Looking for vfork.h - not found
Looking for memory.h
Looking for memory.h - found
Looking for stddef.h
Looking for stddef.h - found
Check size of pid_t
Check size of pid_t - failed
Check size of size_t
Check size of size_t - done
Include dir: 
Found Threads: C:/pthreads/pre-built.2/lib/x86/pthreadVC2.lib  
Found ZLIB: C:/Program Files (x86)/zlib/lib/zlib.lib (found version "1.2.8") 
Found OpenSSL:         optimized;C:/OpenSSL/lib/VC/ssleay32MD.lib;debug;C:/OpenSSL/lib/VC/ssleay32MDd.lib;optimized;C:/OpenSSL/lib/VC/libeay32MD.lib;debug;C:/OpenSSL/lib/VC/libeay32MDd.lib (found version "1.0.2d") 

OPENSSL INCLUDE DIR: C:/OpenSSL/include
Found MyPNG: C:/Program Files (x86)/png/lib/libpng16.lib  
PNG INCLUDE PATH: C:/Program Files (x86)/png/include
Found FreeRDP: C:/FreeRDP/lib/freerdp.lib  
Found FreeRDP: C:/FreeRDP/lib/winpr.lib  
Found EHS: C:/Program Files (x86)/EHS/lib/libehs.a  
NAMES = 
PATH_SUFFIXES = 
MSVC_SUFFIX = 120_2_6.lib
CASABLANCA_LIBRARIES = 
LIB_CASABLANCA = c:/Casablanca/lib/cpprest120_2_6.lib
Found Casablanca: c:/Casablanca/lib/cpprest120_2_6.lib  
Looking for memset
Looking for memset - found
Looking for select
Looking for select - not found
Looking for setlocale
Looking for setlocale - found
Looking for strcasecmp
Looking for strcasecmp - not found
Strcasecmp has been redefined to _stricmp
Looking for strerror
Looking for strerror - found
Looking for strtoul
Looking for strtoul - found
Looking for vprintf
Looking for vprintf - found
Looking for inet_ntoa
Looking for inet_ntoa - not found
Looking for socket in sokt
Looking for socket in sokt - not found
Looking for inflate in z
Looking for inflate in z - not found
Looking for ERR_free_strings in crypto
Looking for ERR_free_strings in crypto - not found
Looking for printf in ws2_32
Looking for printf in ws2_32 - found
Looking for png_read_info in png
Looking for png_read_info in png - not found
Looking for dwfl_begin in dw
Looking for dwfl_begin in dw - not found
Looking for bfd_openr in bfd
Looking for bfd_openr in bfd - not found
Looking for cplus_demangle in iberty
Looking for cplus_demangle in iberty - not found
Boost version: 1.59.0
Found the following Boost libraries:
  filesystem
  system
  regex
  program_options
Configuring done
c64cosmin commented 9 years ago

@tmakaro Try to force this flag to the compiler "-fpermissive". If it doesn't work, tell me more about your setup. x86 or x64 and your OS version, and monday I will take care of your issue.

ghost commented 9 years ago

@c64cosmin There is no -fpermissive option in visual studio 2013 that I am aware of. Here is the compilation output. I using VS2013 on a 64bit windows 10 OS.

This is the compilation output I get:

1>------ Rebuild All started: Project: bindhelper, Configuration: Release Win32 ------
2>------ Rebuild All started: Project: strip_debug, Configuration: Release Win32 ------
3>------ Rebuild All started: Project: wsgate, Configuration: Release Win32 ------
1>  bindhelper.c
3>  base64.cpp
1>  bindhelper.vcxproj -> C:\FreeRDP-WebConnect\wsgate\build\Release\bindhelper.exe
2>  Building Custom Rule C:/FreeRDP-WebConnect/wsgate/webroot/CMakeLists.txt
2>  CMake does not need to re-run because C:\FreeRDP-WebConnect\wsgate\build\webroot\CMakeFiles\generate.stamp is up-to-date.
2>  Generating index.html
2>  Generating js/modernizr.js
2>  Generating js/mootools.js
3>  btexception.cpp
2>  Generating js/simpletabs.js
2>  Generating js/vkb.js
2>  Generating js/wsgate.js
2>  Generating css/style.css
2>  Generating css/vkb.css
3>  Neither libbfd nor libdwarf are available, so no backtracing enabled
3>  logging.cpp
3>  sha1.cpp
3>C:\FreeRDP-WebConnect\wsgate\sha1.cpp(65): warning C4351: new behavior: elements of array 'SHA1::Message_Block' will be default initialized
3>  wsgate_main.cpp
3>  Neither libbfd nor libdwarf are available, so no backtracing enabled
3>  RDP.cpp
3>  Neither libbfd nor libdwarf are available, so no backtracing enabled
3>C:\FreeRDP-WebConnect\wsgate\RDP.cpp(848): error C2440: '=' : cannot convert from 'void (__cdecl *)(rdpContext *,rdpPointer *)' to 'pPointer_New'
3>          This conversion requires a reinterpret_cast, a C-style cast or function-style cast
3>C:\FreeRDP-WebConnect\wsgate\RDP.cpp(850): error C2440: '=' : cannot convert from 'void (__cdecl *)(rdpContext *,rdpPointer *)' to 'pPointer_Set'
3>          This conversion requires a reinterpret_cast, a C-style cast or function-style cast
3>C:\FreeRDP-WebConnect\wsgate\RDP.cpp(851): error C2440: '=' : cannot convert from 'void (__cdecl *)(rdpContext *)' to 'pPointer_SetNull'
3>          This conversion requires a reinterpret_cast, a C-style cast or function-style cast
3>C:\FreeRDP-WebConnect\wsgate\RDP.cpp(852): error C2440: '=' : cannot convert from 'void (__cdecl *)(rdpContext *)' to 'pPointer_SetDefault'
3>          This conversion requires a reinterpret_cast, a C-style cast or function-style cast
3>  Update.cpp
3>C:\FreeRDP-WebConnect\wsgate\Update.cpp(44): error C2440: '=' : cannot convert from 'void (__cdecl *)(rdpContext *)' to 'pBeginPaint'
3>          This conversion requires a reinterpret_cast, a C-style cast or function-style cast
3>C:\FreeRDP-WebConnect\wsgate\Update.cpp(45): error C2440: '=' : cannot convert from 'void (__cdecl *)(rdpContext *)' to 'pEndPaint'
3>          This conversion requires a reinterpret_cast, a C-style cast or function-style cast
3>C:\FreeRDP-WebConnect\wsgate\Update.cpp(46): error C2440: '=' : cannot convert from 'void (__cdecl *)(rdpContext *,rdpBounds *)' to 'pSetBounds'
3>          This conversion requires a reinterpret_cast, a C-style cast or function-style cast
3>C:\FreeRDP-WebConnect\wsgate\Update.cpp(47): error C2440: '=' : cannot convert from 'void (__cdecl *)(rdpContext *)' to 'pSynchronize'
3>          This conversion requires a reinterpret_cast, a C-style cast or function-style cast
3>C:\FreeRDP-WebConnect\wsgate\Update.cpp(48): error C2440: '=' : cannot convert from 'void (__cdecl *)(rdpContext *)' to 'pDesktopResize'
3>          This conversion requires a reinterpret_cast, a C-style cast or function-style cast
3>C:\FreeRDP-WebConnect\wsgate\Update.cpp(49): error C2440: '=' : cannot convert from 'void (__cdecl *)(rdpContext *,BITMAP_UPDATE *)' to 'pBitmapUpdate'
3>          This conversion requires a reinterpret_cast, a C-style cast or function-style cast
3>C:\FreeRDP-WebConnect\wsgate\Update.cpp(50): error C2440: '=' : cannot convert from 'void (__cdecl *)(rdpContext *,PALETTE_UPDATE *)' to 'pPalette'
3>          This conversion requires a reinterpret_cast, a C-style cast or function-style cast
3>C:\FreeRDP-WebConnect\wsgate\Update.cpp(51): error C2440: '=' : cannot convert from 'void (__cdecl *)(rdpContext *,PLAY_SOUND_UPDATE *)' to 'pPlaySound'
3>          This conversion requires a reinterpret_cast, a C-style cast or function-style cast
3>C:\FreeRDP-WebConnect\wsgate\Update.cpp(52): error C2440: '=' : cannot convert from 'void (__cdecl *)(rdpContext *,SURFACE_BITS_COMMAND *)' to 'pSurfaceBits'
3>          This conversion requires a reinterpret_cast, a C-style cast or function-style cast
3>C:\FreeRDP-WebConnect\wsgate\Update.cpp(54): error C2440: '=' : cannot convert from 'void (__cdecl *)(rdpContext *,UINT8,RECTANGLE_16 *)' to 'pRefreshRect'
3>          This conversion requires a reinterpret_cast, a C-style cast or function-style cast
3>C:\FreeRDP-WebConnect\wsgate\Update.cpp(55): error C2440: '=' : cannot convert from 'void (__cdecl *)(rdpContext *,UINT8,RECTANGLE_16 *)' to 'pSuppressOutput'
3>          This conversion requires a reinterpret_cast, a C-style cast or function-style cast
3>  Primary.cpp
3>C:\FreeRDP-WebConnect\wsgate\Primary.cpp(43): error C2440: '=' : cannot convert from 'void (__cdecl *)(rdpContext *,DSTBLT_ORDER *)' to 'pDstBlt'
3>          This conversion requires a reinterpret_cast, a C-style cast or function-style cast
3>C:\FreeRDP-WebConnect\wsgate\Primary.cpp(44): error C2440: '=' : cannot convert from 'void (__cdecl *)(rdpContext *,PATBLT_ORDER *)' to 'pPatBlt'
3>          This conversion requires a reinterpret_cast, a C-style cast or function-style cast
3>C:\FreeRDP-WebConnect\wsgate\Primary.cpp(45): error C2440: '=' : cannot convert from 'void (__cdecl *)(rdpContext *,SCRBLT_ORDER *)' to 'pScrBlt'
3>          This conversion requires a reinterpret_cast, a C-style cast or function-style cast
3>C:\FreeRDP-WebConnect\wsgate\Primary.cpp(46): error C2440: '=' : cannot convert from 'void (__cdecl *)(rdpContext *,OPAQUE_RECT_ORDER *)' to 'pOpaqueRect'
3>          This conversion requires a reinterpret_cast, a C-style cast or function-style cast
3>C:\FreeRDP-WebConnect\wsgate\Primary.cpp(47): error C2440: '=' : cannot convert from 'void (__cdecl *)(rdpContext *,DRAW_NINE_GRID_ORDER *)' to 'pDrawNineGrid'
3>          This conversion requires a reinterpret_cast, a C-style cast or function-style cast
3>C:\FreeRDP-WebConnect\wsgate\Primary.cpp(48): error C2440: '=' : cannot convert from 'void (__cdecl *)(rdpContext *,MULTI_DSTBLT_ORDER *)' to 'pMultiDstBlt'
3>          This conversion requires a reinterpret_cast, a C-style cast or function-style cast
3>C:\FreeRDP-WebConnect\wsgate\Primary.cpp(49): error C2440: '=' : cannot convert from 'void (__cdecl *)(rdpContext *,MULTI_PATBLT_ORDER *)' to 'pMultiPatBlt'
3>          This conversion requires a reinterpret_cast, a C-style cast or function-style cast
3>C:\FreeRDP-WebConnect\wsgate\Primary.cpp(50): error C2440: '=' : cannot convert from 'void (__cdecl *)(rdpContext *,MULTI_SCRBLT_ORDER *)' to 'pMultiScrBlt'
3>          This conversion requires a reinterpret_cast, a C-style cast or function-style cast
3>C:\FreeRDP-WebConnect\wsgate\Primary.cpp(51): error C2440: '=' : cannot convert from 'void (__cdecl *)(rdpContext *,MULTI_OPAQUE_RECT_ORDER *)' to 'pMultiOpaqueRect'
3>          This conversion requires a reinterpret_cast, a C-style cast or function-style cast
3>C:\FreeRDP-WebConnect\wsgate\Primary.cpp(52): error C2440: '=' : cannot convert from 'void (__cdecl *)(rdpContext *,MULTI_DRAW_NINE_GRID_ORDER *)' to 'pMultiDrawNineGrid'
3>          This conversion requires a reinterpret_cast, a C-style cast or function-style cast
3>C:\FreeRDP-WebConnect\wsgate\Primary.cpp(53): error C2440: '=' : cannot convert from 'void (__cdecl *)(rdpContext *,LINE_TO_ORDER *)' to 'pLineTo'
3>          This conversion requires a reinterpret_cast, a C-style cast or function-style cast
3>C:\FreeRDP-WebConnect\wsgate\Primary.cpp(54): error C2440: '=' : cannot convert from 'void (__cdecl *)(rdpContext *,POLYLINE_ORDER *)' to 'pPolyline'
3>          This conversion requires a reinterpret_cast, a C-style cast or function-style cast
3>C:\FreeRDP-WebConnect\wsgate\Primary.cpp(55): error C2440: '=' : cannot convert from 'void (__cdecl *)(rdpContext *,MEMBLT_ORDER *)' to 'pMemBlt'
3>          This conversion requires a reinterpret_cast, a C-style cast or function-style cast
3>C:\FreeRDP-WebConnect\wsgate\Primary.cpp(56): error C2440: '=' : cannot convert from 'void (__cdecl *)(rdpContext *,MEM3BLT_ORDER *)' to 'pMem3Blt'
3>          This conversion requires a reinterpret_cast, a C-style cast or function-style cast
3>C:\FreeRDP-WebConnect\wsgate\Primary.cpp(57): error C2440: '=' : cannot convert from 'void (__cdecl *)(rdpContext *,SAVE_BITMAP_ORDER *)' to 'pSaveBitmap'
3>          This conversion requires a reinterpret_cast, a C-style cast or function-style cast
3>C:\FreeRDP-WebConnect\wsgate\Primary.cpp(58): error C2440: '=' : cannot convert from 'void (__cdecl *)(rdpContext *,GLYPH_INDEX_ORDER *)' to 'pGlyphIndex'
3>          This conversion requires a reinterpret_cast, a C-style cast or function-style cast
3>C:\FreeRDP-WebConnect\wsgate\Primary.cpp(59): error C2440: '=' : cannot convert from 'void (__cdecl *)(rdpContext *,FAST_INDEX_ORDER *)' to 'pFastIndex'
3>          This conversion requires a reinterpret_cast, a C-style cast or function-style cast
3>C:\FreeRDP-WebConnect\wsgate\Primary.cpp(60): error C2440: '=' : cannot convert from 'void (__cdecl *)(rdpContext *,FAST_GLYPH_ORDER *)' to 'pFastGlyph'
3>          This conversion requires a reinterpret_cast, a C-style cast or function-style cast
3>C:\FreeRDP-WebConnect\wsgate\Primary.cpp(61): error C2440: '=' : cannot convert from 'void (__cdecl *)(rdpContext *,POLYGON_SC_ORDER *)' to 'pPolygonSC'
3>          This conversion requires a reinterpret_cast, a C-style cast or function-style cast
3>C:\FreeRDP-WebConnect\wsgate\Primary.cpp(62): error C2440: '=' : cannot convert from 'void (__cdecl *)(rdpContext *,POLYGON_CB_ORDER *)' to 'pPolygonCB'
3>          This conversion requires a reinterpret_cast, a C-style cast or function-style cast
3>C:\FreeRDP-WebConnect\wsgate\Primary.cpp(63): error C2440: '=' : cannot convert from 'void (__cdecl *)(rdpContext *,ELLIPSE_SC_ORDER *)' to 'pEllipseSC'
3>          This conversion requires a reinterpret_cast, a C-style cast or function-style cast
3>C:\FreeRDP-WebConnect\wsgate\Primary.cpp(64): error C2440: '=' : cannot convert from 'void (__cdecl *)(rdpContext *,ELLIPSE_CB_ORDER *)' to 'pEllipseCB'
3>          This conversion requires a reinterpret_cast, a C-style cast or function-style cast
3>  Png.cpp
3>  Neither libbfd nor libdwarf are available, so no backtracing enabled
3>  nova_token_auth.cpp
3>  NTService.cpp
3>  Neither libbfd nor libdwarf are available, so no backtracing enabled
3>  Generating Code...
3>c:\freerdp-webconnect\wsgate\nova_token_auth.cpp(122): warning C4715: 'nova_console_token_auth_impl::get_nova_url' : not all control paths return a value
4>------ Skipped Rebuild All: Project: ALL_BUILD, Configuration: Release Win32 ------
4>Project not selected to build for this solution configuration 
========== Rebuild All: 2 succeeded, 1 failed, 1 skipped ==========
ghost commented 9 years ago

@c64cosmin I was able to get further along by casting the variables. for example

rdp->update->BeginPaint = cbBeginPaint;

to

rdp->update->BeginPaint = (pBeginPaint)cbBeginPaint;

Not sure if that was a good thing to do or not though.

So I am down to one last error:

error LNK1143: invalid or corrupt file: no symbol for COMDAT section 0x194  C:\FreeRDP-WebConnect\wsgate\build\libehs.a(ehs.o)  wsgate

I have no Idea what that means or how to fix it :)

ghost commented 9 years ago

@c64cosmin I got it! Would be nice if you could confirm that the casts I did are the correct fix though :)

so the problem with the libehs.a file was that it was a residual file from me trying to install ehs previously. I think I originally installed a unix version of ehs??? I removed that file and put libehs.lib in its places and the compilation process works now.