* Missing new.h and broken comdef.h in cygwin32-w32api-headers (and the mingw header packages too)
@ 2020-04-07 13:29 Hans de Ruiter
2020-04-07 20:55 ` Csaba Ráduly
0 siblings, 1 reply; 2+ messages in thread
From: Hans de Ruiter @ 2020-04-07 13:29 UTC (permalink / raw)
To: cygwin
I've been trying to compile something that uses comutil.h, which in turn
includes comip.h and comdef.h (amongst others).
First, I get a missing header error:
/usr/include/w32api/comip.h:21:10: fatal error: new.h: No such file or
directory
So, I copy new.h from the mingw headers (I'm using the cygwin compiler
*not* mingw). Then, I get the following:
/licensingclient/src/client/Licensing/hwid.cpp.o
ThirdParty/licensingclient/src/client/Licensing/hwid.cpp
In file included from
ThirdParty/licensingclient/src/client/Licensing/wmihelper.h:8,
from
ThirdParty/licensingclient/src/client/Licensing/hwid.cpp:13:
/usr/include/w32api/comutil.h:412:3: error:
'_variant_t::_variant_t(unsigned int)' cannot be overloaded with
'_variant_t::_variant_t(unsigned int)'
412 | _variant_t(unsigned int uiSrc) throw();
| ^~~~~~~~~~
/usr/include/w32api/comutil.h:410:3: note: previous declaration
'_variant_t::_variant_t(unsigned int)'
410 | _variant_t(unsigned __LONG32 ulSrc) throw();
| ^~~~~~~~~~
/usr/include/w32api/comutil.h:431:3: error: '_variant_t::operator int()
const' cannot be overloaded with '_variant_t::operator int() const'
431 | operator int() const;
| ^~~~~~~~
/usr/include/w32api/comutil.h:417:3: note: previous declaration
'_variant_t::operator int() const'
417 | operator __LONG32() const;
| ^~~~~~~~
/usr/include/w32api/comutil.h:432:3: error: '_variant_t::operator
unsigned int() const' cannot be overloaded with '_variant_t::operator
unsigned int() const'
432 | operator unsigned int() const;
| ^~~~~~~~
/usr/include/w32api/comutil.h:430:3: note: previous declaration
'_variant_t::operator unsigned int() const'
430 | operator unsigned __LONG32() const;
| ^~~~~~~~
/usr/include/w32api/comutil.h:454:15: error: '_variant_t&
_variant_t::operator=(int)' cannot be overloaded with '_variant_t&
_variant_t::operator=(int)'
454 | _variant_t &operator=(int iSrc);
| ^~~~~~~~
/usr/include/w32api/comutil.h:439:15: note: previous declaration
'_variant_t& _variant_t::operator=(int)'
439 | _variant_t &operator=(__LONG32 lSrc);
| ^~~~~~~~
/usr/include/w32api/comutil.h:455:15: error: '_variant_t&
_variant_t::operator=(unsigned int)' cannot be overloaded with
'_variant_t& _variant_t::operator=(unsigned int)'
455 | _variant_t &operator=(unsigned int uiSrc);
| ^~~~~~~~
/usr/include/w32api/comutil.h:453:15: note: previous declaration
'_variant_t& _variant_t::operator=(unsigned int)'
453 | _variant_t &operator=(unsigned __LONG32 ulSrc);
| ^~~~~~~~
/usr/include/w32api/comutil.h:603:8: error: redefinition of
'_variant_t::_variant_t(unsigned int)'
603 | inline _variant_t::_variant_t(unsigned int uiSrc) throw() {
| ^~~~~~~~~~
/usr/include/w32api/comutil.h:595:8: note:
'_variant_t::_variant_t(unsigned int)' previously defined here
595 | inline _variant_t::_variant_t(unsigned __LONG32 ulSrc) throw() {
| ^~~~~~~~~~
/usr/include/w32api/comutil.h:716:8: error: redefinition of
'_variant_t::operator int() const'
716 | inline _variant_t::operator int() const {
| ^~~~~~~~~~
/usr/include/w32api/comutil.h:621:8: note: '_variant_t::operator int()
const' previously defined here
621 | inline _variant_t::operator __LONG32() const {
| ^~~~~~~~~~
/usr/include/w32api/comutil.h:722:8: error: redefinition of
'_variant_t::operator unsigned int() const'
722 | inline _variant_t::operator unsigned int() const {
| ^~~~~~~~~~
/usr/include/w32api/comutil.h:710:8: note: '_variant_t::operator
unsigned int() const' previously defined here
710 | inline _variant_t::operator unsigned __LONG32() const {
| ^~~~~~~~~~
/usr/include/w32api/comutil.h:990:20: error: redefinition of
'_variant_t& _variant_t::operator=(int)'
990 | inline _variant_t &_variant_t::operator=(int iSrc)
| ^~~~~~~~~~
/usr/include/w32api/comutil.h:763:20: note: '_variant_t&
_variant_t::operator=(int)' previously defined here
763 | inline _variant_t &_variant_t::operator=(__LONG32 lSrc) {
| ^~~~~~~~~~
/usr/include/w32api/comutil.h:1004:20: error: redefinition of
'_variant_t& _variant_t::operator=(unsigned int)'
1004 | inline _variant_t &_variant_t::operator=(unsigned int uiSrc)
| ^~~~~~~~~~
/usr/include/w32api/comutil.h:976:20: note: '_variant_t&
_variant_t::operator=(unsigned int)' previously defined here
976 | inline _variant_t &_variant_t::operator=(unsigned __LONG32 ulSrc)
| ^~~~~~~~~~
In file included from
ThirdParty/licensingclient/src/client/Licensing/wmihelper.h:8,
from
ThirdParty/licensingclient/src/client/Licensing/hwid.cpp:13:
/usr/include/w32api/comdef.h: In member function 'const TCHAR*
_com_error::ErrorMessage() const':
/usr/include/w32api/comdef.h:143:4: error: 'sprintf_s' was not declared
in this scope; did you mean '_sprintf_r'?
143 | _COM_PRINTF_S_1(m_pszMsg,32,TEXT("IDispatch error #%d"),wCode);
| ^~~~~~~~~~~~~~~
/usr/include/w32api/comdef.h:145:4: error: 'sprintf_s' was not declared
in this scope; did you mean '_sprintf_r'?
145 | _COM_PRINTF_S_1(m_pszMsg,32,TEXT("Unknown error
0x%0lX"),m_hresult);
| ^~~~~~~~~~~~~~~
make: *** [Makefile:182:
build/Windows_NT/debug/ThirdParty/licensingclient/src/client/Licensing/hwid.cpp.o]
Error 1
====12 errors, 10 warnings====
I tried simply using the mingw headers entirely, and I still get the
errors above.
This is with:
- gcc 9.3.0 with -std=gnu++2a in the command line, although it also
happens when -std is set to other C++ standard versions (e.g.,
-std=gnu++11).
- cygwin32-w32api-headers 4.0.4-1
- MinGW headers from mingw64-x86_64-headers 7.0.0-1
regards,
Hans
--
This email has been checked for viruses by Avast antivirus software.
https://www.avast.com/antivirus
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: Missing new.h and broken comdef.h in cygwin32-w32api-headers (and the mingw header packages too)
2020-04-07 13:29 Missing new.h and broken comdef.h in cygwin32-w32api-headers (and the mingw header packages too) Hans de Ruiter
@ 2020-04-07 20:55 ` Csaba Ráduly
0 siblings, 0 replies; 2+ messages in thread
From: Csaba Ráduly @ 2020-04-07 20:55 UTC (permalink / raw)
To: cygwin
On 07/04/2020 15:29, Hans de Ruiter via Cygwin wrote:
Hi Hans,
> I've been trying to compile something that uses comutil.h, which in turn
> includes comip.h and comdef.h (amongst others).
>
> First, I get a missing header error:
> /usr/include/w32api/comip.h:21:10: fatal error: new.h: No such file or directory
>
> So, I copy new.h from the mingw headers (I'm using the cygwin compiler *not*
> mingw). Then, I get the following:
Why do you think the mingw headers would work with Cygwin's compiler?
From an API point of view, Cygwin is a POSIX system. If your software includes
comutil.h/compip.h/comdep.h, that's a Windows application. You need a compiler
which understands the Windows API and creates native Windows applications.
Cygwin's GCC isn't such a compiler.
You need either a Mingw compiler, or Cygwin's cross compiler
(mingw64-i686-gcc-g++-9.2.0-2 )
Csaba
--
You can get very substantial performance improvements
by not doing the right thing. - Scott Meyers, An Effective C++11/14 Sampler
So if you're looking for a completely portable, 100% standards-conformat way
to get the wrong information: this is what you want. - Scott Meyers (C++TDaWYK)
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2020-04-07 20:55 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-04-07 13:29 Missing new.h and broken comdef.h in cygwin32-w32api-headers (and the mingw header packages too) Hans de Ruiter
2020-04-07 20:55 ` Csaba Ráduly
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).