Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » U++ Library support » U++ Core » new operator declared twice in MinGW TDM
new operator declared twice in MinGW TDM [message #47719] Fri, 10 March 2017 09:36 Go to next message
koldo is currently offline  koldo
Messages: 3355
Registered: August 2008
Senior Veteran
Hello all

Compiling in Windows 7 with MinGW TDM 64 5.1.0 I have got this error:
C:\upp\uppsrc\Core\heap.cpp: In function 'void* operator new(size_t)': C:\upp\uppsrc\Core\heap.cpp:245:53: error: declaration of 'void* operator new(size_t) throw (std::bad_alloc)' has a different exception specifier
 void *operator new(size_t size) throw(std::bad_alloc) { void *ptr = UPP::MemoryAlloc(size); return ptr; }
In file included from C:/Desarrollo/Packages/MinGW64/lib/gcc/x86_64-w64-mingw32/5.1.0/include/c++/functional:54:0,
                 from C:\upp\uppsrc\Core\Core.h:222,
                 from C:\upp\uppsrc\Core\heap.cpp:1:
C:/Packages/MinGW64/lib/gcc/x86_64-w64-mingw32/5.1.0/include/c++/new:111:7: error: from previous declaration 'void* operator new(std::size_t)'
 void* operator new(std::size_t) _GLIBCXX_THROW (std::bad_alloc)
It is like if new operators are declared twice.


Best regards
Iñaki

[Updated on: Fri, 10 March 2017 09:36]

Report message to a moderator

Re: new operator declared twice in MinGW TDM [message #47720 is a reply to message #47719] Fri, 10 March 2017 14:41 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
koldo wrote on Fri, 10 March 2017 09:36
Hello all

Compiling in Windows 7 with MinGW TDM 64 5.1.0 I have got this error:
C:\upp\uppsrc\Core\heap.cpp: In function 'void* operator new(size_t)': C:\upp\uppsrc\Core\heap.cpp:245:53: error: declaration of 'void* operator new(size_t) throw (std::bad_alloc)' has a different exception specifier
 void *operator new(size_t size) throw(std::bad_alloc) { void *ptr = UPP::MemoryAlloc(size); return ptr; }
In file included from C:/Desarrollo/Packages/MinGW64/lib/gcc/x86_64-w64-mingw32/5.1.0/include/c++/functional:54:0,
                 from C:\upp\uppsrc\Core\Core.h:222,
                 from C:\upp\uppsrc\Core\heap.cpp:1:
C:/Packages/MinGW64/lib/gcc/x86_64-w64-mingw32/5.1.0/include/c++/new:111:7: error: from previous declaration 'void* operator new(std::size_t)'
 void* operator new(std::size_t) _GLIBCXX_THROW (std::bad_alloc)
It is like if new operators are declared twice.


It works with mingw64 supplied with U++. And in POSIX too. Perhaps TDM related bug?

Note that MIGW64 coming with U++ is 6.2.0, so what is the reason for using TDM?
Re: new operator declared twice in MinGW TDM [message #47721 is a reply to message #47720] Fri, 10 March 2017 23:38 Go to previous message
koldo is currently offline  koldo
Messages: 3355
Registered: August 2008
Senior Veteran
Hello Mirek

Thank you for your advice. MinGW bundled in U++ works like a charm.

I was using TDM because updating was easy with the installer, as just new items are downloaded, not the full package.
However it seems they are stuck in an old version.


Best regards
Iñaki
Previous Topic: Possible bug in LocalProcess
Next Topic: U++ can't handle float to string and back for large numbers
Goto Forum:
  


Current Time: Thu Mar 28 22:08:47 CET 2024

Total time taken to generate the page: 0.01860 seconds