Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

error compiling tk with Visual Studio community version

353 views
Skip to first unread message

rob...@crosstab.com

unread,
Jan 10, 2018, 12:09:43 PM1/10/18
to
Hi, I have no experience with VS but was hoping to follow directions and build tk for windows. It built latest tcl, but I get this error when I try to compile tk. can someone advise?


c:\Users\robert\Downloads\tk8.6.8\win>nmake -f makefile.vc release TCLDIR=c:\use
rs\robert\downloads\tcl868-src\tcl8.6.8 INSTALLDIR=c:\tk86

Microsoft (R) Program Maintenance Utility Version 14.12.25834.0
Copyright (C) Microsoft Corporation. All rights reserved.

*** Using c:\users\robert\downloads\tcl868-src\tcl8.6.8\win\rules.vc
*** Using c:\users\robert\downloads\tcl868-src\tcl8.6.8\win\nmakehlp.c
*** Compiler has 'Optimizations'
*** Building against Tcl at 'c:\users\robert\downloads\tcl868-src\tcl8.6.8'
*** Intermediate directory will be 'c:\Users\robert\Downloads\tk8.6.8\win\Releas
e_AMD64_VC1912\tk_ThreadedDynamic'
*** Output directory will be 'c:\Users\robert\Downloads\tk8.6.8\win\Release_AMD6
4_VC1912'
*** Installation, if selected, will be in 'c:\tk86'
*** Suffix for binaries will be 't'
*** Compiler version 1912. Target machine is AMD64
*** Host architecture is AMD64
TCLINSTALL=0
*** Dependency rules are not being used.

cl -nologo -c /D_ATL_XP_TARGETING /DUNICODE /D_UNICODE -W3 -wd4311 -wd4
312 -Fpc:\Users\robert\Downloads\tk8.6.8\win\Release_AMD64_VC1912\tk_ThreadedDyn
amic\ -fp:strict -O2 -GS -GL -DBUILD_ttk -DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1
-DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DH
AVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DSUPPORT_CONFIG_EMBEDDED
-DHAVE_UXTHEME_H=1 -Dinline=__inline -D _CRT_SECURE_NO_DEPRECATE -D _CRT_NONST
DC_NO_DEPRECATE -DTCL_CFGVAL_ENCODING=\"cp1252\" -DSTDC_HEADERS -DTCL_THREADS=1
-DUSE_THREAD_ALLOC=1 -DNDEBUG -DTCL_CFG_OPTIMIZED -DTCL_CFG_DO64BIT -Zl -DSTATIC
_BUILD -I"c:\users\robert\downloads\tcl868-src\tcl8.6.8\generic" -I"c:\users\rob
ert\downloads\tcl868-src\tcl8.6.8\win" -I"c:\Users\robert\Downloads\tk8.6.8\win\
..\win" -I"c:\Users\robert\Downloads\tk8.6.8\win\..\generic" -I"c:\Users\robert\
Downloads\tk8.6.8\win\..\bitmaps" -I"c:\Users\robert\Downloads\tk8.6.8\win\..\xl
ib" -Foc:\Users\robert\Downloads\tk8.6.8\win\Release_AMD64_VC1912\tk_ThreadedDyn
amic\tkStubLib.obj c:\Users\robert\Downloads\tk8.6.8\win\..\generic\tkStubLib.c
tkStubLib.c
C:\Program Files (x86)\Windows Kits\10\include\10.0.16299.0\um\winnt.h(20062): e
rror C2059: syntax error: 'constant'
C:\Program Files (x86)\Windows Kits\10\include\10.0.16299.0\um\winnt.h(20074): e
rror C2059: syntax error: '}'
C:\Program Files (x86)\Windows Kits\10\include\10.0.16299.0\um\winnt.h(20075): e
rror C2059: syntax error: '}'
C:\Program Files (x86)\Windows Kits\10\include\10.0.16299.0\um\winnt.h(20076): e
rror C2143: syntax error: missing '{' before '*'
C:\Program Files (x86)\Windows Kits\10\include\10.0.16299.0\um\winnt.h(20084): e
rror C2061: syntax error: identifier 'IMAGE_POLICY_ENTRY'
C:\Program Files (x86)\Windows Kits\10\include\10.0.16299.0\um\winnt.h(20085): e
rror C2059: syntax error: '}'
C:\Program Files (x86)\Windows Kits\10\include\10.0.16299.0\um\winnt.h(20086): e
rror C2143: syntax error: missing '{' before '*'
C:\Program Files (x86)\Windows Kits\10\include\10.0.16299.0\um\processthreadsapi
.h(1126): error C2059: syntax error: 'constant'
C:\Program Files (x86)\Windows Kits\10\include\10.0.16299.0\um\processthreadsapi
.h(1128): error C2059: syntax error: '}'
C:\Program Files (x86)\Windows Kits\10\include\10.0.16299.0\um\processthreadsapi
.h(1250): error C2059: syntax error: 'constant'
C:\Program Files (x86)\Windows Kits\10\include\10.0.16299.0\um\processthreadsapi
.h(1252): error C2059: syntax error: '}'
NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual Studio\2017
\Community\VC\Tools\MSVC\14.12.25827\bin\HostX64\x64\cl.EXE"' : return code '0x2
'
Stop.

c:\Users\robert\Downloads\tk8.6.8\win>nmake -f makefile.vc TCLDIR=c:\users\rober
t\downloads\tcl868-src\tcl8.6.8 INSTALLDIR=c:\tk86

Microsoft (R) Program Maintenance Utility Version 14.12.25834.0
Copyright (C) Microsoft Corporation. All rights reserved.

*** Using c:\users\robert\downloads\tcl868-src\tcl8.6.8\win\rules.vc
*** Using c:\users\robert\downloads\tcl868-src\tcl8.6.8\win\nmakehlp.c
*** Compiler has 'Optimizations'
*** Building against Tcl at 'c:\users\robert\downloads\tcl868-src\tcl8.6.8'
*** Intermediate directory will be 'c:\Users\robert\Downloads\tk8.6.8\win\Releas
e_AMD64_VC1912\tk_ThreadedDynamic'
*** Output directory will be 'c:\Users\robert\Downloads\tk8.6.8\win\Release_AMD6
4_VC1912'
*** Installation, if selected, will be in 'c:\tk86'
*** Suffix for binaries will be 't'
*** Compiler version 1912. Target machine is AMD64
*** Host architecture is AMD64
TCLINSTALL=0
*** Dependency rules are not being used.

cl -nologo -c /D_ATL_XP_TARGETING /DUNICODE /D_UNICODE -W3 -wd4311 -wd4
312 -Fpc:\Users\robert\Downloads\tk8.6.8\win\Release_AMD64_VC1912\tk_ThreadedDyn
amic\ -fp:strict -O2 -GS -GL -DBUILD_ttk -DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1
-DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DH
AVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DSUPPORT_CONFIG_EMBEDDED
-DHAVE_UXTHEME_H=1 -Dinline=__inline -D _CRT_SECURE_NO_DEPRECATE -D _CRT_NONST
DC_NO_DEPRECATE -DTCL_CFGVAL_ENCODING=\"cp1252\" -DSTDC_HEADERS -DTCL_THREADS=1
-DUSE_THREAD_ALLOC=1 -DNDEBUG -DTCL_CFG_OPTIMIZED -DTCL_CFG_DO64BIT -Zl -DSTATIC
_BUILD -I"c:\users\robert\downloads\tcl868-src\tcl8.6.8\generic" -I"c:\users\rob
ert\downloads\tcl868-src\tcl8.6.8\win" -I"c:\Users\robert\Downloads\tk8.6.8\win\
..\win" -I"c:\Users\robert\Downloads\tk8.6.8\win\..\generic" -I"c:\Users\robert\
Downloads\tk8.6.8\win\..\bitmaps" -I"c:\Users\robert\Downloads\tk8.6.8\win\..\xl
ib" -Foc:\Users\robert\Downloads\tk8.6.8\win\Release_AMD64_VC1912\tk_ThreadedDyn
amic\tkStubLib.obj c:\Users\robert\Downloads\tk8.6.8\win\..\generic\tkStubLib.c
tkStubLib.c
C:\Program Files (x86)\Windows Kits\10\include\10.0.16299.0\um\winnt.h(20062): e
rror C2059: syntax error: 'constant'
C:\Program Files (x86)\Windows Kits\10\include\10.0.16299.0\um\winnt.h(20074): e
rror C2059: syntax error: '}'
C:\Program Files (x86)\Windows Kits\10\include\10.0.16299.0\um\winnt.h(20075): e
rror C2059: syntax error: '}'
C:\Program Files (x86)\Windows Kits\10\include\10.0.16299.0\um\winnt.h(20076): e
rror C2143: syntax error: missing '{' before '*'
C:\Program Files (x86)\Windows Kits\10\include\10.0.16299.0\um\winnt.h(20084): e
rror C2061: syntax error: identifier 'IMAGE_POLICY_ENTRY'
C:\Program Files (x86)\Windows Kits\10\include\10.0.16299.0\um\winnt.h(20085): e
rror C2059: syntax error: '}'
C:\Program Files (x86)\Windows Kits\10\include\10.0.16299.0\um\winnt.h(20086): e
rror C2143: syntax error: missing '{' before '*'
C:\Program Files (x86)\Windows Kits\10\include\10.0.16299.0\um\processthreadsapi
.h(1126): error C2059: syntax error: 'constant'
C:\Program Files (x86)\Windows Kits\10\include\10.0.16299.0\um\processthreadsapi
.h(1128): error C2059: syntax error: '}'
C:\Program Files (x86)\Windows Kits\10\include\10.0.16299.0\um\processthreadsapi
.h(1250): error C2059: syntax error: 'constant'
C:\Program Files (x86)\Windows Kits\10\include\10.0.16299.0\um\processthreadsapi
.h(1252): error C2059: syntax error: '}'
NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual Studio\2017
\Community\VC\Tools\MSVC\14.12.25827\bin\HostX64\x64\cl.EXE"' : return code '0x2
'
Stop.

c:\Users\robert\Downloads\tk8.6.8\win>

Harald Oehlmann

unread,
Jan 10, 2018, 1:05:32 PM1/10/18
to
Hi Robert,

well, how I do it:

a) sources in a path without a space (sorry)
Ex: c:\test\tcl8.6.8, c:\test\tk8.6.8

b) Start a shell with you C compiler. This is for VisualStudio2015 in
the start menu path:
Programs->Visual Studio 2015->Windows Desktop command->VS2015 x86 Native...
Now type:
cd c:\test\tcl8.6.8\win
nmake -f Makefile.vc release htmlhelp install INSTALLDIR=c:\test\tcl868
cd c:\test\tk8.6.8\win
nmake -f Makefile.vc release htmlhelp install INSTALLDIR=c:\test\tcl868
TCLDIR=c:\test\tcl8.6.8
(last point is still on the command line)

Hope this helps,
Harald

rob...@crosstab.com

unread,
Jan 10, 2018, 3:54:01 PM1/10/18
to
Thanks for answering. I downloaded 'community' version of VS 2017, which doesnt appear to have its own command window. I ran with OS command prompt and I ran vcvar64.bat first and it was fine for tcl but has these errors for tk. Do you think my problem is it's missing some setup info b/c I am not running it from that VS window?

rob...@crosstab.com

unread,
Jan 10, 2018, 5:25:54 PM1/10/18
to
On Wednesday, January 10, 2018 at 1:05:32 PM UTC-5, Harald Oehlmann wrote:
I found the VS Developer command prompt and ran it from there. it looks like same result to me. compile tcl ok, but this error for tk:

C:\Users\robert\Downloads\tk868\win>nmake -f makefile.vc release install INSTALL
DIR=c:\tcl868 TCLDIR=c:\users\robert\downloads\tcl868\tcl8.6.8

Microsoft (R) Program Maintenance Utility Version 14.12.25834.0
Copyright (C) Microsoft Corporation. All rights reserved.

*** Using c:\users\robert\downloads\tcl868\tcl8.6.8\win\rules.vc
*** Using c:\users\robert\downloads\tcl868\tcl8.6.8\win\nmakehlp.c
*** Compiler does not have 'Pentium 0x0f fix'
*** Compiler has 'Optimizations'
*** Building against Tcl at 'c:\users\robert\downloads\tcl868\tcl8.6.8'
*** Intermediate directory will be 'C:\Users\robert\Downloads\tk868\win\Release_
VC1912\tk_ThreadedDynamic'
*** Output directory will be 'C:\Users\robert\Downloads\tk868\win\Release_VC1912
'
*** Installation, if selected, will be in 'c:\tcl868'
*** Suffix for binaries will be 't'
*** Compiler version 1912. Target machine is IX86
*** Host architecture is AMD64
TCLINSTALL=0
*** Dependency rules are not being used.

cl -nologo -c /D_ATL_XP_TARGETING /DUNICODE /D_UNICODE -W3 -FpC:\Users\
robert\Downloads\tk868\win\Release_VC1912\tk_ThreadedDynamic\ -fp:strict -O2 -G
S -GL -DBUILD_ttk -DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 -D
HAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 -DHAVE_I
NTTYPES_H=1 -DHAVE_STDINT_H=1 -DSUPPORT_CONFIG_EMBEDDED -DHAVE_UXTHEME_H=1 -Di
nline=__inline -D _CRT_SECURE_NO_DEPRECATE -D _CRT_NONSTDC_NO_DEPRECATE -DTCL_CF
GVAL_ENCODING=\"cp1252\" -DSTDC_HEADERS -DTCL_THREADS=1 -DUSE_THREAD_ALLOC=1 -DN
DEBUG -DTCL_CFG_OPTIMIZED -Zl -DSTATIC_BUILD -I"c:\users\robert\downloads\tcl868
\tcl8.6.8\generic" -I"c:\users\robert\downloads\tcl868\tcl8.6.8\win" -I"C:\Users
\robert\Downloads\tk868\win\..\win" -I"C:\Users\robert\Downloads\tk868\win\..\ge
neric" -I"C:\Users\robert\Downloads\tk868\win\..\bitmaps" -I"C:\Users\robert\Dow
nloads\tk868\win\..\xlib" -FoC:\Users\robert\Downloads\tk868\win\Release_VC1912\
tk_ThreadedDynamic\tkStubLib.obj C:\Users\robert\Downloads\tk868\win\..\generic\
\Community\VC\Tools\MSVC\14.12.25827\bin\HostX86\x86\cl.EXE"' : return code '0x2
'
Stop.

C:\Users\robert\Downloads\tk868\win>

Peter Dean

unread,
Jan 10, 2018, 5:26:36 PM1/10/18
to
I've followed Haralds instructions but using VC17 community and got the
same error as the OP.
I started a command prompt from the start menu "x64 Native tools command
prompt" which starts vcvars64.bat

c:\test\tcl8.6.8\win>cd c:\test\tk8.6.8\win

c:\test\tk8.6.8\win>nmake -f Makefile.vc release htmlhelp install
INSTALLDIR=c:\test\tcl868

Microsoft (R) Program Maintenance Utility Version 14.12.25830.2
Copyright (C) Microsoft Corporation. All rights reserved.

*** Using c:\test\tcl8.6.8\win\rules.vc
*** Using c:\test\tcl8.6.8\win\nmakehlp.c
*** Compiler has 'Optimizations'
*** Building against Tcl at 'c:\test\tcl8.6.8'
*** Intermediate directory will be
'c:\test\tk8.6.8\win\Release_AMD64_VC1912\tk_ThreadedDynamic'
*** Output directory will be 'c:\test\tk8.6.8\win\Release_AMD64_VC1912'
*** Installation, if selected, will be in 'c:\test\tcl868'
*** Suffix for binaries will be 't'
*** Compiler version 1912. Target machine is AMD64
*** Host architecture is AMD64
TCLINSTALL=0
*** Dependency rules are not being used.

cl -nologo -c /D_ATL_XP_TARGETING /DUNICODE /D_UNICODE -W3
-wd4311 -wd4312
-Fpc:\test\tk8.6.8\win\Release_AMD64_VC1912\tk_ThreadedDynamic\
-fp:strict -O2 -GS -GL -DBUILD_ttk -DSTDC_HEADERS=1
-DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1
-DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1
-DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DSUPPORT_CONFIG_EMBEDDED
-DHAVE_UXTHEME_H=1 -Dinline=__inline -D _CRT_SECURE_NO_DEPRECATE -D
_CRT_NONSTDC_NO_DEPRECATE -DTCL_CFGVAL_ENCODING=\"cp1252\"
-DSTDC_HEADERS -DTCL_THREADS=1 -DUSE_THREAD_ALLOC=1 -DNDEBUG
-DTCL_CFG_OPTIMIZED -DTCL_CFG_DO64BIT -Zl -DSTATIC_BUILD
-I"c:\test\tcl8.6.8\generic" -I"c:\test\tcl8.6.8\win"
-I"c:\test\tk8.6.8\win\..\win" -I"c:\test\tk8.6.8\win\..\generic"
-I"c:\test\tk8.6.8\win\..\bitmaps" -I"c:\test\tk8.6.8\win\..\xlib"
-Foc:\test\tk8.6.8\win\Release_AMD64_VC1912\tk_ThreadedDynamic\tkStubLib.obj
c:\test\tk8.6.8\win\..\generic\tkStubLib.c
tkStubLib.c
C:\Program Files (x86)\Windows
Kits\10\include\10.0.16299.0\um\winnt.h(20062): error C2059: syntax
error: 'constant'
C:\Program Files (x86)\Windows
Kits\10\include\10.0.16299.0\um\winnt.h(20074): error C2059: syntax
error: '}'
C:\Program Files (x86)\Windows
Kits\10\include\10.0.16299.0\um\winnt.h(20075): error C2059: syntax
error: '}'
C:\Program Files (x86)\Windows
Kits\10\include\10.0.16299.0\um\winnt.h(20076): error C2143: syntax
error: missing '{' before '*'
C:\Program Files (x86)\Windows
Kits\10\include\10.0.16299.0\um\winnt.h(20084): error C2061: syntax
error: identifier 'IMAGE_POLICY_ENTRY'
C:\Program Files (x86)\Windows
Kits\10\include\10.0.16299.0\um\winnt.h(20085): error C2059: syntax
error: '}'
C:\Program Files (x86)\Windows
Kits\10\include\10.0.16299.0\um\winnt.h(20086): error C2143: syntax
error: missing '{' before '*'
C:\Program Files (x86)\Windows
Kits\10\include\10.0.16299.0\um\processthreadsapi.h(1126): error C2059:
syntax error: 'constant'
C:\Program Files (x86)\Windows
Kits\10\include\10.0.16299.0\um\processthreadsapi.h(1128): error C2059:
syntax error: '}'C:\Program Files (x86)\Windows
Kits\10\include\10.0.16299.0\um\processthreadsapi.h(1250): error C2059:
syntax error: 'constant'
C:\Program Files (x86)\Windows
Kits\10\include\10.0.16299.0\um\processthreadsapi.h(1252): error C2059:

Harald Oehlmann

unread,
Jan 10, 2018, 6:22:17 PM1/10/18
to
Sorry, can't help any further...
(at least not tonight)...
Harald

Ashok

unread,
Jan 11, 2018, 1:47:23 AM1/11/18
to
This is a known issue - see the Tk ticket
https://core.tcl.tk/tk/tktview?name=3d34589aa0.

To summarize, you need to build using the Windows SDK that came with VS
2017 releases before Update 4. The last SDK that can be used to build Tk
is 10.0.15063.0. When setting up the command line environment, this must
be passed to vcvarsall.bat, for example

vcvarsall x64 10.0.15063.0

to set up a 64-bit build environment (x86 for 32-bit).

The SDK can be downloaded independently or I *think* can also be
installed via the VS 2017 installer which gives you a choice of one or
more SDK's to install. Note you can install multiple SDK versions with
no issues. Just make sure you pick the correct one via vcvarsall as
shown above.

I use the same compiler you are using to build my Magicsplat Tcl
distribution for Windows so be assured it works :-)

/Ashok
0 new messages