gpt4 book ai didi

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

转载 作者:塔克拉玛干 更新时间:2023-11-03 07:47:45 29 4
gpt4 key购买 nike

我在 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 编译器选项。

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

    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)
  • 万神殿 1.0.0-beta216
  • STLsoft-1.9.124(正确定义了 STLSOFT)
  • nmake 预先执行 vcvarsall.bat 进行编译

预先感谢您的帮助!

最佳答案

经过一番查找,我发现调用的cl编译器实际上是为x86编译的。要告诉 cl 为 64 位平台编译,我必须调用带有“x64”选项的 vcvarsall.bat,它现在可以使用原始 makefile 正确编译!

干杯!

关于c++ - 无法在 Windows 7 64 位上使用 STLsoft-1.9.124 编译 pantheios 1.0.0-beta216,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35130409/

29 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com