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

时间:2016-02-01 12:21:25

标签: c++ visual-c++ visual-studio-2013 64-bit pantheios

我在Windows 7 64bit上用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编译器选项。

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

    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.

我迷失了该怎么做......

总结我的配置:

  • 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
  • 进行编译

提前感谢您的帮助!

1 个答案:

答案 0 :(得分:0)

经过一番搜索,我发现调用的cl编译器实际上正在编译x86。为了告诉cl为64位平台编译,我不得不使用'x64'选项调用vcvarsall.bat,它现在可以正确编译原始的makefile!

干杯!