Не удалось скомпилировать pantheios 1.0.0-beta216 с помощью stlsoft-1.9.124 на Windows 7 64bit

У меня проблемы с компиляцией pantheios 1.0.0-beta2016 с stlsoft-1.9.124 на 64-битной Windows 7. Первая ошибка у меня была

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?

Я избавился от ошибки, изменив строку 625 make-файла на:

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-битная, сборка с make-файлом в \pantheios-1.0.1-beta216\build\vc12.x64\makefile
  • Visual Studio 12 (2013 г.)
  • пантейос 1.0.0-бета216
  • stlsoft-1.9.124 (с правильно определенным STLSOFT)
  • nmake для компиляции с предварительным выполнением vcvarsall.bat

Заранее спасибо за вашу помощь!


person David Vitoux    schedule 01.02.2016    source источник


Ответы (1)


После некоторых поисков я обнаружил, что вызванный компилятор cl на самом деле компилировал для x86. Чтобы сообщить cl о компиляции для 64-битных платформ, мне пришлось вызвать vcvarsall.bat с параметром «x64», и теперь он корректно компилируется с исходным make-файлом!

Ваше здоровье!

person David Vitoux    schedule 02.02.2016