C++ 无法在64位windows 7上使用stlsoft-1.9.124编译pantheios 1.0.0-beta216

C++ 无法在64位windows 7上使用stlsoft-1.9.124编译pantheios 1.0.0-beta216,c++,visual-c++,visual-studio-2013,64-bit,pantheios,C++,Visual C++,Visual Studio 2013,64 Bit,Pantheios,在windows 7 64位上使用stlsoft-1.9.124编译pantheios 1.0.0-beta2016时遇到问题。我犯的第一个错误是 D:\Libraries\stlsoft-1.9.124\include\winstl/winstl.h(257) : fatal error C1189: #error : Compiling with WIN64 defined and _WIN64 not defined. Are you using the wrong makefile?

在windows 7 64位上使用stlsoft-1.9.124编译pantheios 1.0.0-beta2016时遇到问题。我犯的第一个错误是

D:\Libraries\stlsoft-1.9.124\include\winstl/winstl.h(257) : fatal error C1189: #error :  Compiling with WIN64 defined and _WIN64 not defined. Are you using the wrong makefile?
我通过将makefile的第625行更改为:

OS_DEFS             =   -DWIN64 -D_WIN64
产生此新错误的原因:

    cl    -nologo -c -W4 -WX  -O1 -MTd -D_DEBUG -Zi -Fd.\util.bailout.mt.debug.pdb    -DWIN64 -D_WIN64   -DSHWILD_QUALITY_NO_USE_XCOVER -DPANTHEIOS_NO_AUTO_INIT    -I..\..\include      -I"D:/Libraries/stlsoft-1.9.124\include"   -Fo.\util.bailout.mt.debug.obj ..\..\src\util\bailout.c
bailout.c
C:\Program Files (x86)\Windows Kits\8.1\include\shared\basetsd.h(180) : error C2220: warning treated as error - no 'object' file generated
C:\Program Files (x86)\Windows Kits\8.1\include\shared\basetsd.h(180) : warning C4305: 'type cast' : truncation from 'UINT_PTR' to 'void *'
C:\Program Files (x86)\Windows Kits\8.1\include\shared\basetsd.h(190) : warning C4305: 'type cast' : truncation from 'INT_PTR' to 'void *'
C:\Program Files (x86)\Windows Kits\8.1\include\shared\basetsd.h(255) : warning C4305: 'type cast' : truncation from 'INT_PTR' to 'void *'
C:\Program Files (x86)\Windows Kits\8.1\include\shared\basetsd.h(265) : warning C4305: 'type cast' : truncation from 'UINT_PTR' to 'void *'
C:\Program Files (x86)\Windows Kits\8.1\include\shared\basetsd.h(275) : warning C4305: 'type cast' : truncation from 'LONG_PTR' to 'void *'
C:\Program Files (x86)\Windows Kits\8.1\include\shared\basetsd.h(285) : warning C4305: 'type cast' : truncation from 'ULONG_PTR' to 'void *'
C:\Program Files (x86)\Windows Kits\8.1\include\shared\basetsd.h(299) : warning C4305: 'type cast' : truncation from 'ULONG_PTR' to 'void *'
C:\Program Files (x86)\Windows Kits\8.1\include\shared\basetsd.h(308) : warning C4305: 'type cast' : truncation from 'LONG_PTR' to 'void *'
C:\Program Files (x86)\Windows Kits\8.1\include\um\winnt.h(5842) : warning C4305: 'type cast' : truncation from 'ULONG_PTR' to 'PVOID *'
C:\Program Files (x86)\Windows Kits\8.1\include\um\winnt.h(5843) : warning C4305: 'type cast' : truncation from 'ULONG_PTR' to 'PVOID'
C:\Program Files (x86)\Windows Kits\8.1\include\um\winnt.h(8691) : warning C4305: 'type cast' : truncation from 'LONG64' to 'PVOID'
C:\Program Files (x86)\Windows Kits\8.1\include\um\winnt.h(8702) : warning C4305: 'type cast' : truncation from 'LONG64' to 'PVOID'
C:\Program Files (x86)\Windows Kits\8.1\include\um\winnt.h(8713) : warning C4305: 'type cast' : truncation from 'LONG64' to 'PVOID'
C:\Program Files (x86)\Windows Kits\8.1\include\um\winnt.h(19653) : warning C4305: 'type cast' : truncation from 'LONG_PTR' to '_ACTIVATION_CONTEXT *'
C:\Program Files (x86)\Windows Kits\8.1\include\um\winnt.h(19832) : warning C4305: 'type cast' : truncation from 'ULONG_PTR' to '_TEB *'
..\..\src\util\bailout.c(573) : warning C4305: 'type cast' : truncation from 'LONG_PTR' to 'HANDLE'
..\..\src\util\bailout.c(695) : warning C4305: 'type cast' : truncation from 'ULONG_PTR' to 'HKEY'
NMAKE : fatal error U1077: '"D:\Microsoft Visual Studio 12.0\VC\BIN\cl.EXE"' : return code '0x2'
Stop.
然后我更改了第657行和第670行,以删除-WX编译器选项

我仍然收到这些警告,但现在它继续编译(一次又一次地生成这些警告…),直到:

我不知道该怎么办

总结一下我的配置:

  • Windows 7 64位,使用\pantheios-1.0.1-beta216\build\vc12.x64\makefile中的makefile编译
  • Visual Studio 12(2013)
  • pantheios 1.0.0-beta216
  • stlsoft-1.9.124(正确定义了stlsoft)
  • nmake在执行vcvarsall.bat之前编译

提前感谢您的帮助

经过一些搜索,我发现调用的cl编译器实际上是为x86编译的。要让cl为64位平台编译,我必须使用“x64”选项调用vcvarsall.bat,它现在可以使用原始的makefile正确编译

干杯

    cl    -nologo -c -W4 -wd4800 -wd4996     -EHsc -GR -MTd -D_DEBUG -Zi -Fd.\util.be_context.mt.debug.pdb    -DWIN64 -D_WIN64   -DSHWILD_QUALITY_NO_USE_XCOVER -DPANTHEIOS_NO_AUTO_INIT    -I..\..\include      -I"D:/Libraries/stlsoft-1.9.124\include"   -Fo.\util.be_context.mt.debug.obj ..\..\src\util\be.context.cpp
be.context.cpp
D:\Microsoft Visual Studio 12.0\VC\INCLUDE\crtdefs.h(494) : error C2371: 'size_t' : redefinition; different basic types predefined C++ types (compiler internal)(19) : see declaration of 'size_t'
D:\Libraries\pantheios-1.0.1-beta216\include\pantheios/internal/slice.hpp(110) : error C3861: 'size_t': identifier not found
D:\Microsoft Visual Studio 12.0\VC\INCLUDE\xstddef(282) : error C2338: This code is for 64-bit size_t.
D:\Microsoft Visual Studio 12.0\VC\INCLUDE\xstddef(283) : warning C4305: 'initializing' : truncation from 'unsigned __int64' to 'const size_t'
D:\Microsoft Visual Studio 12.0\VC\INCLUDE\xstddef(283) : warning C4309: 'initializing' : truncation of constant value
D:\Microsoft Visual Studio 12.0\VC\INCLUDE\xstddef(284) : warning C4305: 'initializing' : truncation from 'unsigned __int64' to 'const size_t'
D:\Microsoft Visual Studio 12.0\VC\INCLUDE\xstddef(284) : warning C4309: 'initializing' : truncation of constant value
D:\Microsoft Visual Studio 12.0\VC\INCLUDE\xstddef(300) : error C2338: This code is for 64-bit size_t.
D:\Microsoft Visual Studio 12.0\VC\INCLUDE\xstddef(301) : warning C4293: '>>' : shift count negative or too big, undefined behavior
D:\Microsoft Visual Studio 12.0\VC\INCLUDE\xutility(2906) : warning C4244: 'argument' : conversion from 'ptrdiff_t' to 'size_t', possible loss of data
..\..\src\util\be.context.cpp(386) : error C3861: 'size_t': identifier not found
NMAKE : fatal error U1077: '"D:\Microsoft Visual Studio 12.0\VC\BIN\cl.EXE"' : return code '0x2'
Stop.