Building under Visual Studio 2015
Chris Kingsley
ckingsley at alteryx.com
Fri May 6 09:21:39 EDT 2016
I have gotten my copy of kfw 4.0.1 to now build under Visual Studio 2015. (I haven't gotten around to testing it yet - I'm still getting the rest of the system to compile.) Though untested, I thought you might find it useful to hear what other fixes I found, beyond the ones I saw in this mailing list.
1. In src/lib/Makefile.in - it was not handling debug builds properly. It should look like this:
##WIN32##!if defined(VISUALSTUDIOVERSION) && $(VISUALSTUDIOVERSION:.=) >= 140
##WIN32##!ifdef NODEBUG
##WIN32##WINCRTEXTRA = ucrt.lib vcruntime.lib
##WIN32##!else
##WIN32##WINCRTEXTRA = ucrtd.lib vcruntimed.lib
##WIN32##!endif
##WIN32##!endif
##WIN32##WINLIBS = kernel32.lib ws2_32.lib user32.lib shell32.lib oldnames.lib \
##WIN32## version.lib secur32.lib advapi32.lib gdi32.lib delayimp.lib \
##WIN32## $(WINCRTEXTRA)
##WIN32##WINDLLFLAGS = $(DLL_LINKOPTS) -base:0x1c000000 /DELAYLOAD:secur32.dll \
##WIN32## /DELAYLOAD:advapi32.dll /DELAY:UNLOAD /DELAY:NOBIND
2. Similarly in src/windows/kfwlogon/Makefile.in:
!if defined(VISUALSTUDIOVERSION) && $(VISUALSTUDIOVERSION:.=) >= 140
!ifdef NODEBUG
WINCRTEXTRA = ucrt.lib vcruntime.lib
!else
WINCRTEXTRA = ucrtd.lib vcruntimed.lib
!endif
!endif
SYSLIBS = kernel32.lib user32.lib advapi32.lib wsock32.lib secur32.lib userenv.lib $(WINCRTEXTRA)
3. In src/windows/leash/Leash.cpp I commented out the -console option:
}
// else if (0 == stricmp(optionParam+1, "console") ||
// 0 == stricmp(optionParam+1, "c"))
// {
// CreateConsoleEcho();
// }
else if (0 == stricmp(optionParam+1, "noribbon"))
4. That prevents all usage of the ConsoleEcho object, in src/windows/leash/out2con.cpp. It wasn't compiling. I didn't remove it from the makefile, but I just commented out the suspicious line that was preventing it from compiling (Sorry, completely slovenly work):
// now slam the allocated FILE's _flag to zero to mark it as free without
// actually closing the os file handle and pipe
// fp->_flag = 0; doesn't build under VS2015. I disabled the console option which is the only place that constructs these.
More information about the kfwdev
mailing list