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 » Developing U++ » U++ Developers corner » U++ and MinGW 4.7 (-std=c++11) issues
U++ and MinGW 4.7 (-std=c++11) issues [message #36920] Sat, 21 July 2012 21:40 Go to next message
Ptomaine is currently offline  Ptomaine
Messages: 11
Registered: July 2006
Promising Member
First, I want to say that U++ compiles very well when used with MinGW 4.7 even when using c++11 compiler option for U++'s native libraries. But there are some issues pertaining to compilation.

To resolve these issues I've had to do the following changes:

1. Right before inclusion of the <shlobj.h> file, the CY definition must be undefined:

#undef CY
#include <shlobj.h>

I found two files that need to be fixes this way: App.cpp and Path.cpp

2. WINVER definition must be corrected in <Core.h>:
from
#ifdef COMPILER_MINGW
#define WINVER 0xFFFF
#endif

to
#if defined(COMPILER_MINGW) && !defined(WINVER)
#define WINVER 0xFFFF
#endif

3. The compiler asks to include <winsock2.h> before <windows.h>, so the definition block with <winsock2.h> need to be placed higher than the first <windows.h> inclusion in the <Core.h> file.

4. The line in the App.cpp source file must be chaged:
from
if (int(ShellExecuteW(NULL, L"open", wurl, NULL, L".", SW_SHOWDEFAULT)) <= 32) {

to
if (reinterpret_cast<std::ptrdiff_t>(ShellExecuteW(NULL, L"open", wurl, NULL, L".", SW_SHOWDEFAULT)) <= 32) {

5. In the Defs.h header file, the code must be changed:
from
#ifdef PLATFORM_WIN32
inline bool IsNaN(double d) { return _isnan(d); }

to
#ifdef PLATFORM_WIN32
inline bool IsNaN(double d) { return std::isnan(d); }


So, if I make all these changes, the compilation goes smooth and fine even with c++11 compiler option.

Re: U++ and MinGW 4.7 (-std=c++11) issues [message #36921 is a reply to message #36920] Sun, 22 July 2012 08:08 Go to previous messageGo to next message
Sender Ghost is currently offline  Sender Ghost
Messages: 301
Registered: November 2008
Senior Member
Hello, Arlen.
Ptomaine wrote on Sat, 21 July 2012 21:40

First, I want to say that U++ compiles very well when used with MinGW 4.7 even when using c++11 compiler option for U++'s native libraries. But there are some issues pertaining to compilation.

I saw diagnostic messages you mentioned, but for MinGW-w64 builds only. They not related to "-std=c++11" compiler option. I saw them even for 4.6.3 or some below versions, not only for 4.7.1. For example, the nuwen.net MinGW builds haven't such issues.

But I could agree with WINVER define changes (because it is possible to define WINVER before including U++ headers or as compiler option).

Will see what the main developers say.
Re: U++ and MinGW 4.7 (-std=c++11) issues [message #36924 is a reply to message #36921] Sun, 22 July 2012 21:13 Go to previous messageGo to next message
Ptomaine is currently offline  Ptomaine
Messages: 11
Registered: July 2006
Promising Member
Hello, Mirek.

Yes, you're right! I've used the MinGW package that can compile x86-64 and x86-32 binaries using just the -m64 and -m32 compiler flags. But, by default, the compiler produce x86-64 binaries since I've downloaded the x64 compiler version from this URL.

So, anyway, why not to make some x64 related fixes to let compile U++ in x86-64 mode just smooth and flawless?
Re: U++ and MinGW 4.7 (-std=c++11) issues [message #36927 is a reply to message #36924] Mon, 23 July 2012 09:04 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
Applied.

Mirek
Re: U++ and MinGW 4.7 (-std=c++11) issues [message #36928 is a reply to message #36927] Mon, 23 July 2012 13:50 Go to previous messageGo to next message
unodgs is currently offline  unodgs
Messages: 1366
Registered: November 2005
Location: Poland
Ultimate Contributor

Thanks! I had similar changes but in another branch Smile Speaking of MingGW64. I'm unable to start debugger in the new experimental mode. Ide says 'Failded to run app'. I have gdb 7.4.1 and python 2.7.3 (on PATH). Does it only work in 32 bit mode?
Re: U++ and MinGW 4.7 (-std=c++11) issues [message #36929 is a reply to message #36928] Mon, 23 July 2012 13:56 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
unodgs wrote on Mon, 23 July 2012 07:50

Thanks! I had similar changes but in another branch Smile Speaking of MingGW64. I'm unable to start debugger in the new experimental mode. Ide says 'Failded to run app'. I have gdb 7.4.1 and python 2.7.3 (on PATH). Does it only work in 32 bit mode?


I dare to say that you are the first testing new debugger with mingw.

Mirek
Re: U++ and MinGW 4.7 (-std=c++11) issues [message #36932 is a reply to message #36929] Mon, 23 July 2012 15:08 Go to previous messageGo to next message
unodgs is currently offline  unodgs
Messages: 1366
Registered: November 2005
Location: Poland
Ultimate Contributor

That would explain that Smile I'll try to investigate on my own then.
Re: U++ and MinGW 4.7 (-std=c++11) issues [message #36934 is a reply to message #36928] Mon, 23 July 2012 17:58 Go to previous message
mdelfede is currently offline  mdelfede
Messages: 1307
Registered: September 2007
Ultimate Contributor
unodgs wrote on Mon, 23 July 2012 13:50

Thanks! I had similar changes but in another branch Smile Speaking of MingGW64. I'm unable to start debugger in the new experimental mode. Ide says 'Failded to run app'. I have gdb 7.4.1 and python 2.7.3 (on PATH). Does it only work in 32 bit mode?


I use it on gcc on ubuntu 64 bit and it works well... never tested on mingw, either.

I don't have a mingw setup here.... could you please try to "debug the debugger" with the old one to see why it can't start ?
Usually I have the "installed" ide named "theide" and the testing one named (automatically...) ide, so you can start theide in debug mode with different settings than the installed one, so it's quite easy to debug it.
If you add a couple of DLOG in Gdb_MI2.cpp :
MIValue Gdb_MI2::MICmd(const char *cmdLine)
{
    DLOG("CMDLINE : " << cmdLine);
......


and

MIValue Gdb_MI2::ParseGdb(String const &output, bool wait)
{
    DLOG("OUTPUT : " << output);
.......


and send me the ide log file, I could probably find the problem.

Ciao

Max
Previous Topic: CodeEditor with user-definable syntax highlighting
Next Topic: Linking standard libraries
Goto Forum:
  


Current Time: Fri Mar 29 13:22:34 CET 2024

Total time taken to generate the page: 0.01625 seconds