Skip to content
This repository has been archived by the owner on Apr 9, 2021. It is now read-only.

compile errors with pyicu 1.9.2 using visual studio community 2015 on windows 10 #7

Closed
maveryKearney opened this issue Oct 11, 2015 · 32 comments

Comments

@maveryKearney
Copy link

The problem occurs with:
- visual studio community 2015
- windows 10 amd64 4-processor dell
- python 3.5.0 win32 python. Note that vc 2015 compiles amd64 bit code but blocks execution at run-time.
- icu 55 and 56 win32 builds

The problem does not occur when I use visual C++ 2010 express, I just verified this on my win7 machine. BUT
- unfortunately I no longer have the vs 2010 express install package,
- I can no longer find a means to download visual C++ 2010 express from a credible site. If I can't get it from microsoft directly then I probably don't want it, and MS probably is discouraging use
at this point.
- documentation for VS community 2015 indicates that visual C++ express 2010 is accessible "in" VS community 2015. I have not figured out how at this point.

Regardless it appears that python 3.5.0 is now using VS 2015 in production to compile from source.

Here is my compile output (I tried attaching but git hub declared, "Something went really wrong...")

It occurs to me that I should try installing VS 2015 on my win7 machine to see if by chance the compilation works there.

There are 4 instances of a single type error in a function/method within the pyicu calendar.cpp module

c:\Users\xxxxxx\bryllyg\opt\icu\56.1\pyicu_1.9.2>C:\Users\xxxxxx\bryllyg\opt\python\Python-3.5.0\PCbuild\win32\python.exe setup.py build --debug
C:\Users\xxxxxx\bryllyg\opt\python\Python-3.5.0\PCbuild\win32\python.exe setup.py build --debug
running build
running build_py
running build_ext
building '_icu' extension
C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\BIN\cl.exe /c /nologo /Od /MDd /Zi /W3 /D_DEBUG -IC:\Users\xxxxxx\bryllyg\opt\icu\56.1\icu\include -IC:\Users\xxxxxx\bryllyg\opt\python\Python-3.5.0\include -IC:\Users\xxxxxx\bryllyg\opt\python\Python-3.5.0\PC "-IC:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\INCLUDE" "-IC:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\ATLMFC\INCLUDE" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.10150.0\ucrt" "-IC:\Program Files (x86)\Windows Kits\NETFXSDK\4.6\include\um" "-IC:\Program Files (x86)\Windows Kits\8.1\include\shared" "-IC:\Program Files (x86)\Windows Kits\8.1\include\um" "-IC:\Program Files (x86)\Windows Kits\8.1\include\winrt" /EHsc /Tpc:\Users\xxxxxx\bryllyg\opt\icu\56.1\pyicu_1.9.2\bases.cpp /Fobuild\temp.win32-3.5\Debug\bases.obj /Zc:wchar_t /EHsc /DPYICU_VER="1.9.2" /Od /DDEBUG
bases.cpp
C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\BIN\cl.exe /c /nologo /Od /MDd /Zi /W3 /D_DEBUG -IC:\Users\xxxxxx\bryllyg\opt\icu\56.1\icu\include -IC:\Users\xxxxxx\bryllyg\opt\python\Python-3.5.0\include -IC:\Users\xxxxxx\bryllyg\opt\python\Python-3.5.0\PC "-IC:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\INCLUDE" "-IC:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\ATLMFC\INCLUDE" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.10150.0\ucrt" "-IC:\Program Files (x86)\Windows Kits\NETFXSDK\4.6\include\um" "-IC:\Program Files (x86)\Windows Kits\8.1\include\shared" "-IC:\Program Files (x86)\Windows Kits\8.1\include\um" "-IC:\Program Files (x86)\Windows Kits\8.1\include\winrt" /EHsc /Tpc:\Users\xxxxxx\bryllyg\opt\icu\56.1\pyicu_1.9.2\calendar.cpp /Fobuild\temp.win32-3.5\Debug\calendar.obj /Zc:wchar_t /EHsc /DPYICU_VER="1.9.2" /Od /DDEBUG
calendar.cpp

c:\Users\xxxxxx\bryllyg\opt\icu\56.1\pyicu_1.9.2\calendar.cpp(353): error C2664: 'icu_56::UnicodeString &icu_56::TimeZone::getDisplayName(UBool *(__cdecl *)(void),icu_56::TimeZone::EDisplayType,const icu_56::Locale &,icu_56::UnicodeString &) const': cannot convert argument 1 from 'UBool' to 'UBool *(__cdecl *)(void)'
c:\Users\xxxxxx\bryllyg\opt\icu\56.1\pyicu_1.9.2\calendar.cpp(353): note: Conversion from integral type to pointer type requires reinterpret_cast, C-style cast or function-style cast

c:\Users\xxxxxx\bryllyg\opt\icu\56.1\pyicu_1.9.2\calendar.cpp(367): error C2664: 'icu_56::UnicodeString &icu_56::TimeZone::getDisplayName(UBool *(__cdecl *)(void),icu_56::TimeZone::EDisplayType,const icu_56::Locale &,icu_56::UnicodeString &) const': cannot convert argument 1 from 'UBool' to 'UBool *(__cdecl *)(void)'
c:\Users\xxxxxx\bryllyg\opt\icu\56.1\pyicu_1.9.2\calendar.cpp(367): note: Conversion from integral type to pointer type requires reinterpret_cast, C-style cast or function-style cast
c:\Users\xxxxxx\bryllyg\opt\icu\56.1\pyicu_1.9.2\calendar.cpp(372): error C2664: 'icu_56::UnicodeString &icu_56::TimeZone::getDisplayName(UBool *(__cdecl *)(void),icu_56::TimeZone::EDisplayType,const icu_56::Locale &,icu_56::UnicodeString &) const': cannot convert argument 1 from 'UBool' to 'UBool *(__cdecl *)(void)'
c:\Users\xxxxxx\bryllyg\opt\icu\56.1\pyicu_1.9.2\calendar.cpp(372): note: Conversion from integral type to pointer type requires reinterpret_cast, C-style cast or function-style cast
c:\Users\xxxxxx\bryllyg\opt\icu\56.1\pyicu_1.9.2\calendar.cpp(380): error C2664: 'icu_56::UnicodeString &icu_56::TimeZone::getDisplayName(UBool *(__cdecl *)(void),icu_56::TimeZone::EDisplayType,const icu_56::Locale &,icu_56::UnicodeString &) const': cannot convert argument 1 from 'UBool' to 'UBool *(__cdecl *)(void)'
c:\Users\xxxxxx\bryllyg\opt\icu\56.1\pyicu_1.9.2\calendar.cpp(380): note: Conversion from integral type to pointer type requires reinterpret_cast, C-style cast or function-style cast
C:\Users\xxxxxx\bryllyg\opt\python\Python-3.5.0\lib\distutils\dist.py:261: UserWarning: Unknown distribution option: 'test_suite'
warnings.warn(msg)
error: command 'C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\BIN\cl.exe' failed with exit status

@ovalhub
Copy link
Owner

ovalhub commented Oct 11, 2015

Hmmm, "cannot convert argument 1 from 'UBool' to'UBool *(__cdecl *)(void)"
Someone's seeing a function returning UBool * where there is just a UBool.

I can't reproduce any of this as I don't have either version of Windows or
that version of the compiler.

Try the following:

  • rename the 'daylight' variable to something else
  • comment out the code that gives you trouble to see if there are any
    other strange errors later in the build...

Please, let us know what you find out.

Andi..

On Sat, 10 Oct 2015, maveryKearney wrote:

The problem occurs with:
- visual studio community 2015
- windows 10 amd64 4-processor dell
- python 3.5.0 win32 python. Note that vc 2015 compiles amd64 bit code but blocks execution at run-time.
- icu 55 and 56 win32 builds

The problem does not occur when I use visual C++ 2010 express, I just verified this on my win7 machine. BUT
- unfortunately I no longer have the vs 2010 express install package,
- I can no longer find a means to download visual C++ 2010 express from a credible site. If I can't get it from microsoft directly then I probably don't want it, and MS probably is discouraging use
at this point.
- documentation for VS community 2015 indicates that visual C++ express 2010 is accessible "in" VS community 2015. I have not figured out how at this point.

Regardless it appears that python 3.5.0 is now using VS 2015 in production to compile from source.

Here is my compile output (I tried attaching but git hub declared, "Something went really wrong...")

It occurs to me that I should try installing VS 2015 on my win7 machine to see if by chance the compilation works there.

There are 4 instances of a single type error in a function/method within the pyicu calendar.cpp module

c:\Users\xxxxxx\bryllyg\opt\icu\56.1\pyicu_1.9.2>C:\Users\xxxxxx\bryllyg\opt\python\Python-3.5.0\PCbuild\win32\python.exe setup.py build --debug
C:\Users\xxxxxx\bryllyg\opt\python\Python-3.5.0\PCbuild\win32\python.exe setup.py build --debug
running build
running build_py
running build_ext
building '_icu' extension
C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\BIN\cl.exe /c /nologo /Od /MDd /Zi /W3 /D_DEBUG -IC:\Users\xxxxxx\bryllyg\opt\icu\56.1\icu\include -IC:\Users\xxxxxx\bryllyg\opt\python\Python-3.5.0\include -IC:\Users\xxxxxx\bryllyg\opt\python\Python-3.5.0\PC "-IC:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\INCLUDE" "-IC:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\ATLMFC\INCLUDE" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.10150.0\ucrt" "-IC:\Program Files (x86)\Windows Kits\NETFXSDK\4.6\include\um" "-IC:\Program Files (x86)\Windows Kits\8.1\include\shared" "-IC:\Program Files (x86)\Windows Kits\8.1\include\um" "-IC:\Program Files (x86)\Windows Kits\8.1\include\winrt" /EHsc /Tpc:\Users\xxxxxx\bryllyg\opt\icu\56.1\pyicu_1.9.2\bases.cpp /Fobuild\temp.win32-3.5\Debug\bases.obj /Zc:wchar_t /EHsc /DPYICU_VER="1.9.2" /Od /DDEBUG
bases.cpp
C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\BIN\cl.exe /c /nologo /Od /MDd /Zi /W3 /D_DEBUG -IC:\Users\xxxxxx\bryllyg\opt\icu\56.1\icu\include -IC:\Users\xxxxxx\bryllyg\opt\python\Python-3.5.0\include -IC:\Users\xxxxxx\bryllyg\opt\python\Python-3.5.0\PC "-IC:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\INCLUDE" "-IC:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\ATLMFC\INCLUDE" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.10150.0\ucrt" "-IC:\Program Files (x86)\Windows Kits\NETFXSDK\4.6\include\um" "-IC:\Program Files (x86)\Windows Kits\8.1\include\shared" "-IC:\Program Files (x86)\Windows Kits\8.1\include\um" "-IC:\Program Files (x86)\Windows Kits\8.1\include\winrt" /EHsc /Tpc:\Users\xxxxxx\bryllyg\opt\icu\56.1\pyicu_1.9.2\calendar.cpp /Fobuild\temp.win32-3.5\Debug\calendar.obj /Zc:wchar_t /EHsc /DPYICU_VER="1.9.2" /Od /DDEBUG
calendar.cpp

c:\Users\xxxxxx\bryllyg\opt\icu\56.1\pyicu_1.9.2\calendar.cpp(353): error C2664: 'icu_56::UnicodeString &icu_56::TimeZone::getDisplayName(UBool *(__cdecl *)(void),icu_56::TimeZone::EDisplayType,const icu_56::Locale &,icu_56::UnicodeString &) const': cannot convert argument 1 from 'UBool' to 'UBool *(__cdecl *)(void)'
c:\Users\xxxxxx\bryllyg\opt\icu\56.1\pyicu_1.9.2\calendar.cpp(353): note: Conversion from integral type to pointer type requires reinterpret_cast, C-style cast or function-style cast

c:\Users\xxxxxx\bryllyg\opt\icu\56.1\pyicu_1.9.2\calendar.cpp(367): error C2664: 'icu_56::UnicodeString &icu_56::TimeZone::getDisplayName(UBool *(__cdecl *)(void),icu_56::TimeZone::EDisplayType,const icu_56::Locale &,icu_56::UnicodeString &) const': cannot convert argument 1 from 'UBool' to 'UBool *(__cdecl *)(void)'
c:\Users\xxxxxx\bryllyg\opt\icu\56.1\pyicu_1.9.2\calendar.cpp(367): note: Conversion from integral type to pointer type requires reinterpret_cast, C-style cast or function-style cast
c:\Users\xxxxxx\bryllyg\opt\icu\56.1\pyicu_1.9.2\calendar.cpp(372): error C2664: 'icu_56::UnicodeString &icu_56::TimeZone::getDisplayName(UBool *(__cdecl *)(void),icu_56::TimeZone::EDisplayType,const icu_56::Locale &,icu_56::UnicodeString &) const': cannot convert argument 1 from 'UBool' to 'UBool *(__cdecl *)(void)'
c:\Users\xxxxxx\bryllyg\opt\icu\56.1\pyicu_1.9.2\calendar.cpp(372): note: Conversion from integral type to pointer type requires reinterpret_cast, C-style cast or function-style cast
c:\Users\xxxxxx\bryllyg\opt\icu\56.1\pyicu_1.9.2\calendar.cpp(380): error C2664: 'icu_56::UnicodeString &icu_56::TimeZone::getDisplayName(UBool *(__cdecl *)(void),icu_56::TimeZone::EDisplayType,const icu_56::Locale &,icu_56::UnicodeString &) const': cannot convert argument 1 from 'UBool' to 'UBool *(__cdecl *)(void)'
c:\Users\xxxxxx\bryllyg\opt\icu\56.1\pyicu_1.9.2\calendar.cpp(380): note: Conversion from integral type to pointer type requires reinterpret_cast, C-style cast or function-style cast
C:\Users\xxxxxx\bryllyg\opt\python\Python-3.5.0\lib\distutils\dist.py:261: UserWarning: Unknown distribution option: 'test_suite'
warnings.warn(msg)
error: command 'C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\BIN\cl.exe' failed with exit status


Reply to this email directly or view it on GitHub:
#7

@maveryKearney
Copy link
Author

I commented out the problematic code, and setup.py build completes without
error.

(hmmm I don't think I ran with "-debug", but hey this is a holiday.)

From python (win32) I can import icu, which is good.

I am proceeding to port all the stuff I need for my purposes.

I am just using word break iteration, with luck I don't need this corner of
icu

Since it builds then I should be able test things, and see what is broken.

I'll keep you posted. Thanks for the quick response.

Do you have a up-down loadable version of vs 2010 express by chance?

I actually don't think it is essential since I have debug capability on Mac
and

Win 7 that will help. I was remiss in not backing up a version of VS 2010
express

for this situation, BUT there may not be a version that works on Windows 10.

regards,

-m

From: ovalhub [mailto:notifications@github.com]
Sent: Sunday, October 11, 2015 4:00 AM
To: ovalhub/pyicu pyicu@noreply.github.com
Cc: maveryKearney ma.kearney@verizon.net
Subject: Re: [pyicu] compile errors with pyicu 1.9.2 using visual studio
community 2015 on windows 10 (#7)

Hmmm, "cannot convert argument 1 from 'UBool' to'UBool *(__cdecl *)(void)"
Someone's seeing a function returning UBool * where there is just a UBool.

I can't reproduce any of this as I don't have either version of Windows or
that version of the compiler.

Try the following:

  • rename the 'daylight' variable to something else
  • comment out the code that gives you trouble to see if there are any
    other strange errors later in the build...

Please, let us know what you find out.

Andi..

On Sat, 10 Oct 2015, maveryKearney wrote:

The problem occurs with:

  • visual studio community 2015
  • windows 10 amd64 4-processor dell
  • python 3.5.0 win32 python. Note that vc 2015 compiles amd64 bit code but
    blocks execution at run-time.
  • icu 55 and 56 win32 builds

The problem does not occur when I use visual C++ 2010 express, I just
verified this on my win7 machine. BUT

  • unfortunately I no longer have the vs 2010 express install package,
  • I can no longer find a means to download visual C++ 2010 express from a
    credible site. If I can't get it from microsoft directly then I probably
    don't want it, and MS probably is discouraging use
    at this point.
  • documentation for VS community 2015 indicates that visual C++ express
    2010 is accessible "in" VS community 2015. I have not figured out how at
    this point.

Regardless it appears that python 3.5.0 is now using VS 2015 in production
to compile from source.

Here is my compile output (I tried attaching but git hub declared,
"Something went really wrong...")

It occurs to me that I should try installing VS 2015 on my win7 machine to
see if by chance the compilation works there.

There are 4 instances of a single type error in a function/method within
the pyicu calendar.cpp module

c:\Users\xxxxxx\bryllyg\opt\icu\56.1\pyicu_1.9.2>C:\Users\xxxxxx\bryllyg\opt
\python\Python-3.5.0\PCbuild\win32\python.exe setup.py build --debug
C:\Users\xxxxxx\bryllyg\opt\python\Python-3.5.0\PCbuild\win32\python.exe
setup.py build --debug
running build
running build_py
running build_ext
building '_icu' extension
C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\BIN\cl.exe /c
/nologo /Od /MDd /Zi /W3 /D_DEBUG
-IC:\Users\xxxxxx\bryllyg\opt\icu\56.1\icu\include
-IC:\Users\xxxxxx\bryllyg\opt\python\Python-3.5.0\include
-IC:\Users\xxxxxx\bryllyg\opt\python\Python-3.5.0\PC "-IC:\Program Files
(x86)\Microsoft Visual Studio 14.0\VC\INCLUDE" "-IC:\Program Files
(x86)\Microsoft Visual Studio 14.0\VC\ATLMFC\INCLUDE" "-IC:\Program Files
(x86)\Windows Kits\10\include\10.0.10150.0\ucrt" "-IC:\Program Files
(x86)\Windows Kits\NETFXSDK\4.6\include\um" "-IC:\Program Files
(x86)\Windows Kits\8.1\include\shared" "-IC:\Program Files (x86)\Windows
Kits\8.1\include\um" "-IC:\Program Files (x86)\Windows
Kits\8.1\include\winrt" /EHsc
/Tpc:\Users\xxxxxx\bryllyg\opt\icu\56.1\pyicu_1.9.2\bases.cpp
/Fobuild\temp.win32-3.5\Debug\bases.obj /Zc:wchar_t /EHsc
/DPYICU_VER="1.9.2" /Od /DDEBUG
bases.cpp
C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\BIN\cl.exe /c
/nologo /Od /MDd /Zi /W3 /D_DEBUG
-IC:\Users\xxxxxx\bryllyg\opt\icu\56.1\icu\include
-IC:\Users\xxxxxx\bryllyg\opt\python\Python-3.5.0\include
-IC:\Users\xxxxxx\bryllyg\opt\python\Python-3.5.0\PC "-IC:\Program Files
(x86)\Microsoft Visual Studio 14.0\VC\INCLUDE" "-IC:\Program Files
(x86)\Microsoft Visual Studio 14.0\VC\ATLMFC\INCLUDE" "-IC:\Program Files
(x86)\Windows Kits\10\include\10.0.10150.0\ucrt" "-IC:\Program Files
(x86)\Windows Kits\NETFXSDK\4.6\include\um" "-IC:\Program Files
(x86)\Windows Kits\8.1\include\shared" "-IC:\Program Files (x86)\Windows
Kits\8.1\include\um" "-IC:\Program Files (x86)\Windows
Kits\8.1\include\winrt" /EHsc
/Tpc:\Users\xxxxxx\bryllyg\opt\icu\56.1\pyicu_1.9.2\calendar.cpp
/Fobuild\temp.win32-3.5\Debug\calendar.obj /Zc:wchar_t /EHsc
/DPYICU_VER="1.9.2" /Od /DDEBUG
calendar.cpp

c:\Users\xxxxxx\bryllyg\opt\icu\56.1\pyicu_1.9.2\calendar.cpp(353): error
C2664: 'icu_56::UnicodeString &icu_56::TimeZone::getDisplayName(UBool
*(__cdecl *)(void),icu_56::TimeZone::EDisplayType,const icu_56::Locale
&,icu_56::UnicodeString &) const': cannot convert argument 1 from 'UBool' to
'UBool *(__cdecl *)(void)'
c:\Users\xxxxxx\bryllyg\opt\icu\56.1\pyicu_1.9.2\calendar.cpp(353): note:
Conversion from integral type to pointer type requires reinterpret_cast,
C-style cast or function-style cast

c:\Users\xxxxxx\bryllyg\opt\icu\56.1\pyicu_1.9.2\calendar.cpp(367): error
C2664: 'icu_56::UnicodeString &icu_56::TimeZone::getDisplayName(UBool
*(__cdecl *)(void),icu_56::TimeZone::EDisplayType,const icu_56::Locale
&,icu_56::UnicodeString &) const': cannot convert argument 1 from 'UBool' to
'UBool *(__cdecl *)(void)'
c:\Users\xxxxxx\bryllyg\opt\icu\56.1\pyicu_1.9.2\calendar.cpp(367): note:
Conversion from integral type to pointer type requires reinterpret_cast,
C-style cast or function-style cast
c:\Users\xxxxxx\bryllyg\opt\icu\56.1\pyicu_1.9.2\calendar.cpp(372): error
C2664: 'icu_56::UnicodeString &icu_56::TimeZone::getDisplayName(UBool
*(__cdecl *)(void),icu_56::TimeZone::EDisplayType,const icu_56::Locale
&,icu_56::UnicodeString &) const': cannot convert argument 1 from 'UBool' to
'UBool *(__cdecl *)(void)'
c:\Users\xxxxxx\bryllyg\opt\icu\56.1\pyicu_1.9.2\calendar.cpp(372): note:
Conversion from integral type to pointer type requires reinterpret_cast,
C-style cast or function-style cast
c:\Users\xxxxxx\bryllyg\opt\icu\56.1\pyicu_1.9.2\calendar.cpp(380): error
C2664: 'icu_56::UnicodeString &icu_56::TimeZone::getDisplayName(UBool
*(__cdecl *)(void),icu_56::TimeZone::EDisplayType,const icu_56::Locale
&,icu_56::UnicodeString &) const': cannot convert argument 1 from 'UBool' to
'UBool *(__cdecl *)(void)'
c:\Users\xxxxxx\bryllyg\opt\icu\56.1\pyicu_1.9.2\calendar.cpp(380): note:
Conversion from integral type to pointer type requires reinterpret_cast,
C-style cast or function-style cast
C:\Users\xxxxxx\bryllyg\opt\python\Python-3.5.0\lib\distutils\dist.py:261:
UserWarning: Unknown distribution option: 'test_suite'
warnings.warn(msg)
error: command 'C:\Program Files (x86)\Microsoft Visual Studio
14.0\VC\BIN\cl.exe' failed with exit status


Reply to this email directly or view it on GitHub:
#7

Reply to this email directly or view it on GitHub
#7 (comment) .

@maveryKearney
Copy link
Author

Commenting out the problematic lines (andi's suggestion) in calendar.cpp enables the compilation to complete, for pycicu to build and install. In python, I can import icu and can run simple examples of what I need to work. Now to go back and build a debug version.

I am wondering if I would see the same problem on Win 7, but there I have python 3.4.2, icu54, pyicu 1.9.2 and virtual c++ express 2010 I think. and that works. On Mac I have python 3.5.0, icu55, pyyicu 1.9.2 and whatever is standard there.

My next step is to recompile icu with my tweaks, and see if the problem is critical to me. I suspect it is not, since icu is huge. I'll not know until I try.

I'll also install vs community 2015 on my win 7 machine and see if I see the same problem over there. There was a compilation or link reason I stayed back at icu54 on win 7. I just can't remember what it was. It wasn't critical so I didn't worry about it.

@pawel-ch
Copy link

pawel-ch commented Apr 9, 2016

I've encountered the same problem on Windows 7, Python 3.5.1 64-bit, ICU 57.1, PyICU 1.9.2 and Visual Studio Community 2015. Commenting-out the 4 mentioned lines from calendar.cpp helped.

On a side note, I've also had some problems with linking, but I've solved them by renaming c:\icu\bin64 to c:\icu\bin and c:\icu\lib64 to c:\icu\lib.

@nirvichara
Copy link

nirvichara commented Aug 19, 2016

I had an exactly same problem

C:\ICU PY\dist\PyICU-1.9.3>pip install pyicu
Collecting pyicu
Using cached PyICU-1.9.3.tar.gz
Installing collected packages: pyicu
Running setup.py install for pyicu ... error
Complete output from command "c:\program files\python35\python.exe" -u -c "import setuptools, tokenize;file='C:\Users\komaroax\AppData\Local\Temp\pip-build-gdnsxt9l\pyicu\setup.py';exec(compile(getattr(tokenize, 'open', open)(file).read().r
eplace('\r\n', '\n'), file, 'exec'))" install --record C:\Users\komaroax\AppData\Local\Temp\pip-g_xqe0rf-record\install-record.txt --single-version-externally-managed --compile:
running install
running build
running build_py
creating build
creating build\lib.win-amd64-3.5
copying icu.py -> build\lib.win-amd64-3.5
copying PyICU.py -> build\lib.win-amd64-3.5
copying docs.py -> build\lib.win-amd64-3.5
running build_ext
building '_icu' extension
creating build\temp.win-amd64-3.5
creating build\temp.win-amd64-3.5\Release
C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\BIN\x86_amd64\cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MD -Ic:/icu/include "-Ic:\program files\python35\include" "-Ic:\program files\python35\include" "-IC:\Program Files (x86)\Microsoft Visual Studio 1
4.0\VC\INCLUDE" "-IC:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\ATLMFC\INCLUDE" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.10586.0\ucrt" "-IC:\Program Files (x86)\Windows Kits\NETFXSDK\4.6.1\include\um" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.10586.0\shared" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.10586.0\um" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.10586.0\winrt" -IC:\Sybase\OCS-15_0\include /EHsc /Tpbases.cpp /Fobuild\temp.win-amd64-3.5\Release\bases.obj /Zc:wchar_t /EHsc /DPYICU_VER="1.9.3"
bases.cpp
bases.cpp(485): warning C4311: 'type cast': pointer truncation from 'UClassID' to 'long'
bases.cpp(485): warning C4302: 'type cast': truncation from 'UClassID' to 'long'
bases.cpp(1700): warning C4244: 'argument': conversion from 'Py_ssize_t' to 'int32_t', possible loss of data
bases.cpp(1756): warning C4244: 'argument': conversion from 'Py_ssize_t' to 'int32_t', possible loss of data
bases.cpp(1781): warning C4244: 'argument': conversion from 'Py_ssize_t' to 'int32_t', possible loss of data
bases.cpp(1783): warning C4244: 'argument': conversion from 'Py_ssize_t' to 'int32_t', possible loss of data
bases.cpp(1795): warning C4244: 'argument': conversion from 'Py_ssize_t' to 'int32_t', possible loss of data
bases.cpp(1840): warning C4244: 'argument': conversion from 'Py_ssize_t' to 'int32_t', possible loss of data
bases.cpp(1939): warning C4244: 'argument': conversion from 'Py_ssize_t' to 'int', possible loss of data
C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\BIN\x86_amd64\cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MD -Ic:/icu/include "-Ic:\program files\python35\include" "-Ic:\program files\python35\include" "-IC:\Program Files (x86)\Microsoft Visual Studio 1
4.0\VC\INCLUDE" "-IC:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\ATLMFC\INCLUDE" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.10586.0\ucrt" "-IC:\Program Files (x86)\Windows Kits\NETFXSDK\4.6.1\include\um" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.10586.0\shared" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.10586.0\um" "-IC:\Program Files (x86)\W
indows Kits\10\include\10.0.10586.0\winrt" -IC:\Sybase\OCS-15_0\include /EHsc /Tpcalendar.cpp /Fobuild\temp.win-amd64-3.5\Release
calendar.obj /Zc:wchar_t /EHsc /DPYICU_VER="1.9.3"
calendar.cpp
calendar.cpp(362): error C2664: 'icu_57::UnicodeString &icu_57::TimeZone::getDisplayName(UBool *(__cdecl *)(void),icu_57::Time
Zone::EDisplayType,const icu_57::Locale &,icu_57::UnicodeString &) const': cannot convert argument 1 from 'UBool' to 'UBool *(__cdecl *)(void)'
calendar.cpp(362): note: Conversion from integral type to pointer type requires reinterpret_cast, C-style cast or function-style cast
calendar.cpp(376): error C2664: 'icu_57::UnicodeString &icu_57::TimeZone::getDisplayName(UBool *(__cdecl *)(void),icu_57::TimeZone::EDisplayType,const icu_57::Locale &,icu_57::UnicodeString &) const': cannot convert argument 1 from 'UBool' to 'UBool *(__cdecl *)(void)'
calendar.cpp(376): note: Conversion from integral type to pointer type requires reinterpret_cast, C-style cast or function-style cast
calendar.cpp(381): error C2664: 'icu_57::UnicodeString &icu_57::TimeZone::getDisplayName(UBool *(__cdecl *)(void),icu_57::TimeZone::EDisplayType,const icu_57::Locale &,icu_57::UnicodeString &) const': cannot convert argument 1 from 'UBool' to 'UBool *(__cdecl *)(void)'
calendar.cpp(381): note: Conversion from integral type to pointer type requires reinterpret_cast, C-style cast or function-style cast
calendar.cpp(389): error C2664: 'icu_57::UnicodeString &icu_57::TimeZone::getDisplayName(UBool *(__cdecl *)(void),icu_57::TimeZone::EDisplayType,const icu_57::Locale &,icu_57::UnicodeString &) const': cannot convert argument 1 from 'UBool' to 'UBool *(__cdecl *)(void)'
calendar.cpp(389): note: Conversion from integral type to pointer type requires reinterpret_cast, C-style cast or function-style cast

error: command 'C:\Program Files (x86)\Microsoft Visual Studio14.0\VC\BIN\x86_amd64\cl.exe' failed with exit status 2

@ovalhub
Copy link
Owner

ovalhub commented Aug 19, 2016

I suspect that the local variable 'daylight' is clashing with some macro
defining a function pointer or something in VC++.

Look in calendar.cpp and rename all occurrences of 'daylight' to
'daylight_'. Does it fix the problem ?
If so, please send in a patch with the fix.

Thanks !

Andi..

On Fri, 19 Aug 2016, nirvichara wrote:

I had an exactly same problem

C:\ICU PY\dist\PyICU-1.9.3>pip install pyicu
Collecting pyicu
Using cached PyICU-1.9.3.tar.gz
Installing collected packages: pyicu
Running setup.py install for pyicu ... error
Complete output from command "c:\program files\python35\python.exe" -u -c "import setuptools, tokenize;file='C:\Users\ko
maroax\AppData\Local\Temp\pip-build-gdnsxt9l\pyicu\setup.py';exec(compile(getattr(tokenize, 'open', open)(file).read().r
eplace('\r\n', '\n'), file, 'exec'))" install --record C:\Users\komaroax\AppData\Local\Temp\pip-g_xqe0rf-record\install-record
.txt --single-version-externally-managed --compile:
running install
running build
running build_py
creating build
creating build\lib.win-amd64-3.5
copying icu.py -> build\lib.win-amd64-3.5
copying PyICU.py -> build\lib.win-amd64-3.5
copying docs.py -> build\lib.win-amd64-3.5
running build_ext
building '_icu' extension
creating build\temp.win-amd64-3.5
creating build\temp.win-amd64-3.5\Release
C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\BIN\x86_amd64\cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MD -Ic:/icu/inclu
de "-Ic:\program files\python35\include" "-Ic:\program files\python35\include" "-IC:\Program Files (x86)\Microsoft Visual Studio 1
4.0\VC\INCLUDE" "-IC:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\ATLMFC\INCLUDE" "-IC:\Program Files (x86)\Windows Kits\1
0\include\10.0.10586.0\ucrt" "-IC:\Program Files (x86)\Windows Kits\NETFXSDK\4.6.1\include\um" "-IC:\Program Files (x86)\Windows K
its\10\include\10.0.10586.0\shared" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.10586.0\um" "-IC:\Program Files (x86)\W
indows Kits\10\include\10.0.10586.0\winrt" -IC:\Sybase\OCS-15_0\include /EHsc /Tpbases.cpp /Fobuild\temp.win-amd64-3.5\Release\bas
es.obj /Zc:wchar_t /EHsc /DPYICU_VER="1.9.3"
bases.cpp
bases.cpp(485): warning C4311: 'type cast': pointer truncation from 'UClassID' to 'long'
bases.cpp(485): warning C4302: 'type cast': truncation from 'UClassID' to 'long'
bases.cpp(1700): warning C4244: 'argument': conversion from 'Py_ssize_t' to 'int32_t', possible loss of data
bases.cpp(1756): warning C4244: 'argument': conversion from 'Py_ssize_t' to 'int32_t', possible loss of data
bases.cpp(1781): warning C4244: 'argument': conversion from 'Py_ssize_t' to 'int32_t', possible loss of data
bases.cpp(1783): warning C4244: 'argument': conversion from 'Py_ssize_t' to 'int32_t', possible loss of data
bases.cpp(1795): warning C4244: 'argument': conversion from 'Py_ssize_t' to 'int32_t', possible loss of data
bases.cpp(1840): warning C4244: 'argument': conversion from 'Py_ssize_t' to 'int32_t', possible loss of data
bases.cpp(1939): warning C4244: 'argument': conversion from 'Py_ssize_t' to 'int', possible loss of data
C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\BIN\x86_amd64\cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MD -Ic:/icu/inclu
de "-Ic:\program files\python35\include" "-Ic:\program files\python35\include" "-IC:\Program Files (x86)\Microsoft Visual Studio 1
4.0\VC\INCLUDE" "-IC:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\ATLMFC\INCLUDE" "-IC:\Program Files (x86)\Windows Kits\1
0\include\10.0.10586.0\ucrt" "-IC:\Program Files (x86)\Windows Kits\NETFXSDK\4.6.1\include\um" "-IC:\Program Files (x86)\Windows K
its\10\include\10.0.10586.0\shared" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.10586.0\um" "-IC:\Program Files (x86)\W
indows Kits\10\include\10.0.10586.0\winrt" -IC:\Sybase\OCS-15_0\include /EHsc /Tpcalendar.cpp /Fobuild\temp.win-amd64-3.5\Release
calendar.obj /Zc:wchar_t /EHsc /DPYICU_VER="1.9.3"
calendar.cpp
calendar.cpp(362): error C2664: 'icu_57::UnicodeString &icu_57::TimeZone::getDisplayName(UBool *(__cdecl *)(void),icu_57::Time
Zone::EDisplayType,const icu_57::Locale &,icu_57::UnicodeString &) const': cannot convert argument 1 from 'UBool' to 'UBool *(__cd
ecl *)(void)'
calendar.cpp(362): note: Conversion from integral type to pointer type requires reinterpret_cast, C-style cast or function-sty
le cast
calendar.cpp(376): error C2664: 'icu_57::UnicodeString &icu_57::TimeZone::getDisplayName(UBool *(__cdecl *)(void),icu_57::Time
Zone::EDisplayType,const icu_57::Locale &,icu_57::UnicodeString &) const': cannot convert argument 1 from 'UBool' to 'UBool *(__cd
ecl *)(void)'
calendar.cpp(376): note: Conversion from integral type to pointer type requires reinterpret_cast, C-style cast or function-sty
le cast
calendar.cpp(381): error C2664: 'icu_57::UnicodeString &icu_57::TimeZone::getDisplayName(UBool *(__cdecl *)(void),icu_57::Time
Zone::EDisplayType,const icu_57::Locale &,icu_57::UnicodeString &) const': cannot convert argument 1 from 'UBool' to 'UBool *(__cd
ecl *)(void)'
calendar.cpp(381): note: Conversion from integral type to pointer type requires reinterpret_cast, C-style cast or function-sty
le cast
calendar.cpp(389): error C2664: 'icu_57::UnicodeString &icu_57::TimeZone::getDisplayName(UBool *(__cdecl *)(void),icu_57::Time
Zone::EDisplayType,const icu_57::Locale &,icu_57::UnicodeString &) const': cannot convert argument 1 from 'UBool' to 'UBool *(__cd
ecl *)(void)'
calendar.cpp(389): note: Conversion from integral type to pointer type requires reinterpret_cast, C-style cast or function-sty
le cast
error: command 'C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\BIN\x86_amd64\cl.exe' failed with exit status 2


Command ""c:\program files\python35\python.exe" -u -c "import setuptools, tokenize;file='C:\Users\komaroax\AppData\Local
Temp\pip-build-gdnsxt9l\pyicu\setup.py';exec(compile(getattr(tokenize, 'open', open)(file).read().replace('\r\n', '\n'), __
file__, 'exec'))" install --record C:\Users\komaroax\AppData\Local\Temp\pip-g_xqe0rf-record\install-record.txt --single-version-ex
ternally-managed --compile" failed with error code 1 in C:\Users\komaroax\AppData\Local\Temp\pip-build-gdnsxt9l\pyicu\

C:\ICU PY\dist\PyICU-1.9.3>pyicu
Traceback (most recent call last):
File "C:\ICU PY\dist\PyICU-1.9.3\PyICU.py", line 29, in
from icu import *
File "C:\ICU PY\dist\PyICU-1.9.3\icu.py", line 37, in
from docs import *
File "C:\ICU PY\dist\PyICU-1.9.3\docs.py", line 23, in
from _icu import *
ImportError: No module named '_icu'

C:\ICU PY\dist\PyICU-1.9.3>pip install pyicu
Collecting pyicu
Using cached PyICU-1.9.3.tar.gz
Installing collected packages: pyicu
Running setup.py install for pyicu ... error
Complete output from command "c:\program files\python35\python.exe" -u -c "import setuptools, tokenize;file='C:\Users\ko
maroax\AppData\Local\Temp\pip-build-5m381sxf\pyicu\setup.py';exec(compile(getattr(tokenize, 'open', open)(file).read().r
eplace('\r\n', '\n'), file, 'exec'))" install --record C:\Users\komaroax\AppData\Local\Temp\pip-_7mjgjss-record\install-record
.txt --single-version-externally-managed --compile:
running install
running build
running build_py
creating build
creating build\lib.win-amd64-3.5
copying icu.py -> build\lib.win-amd64-3.5
copying PyICU.py -> build\lib.win-amd64-3.5
copying docs.py -> build\lib.win-amd64-3.5
running build_ext
building '_icu' extension
creating build\temp.win-amd64-3.5
creating build\temp.win-amd64-3.5\Release
C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\BIN\x86_amd64\cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MD -Ic:/icu/inclu
de "-Ic:\program files\python35\include" "-Ic:\program files\python35\include" "-IC:\Program Files (x86)\Microsoft Visual Studio 1
4.0\VC\INCLUDE" "-IC:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\ATLMFC\INCLUDE" "-IC:\Program Files (x86)\Windows Kits\1
0\include\10.0.10586.0\ucrt" "-IC:\Program Files (x86)\Windows Kits\NETFXSDK\4.6.1\include\um" "-IC:\Program Files (x86)\Windows K
its\10\include\10.0.10586.0\shared" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.10586.0\um" "-IC:\Program Files (x86)\W
indows Kits\10\include\10.0.10586.0\winrt" -IC:\Sybase\OCS-15_0\include /EHsc /Tpbases.cpp /Fobuild\temp.win-amd64-3.5\Release\bas
es.obj /Zc:wchar_t /EHsc /DPYICU_VER="1.9.3"
bases.cpp
bases.cpp(485): warning C4311: 'type cast': pointer truncation from 'UClassID' to 'long'
bases.cpp(485): warning C4302: 'type cast': truncation from 'UClassID' to 'long'
bases.cpp(1700): warning C4244: 'argument': conversion from 'Py_ssize_t' to 'int32_t', possible loss of data
bases.cpp(1756): warning C4244: 'argument': conversion from 'Py_ssize_t' to 'int32_t', possible loss of data
bases.cpp(1781): warning C4244: 'argument': conversion from 'Py_ssize_t' to 'int32_t', possible loss of data
bases.cpp(1783): warning C4244: 'argument': conversion from 'Py_ssize_t' to 'int32_t', possible loss of data
bases.cpp(1795): warning C4244: 'argument': conversion from 'Py_ssize_t' to 'int32_t', possible loss of data
bases.cpp(1840): warning C4244: 'argument': conversion from 'Py_ssize_t' to 'int32_t', possible loss of data
bases.cpp(1939): warning C4244: 'argument': conversion from 'Py_ssize_t' to 'int', possible loss of data
C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\BIN\x86_amd64\cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MD -Ic:/icu/inclu
de "-Ic:\program files\python35\include" "-Ic:\program files\python35\include" "-IC:\Program Files (x86)\Microsoft Visual Studio 1
4.0\VC\INCLUDE" "-IC:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\ATLMFC\INCLUDE" "-IC:\Program Files (x86)\Windows Kits\1
0\include\10.0.10586.0\ucrt" "-IC:\Program Files (x86)\Windows Kits\NETFXSDK\4.6.1\include\um" "-IC:\Program Files (x86)\Windows K
its\10\include\10.0.10586.0\shared" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.10586.0\um" "-IC:\Program Files (x86)\W
indows Kits\10\include\10.0.10586.0\winrt" -IC:\Sybase\OCS-15_0\include /EHsc /Tpcalendar.cpp /Fobuild\temp.win-amd64-3.5\Release
calendar.obj /Zc:wchar_t /EHsc /DPYICU_VER="1.9.3"
calendar.cpp
calendar.cpp(362): error C2664: 'icu_57::UnicodeString &icu_57::TimeZone::getDisplayName(UBool *(__cdecl *)(void),icu_57::Time
Zone::EDisplayType,const icu_57::Locale &,icu_57::UnicodeString &) const': cannot convert argument 1 from 'UBool' to 'UBool *(__cd
ecl *)(void)'
calendar.cpp(362): note: Conversion from integral type to pointer type requires reinterpret_cast, C-style cast or function-sty
le cast
calendar.cpp(376): error C2664: 'icu_57::UnicodeString &icu_57::TimeZone::getDisplayName(UBool *(__cdecl *)(void),icu_57::Time
Zone::EDisplayType,const icu_57::Locale &,icu_57::UnicodeString &) const': cannot convert argument 1 from 'UBool' to 'UBool *(__cd
ecl *)(void)'
calendar.cpp(376): note: Conversion from integral type to pointer type requires reinterpret_cast, C-style cast or function-sty
le cast
calendar.cpp(381): error C2664: 'icu_57::UnicodeString &icu_57::TimeZone::getDisplayName(UBool *(__cdecl *)(void),icu_57::Time
Zone::EDisplayType,const icu_57::Locale &,icu_57::UnicodeString &) const': cannot convert argument 1 from 'UBool' to 'UBool *(__cd
ecl *)(void)'
calendar.cpp(381): note: Conversion from integral type to pointer type requires reinterpret_cast, C-style cast or function-sty
le cast
calendar.cpp(389): error C2664: 'icu_57::UnicodeString &icu_57::TimeZone::getDisplayName(UBool *(__cdecl *)(void),icu_57::Time
Zone::EDisplayType,const icu_57::Locale &,icu_57::UnicodeString &) const': cannot convert argument 1 from 'UBool' to 'UBool *(__cd
ecl *)(void)'
calendar.cpp(389): note: Conversion from integral type to pointer type requires reinterpret_cast, C-style cast or function-sty
le cast
error: command 'C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\BIN\x86_amd64\cl.exe' failed with exit status 2


Command ""c:\program files\python35\python.exe" -u -c "import setuptools, tokenize;file='C:\Users\komaroax\AppData\Local
Temp\pip-build-5m381sxf\pyicu\setup.py';exec(compile(getattr(tokenize, 'open', open)(file).read().replace('\r\n', '\n'), __
file__, 'exec'))" install --record C:\Users\komaroax\AppData\Local\Temp\pip-_7mjgjss-record\install-record.txt --single-version-ex
ternally-managed --compile" failed with error code 1 in C:\Users\komaroax\AppData\Local\Temp\pip-build-5m381sxf\pyicu\

You are receiving this because you commented.
Reply to this email directly or view it on GitHub:
#7 (comment)

@ovalhub
Copy link
Owner

ovalhub commented Dec 20, 2016

I don't have access to Windows or this compiler.
Is this issue still reproducible ?

@SebastianKnight
Copy link

SebastianKnight commented Jan 28, 2017

i have the same calendar.cpp issue on 1.9.5, building for Python 3.5.3 Win32, with freshly built Win32 ICU 58.2 on x64 Windows 7 using VS 2015 MSBuild.

and after commenting out those 4 calendar.cpp lines, and explicit cast in common.cpp line 226 of the first argument with: u_memcpy((UChar *) PyUnicode_2BYTE_DATA(result), utf16, len16);
it Finished generating code.

@ovalhub
Copy link
Owner

ovalhub commented Jan 28, 2017 via email

@SebastianKnight
Copy link

after the change of int daylight to int renamed it's still the same issues. here's the error thrown in calendar.cpp

C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\BIN\cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MD -Ic:/icu/include -IC:\Python35\include -IC:\Python35\inclu de "-IC:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\INCLUDE" "-IC:\Prog ram Files (x86)\Windows Kits\10\include\10.0.10240.0\ucrt" "-IC:\Program Files ( x86)\Windows Kits\8.1\include\shared" "-IC:\Program Files (x86)\Windows Kits\8.1 \include\um" "-IC:\Program Files (x86)\Windows Kits\8.1\include\winrt" "-IC:\Pro gram Files (x86)\Microsoft Visual Studio 8\VC\include" "-IC:\Program Files (x86) \Microsoft SDKs\Windows\v7.0A\Include" /EHsc /Tpcalendar.cpp /Fobuild\temp.win32 -3.5\Release\calendar.obj /Zc:wchar_t /EHsc /DPYICU_VER=\"1.9.5\" calendar.cpp calendar.cpp(362): error C2664: 'icu_58::UnicodeString &icu_58::TimeZone::getDis playName(UBool *(__cdecl *)(void),icu_58::TimeZone::EDisplayType,const icu_58::L ocale &,icu_58::UnicodeString &) const': cannot convert argument 1 from 'UBool' to 'UBool *(__cdecl *)(void)' calendar.cpp(362): note: Conversion from integral type to pointer type requires reinterpret_cast, C-style cast or function-style cast calendar.cpp(376): error C2664: 'icu_58::UnicodeString &icu_58::TimeZone::getDis playName(UBool *(__cdecl *)(void),icu_58::TimeZone::EDisplayType,const icu_58::L ocale &,icu_58::UnicodeString &) const': cannot convert argument 1 from 'UBool' to 'UBool *(__cdecl *)(void)' calendar.cpp(376): note: Conversion from integral type to pointer type requires reinterpret_cast, C-style cast or function-style cast calendar.cpp(381): error C2664: 'icu_58::UnicodeString &icu_58::TimeZone::getDis playName(UBool *(__cdecl *)(void),icu_58::TimeZone::EDisplayType,const icu_58::L ocale &,icu_58::UnicodeString &) const': cannot convert argument 1 from 'UBool' to 'UBool *(__cdecl *)(void)' calendar.cpp(381): note: Conversion from integral type to pointer type requires reinterpret_cast, C-style cast or function-style cast calendar.cpp(389): error C2664: 'icu_58::UnicodeString &icu_58::TimeZone::getDis playName(UBool *(__cdecl *)(void),icu_58::TimeZone::EDisplayType,const icu_58::L ocale &,icu_58::UnicodeString &) const': cannot convert argument 1 from 'UBool' to 'UBool *(__cdecl *)(void)' calendar.cpp(389): note: Conversion from integral type to pointer type requires reinterpret_cast, C-style cast or function-style cast error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio 14.0\\VC\\BIN\\ cl.exe' failed with exit status 2

@ovalhub
Copy link
Owner

ovalhub commented Jan 29, 2017 via email

@SebastianKnight
Copy link

SebastianKnight commented Jan 31, 2017

when you compile using the /E switch to check the preprocessor output to standard output you can find these types being ex/imported:
class __declspec(dllimport) TimeZone ...
UnicodeString& getDisplayName(UBool (*__daylight()), EDisplayType style, UnicodeString& result) const;
UnicodeString& getDisplayName(UBool (*__daylight()), EDisplayType style, const Locale& locale, UnicodeString& result) const;
then in C:\Program Files (x86)\Windows Kits\10\include\10.0.10240.0\ucrt\time.h is
__declspec(dllimport) int* __cdecl __daylight(void);
with following:

_Check_return_ _CRT_INSECURE_DEPRECATE_GLOBALS(_get_daylight)
_ACRTIMP int* __cdecl __daylight(void);
#define _daylight (*__daylight())

commenting out the last define in C:\Program Files (x86)\Windows Kits\10\include\10.0.10240.0\ucrt\time.h so that _daylight isn't obscured with that function pointer and rebuild without /E produces a clean build.

how about it...

@ovalhub
Copy link
Owner

ovalhub commented Jan 31, 2017 via email

@SebastianKnight
Copy link

SebastianKnight commented Jan 31, 2017

i've got to put both around the t_timezone_getDisplayName variable declarations in calendar.cpp and around affected getDisplayName calls within it

#if defined(_MSC_VER) && defined(_daylight)
#undef _daylight

let me know if that bothers you in any way, now it's narrowed within t_timezone_getDisplayName function scope.

and while at it, i've got to change in setup.py line 22
ICU_VERSION = check_output(('icu-config', '--version')).strip()
to
ICU_VERSION = check_output(('icuinfo', '--version')).strip()
since icuinfo is a Windows utility.

shall i patch that too?

@ovalhub
Copy link
Owner

ovalhub commented Jan 31, 2017 via email

@SebastianKnight
Copy link

SebastianKnight commented Jan 31, 2017

seems so, bin/ has no icu-config.
then i'll make two commits.

@SebastianKnight
Copy link

SebastianKnight commented Jan 31, 2017

please let me know if these are of no use to you.
[commits removed for a peace of mind]

@ovalhub
Copy link
Owner

ovalhub commented Feb 1, 2017 via email

@SebastianKnight
Copy link

SebastianKnight commented Feb 1, 2017

thank you for explaining me that. but that gets me back where i was to begin with.

the need for multiple undefs, and my guess may be wrong, comes from _daylight being defined again through the function body. and the need to wrap some code between undef and endif is obvious from the output. make it around the code it gets compiled, make it with undef/endif without a code between them doesn't. sorry for my empiricism.

never mind, i somehow presumed you'll have no good use of the patch. i'll go on and make me a wheel.

@ovalhub
Copy link
Owner

ovalhub commented Feb 1, 2017 via email

@SebastianKnight
Copy link

top of the file, after includes, just for your piece of mind, doesn't give a result in a way you suggest. it's broken as it were before, just as with any other combination you suggested so far.
i narrowed the scope of their reach as minimal as i could. honest.

@ovalhub
Copy link
Owner

ovalhub commented Feb 1, 2017 via email

@SebastianKnight
Copy link

for that i got what you expected i would:
calendar.cpp(33): fatal error C1189: #error: it is daylight

undefining daylight at the top of the file, just like _daylight previously, produces the same compilation errors. any more ideas for me check upon, make me a list please, and zip it.

@ovalhub
Copy link
Owner

ovalhub commented Feb 1, 2017 via email

@SebastianKnight
Copy link

SebastianKnight commented Feb 1, 2017

and remove all the other changes you made or start from a fresh calendar.cpp file.

which one is more instructive of my possible neglect: start from a fresh file or remove all the other changes? sorry mate, i may not wash my dishes every day, but i start every trial with a clean, fresh, pristine file each time.

your ideas don't work on Windows so far (not even the last one). i understand you. i don't like it either. but hey, mine worked. the list of further pearls, please, put in a zip.

@ovalhub
Copy link
Owner

ovalhub commented Feb 1, 2017 via email

@ovalhub
Copy link
Owner

ovalhub commented Feb 1, 2017 via email

@SebastianKnight
Copy link

my kind fellow, i don't want anything. i got what i need. i even made a patch for others to see how i got there.

you asked for a patch, you didn't understand the way it worked, and you need assistance for the next batch of ideas.

good luck, s

amynbe added a commit to amynbe/pyicu that referenced this issue Mar 8, 2017
@amynbe
Copy link

amynbe commented Mar 8, 2017

Managed to build after applying the above fix, with icu 58 on win64 / python 3.6 and created a wheel if it can be of use for anyone :
PyICU-1.9.5-cp36-cp36m-win_amd64.whl.zip

@ovalhub
Copy link
Owner

ovalhub commented Mar 21, 2017

I added:
#ifdef daylight
#undef daylight
#endif
if two places, let's hope it resolves this

@ovalhub ovalhub closed this as completed Mar 21, 2017
@SebastianKnight
Copy link

_daylight is what works, since that's a MS macro found in their time.h as explained above.

#define _daylight (*__daylight())

daylight as also explained above doesn't help.

@amynbe
Copy link

amynbe commented Mar 22, 2017

https://github.com/ovalhub/pyicu/pull/46/files at that exact location works. Tested on my system.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants