Problems with noexcept

21 posts / 0 new
Last post
cheezninja
Offline
Last seen: 2 years 4 months ago
Joined: 14 Apr 2012 - 04:48
Problems with noexcept

Well, I just upgraded to the Juce 2.0 release and I am getting errors on top of errors.. It doesn't happen with just my project but with building the Introjucer too. Here are a few lines that I am getting errors on. There are over 3,000 of them so I don't want to blow up the post with them. The are almost all identical anywyas with the 'noexcept' problem. I did switch to VS2011 beta too so this could be a problem with that too. I will start here before I go to their forums since it is only the building of Juce projects that are having problems. Am I doing something wrong or is there something that different that I need to do with VS2011?

1>c:\users\randi\documents\visual studio 11\juce\modules\juce_core\memory\juce_memory.h(37): error C3646: 'noexcept' : unknown override specifier
1>c:\users\randi\documents\visual studio 11\juce\modules\juce_core\memory\juce_memory.h(41): error C3646: 'noexcept' : unknown override specifier
1>c:\users\randi\documents\visual studio 11\juce\modules\juce_core\memory\juce_memory.h(56): error C3646: 'noexcept' : unknown override specifier
1>c:\users\randi\documents\visual studio 11\juce\modules\juce_core\memory\juce_memory.h(62): error C3646: 'noexcept' : unknown override specifier

cheezninja
Offline
Last seen: 2 years 4 months ago
Joined: 14 Apr 2012 - 04:48
Re: Problems with noexcept

Just found this post. http://rawmaterialsoftware.com/viewtopic.php?f=3&t=8734&hilit=noexcept So, you may ignore this. It doesn't really assist with the problem but lets me know that there is an issue when using VS2011 with Juce.

cpr
cpr's picture
Offline
Last seen: 14 hours 35 min ago
Joined: 25 Apr 2008 - 23:49
Re: Problems with noexcept

+1

I trying to compile code that compiled under VS2005/JUCE2.0, but I am getting errors from lines using 'noexcept'. Compiling after importing old projects results in a ton of "error C3646: 'noexcept' : unknown override specifier" errors, from what looks to be the same files (juce_Memory.h, juce_MathsFunctions.h, juce_CharacterFunctions.h, juce_Atomic.h, and juce_CharPointer_UTF8.h, at which point the compile fails due to error count exceeding 100).

According to this MS note ([url]http://msdn.microsoft.com/en-us/library/wfa0edys(v=vs.110).aspx[/url]): "In C++0x, the noexcept operator is introduced, but support for this feature is not yet present in Visual C++ as of Visual Studio 2012." So, we shouldn't use it yet, BUT, juce_PlatformDefs.h sets JUCE_COMPILER_SUPPORTS_NOEXCEPT to 1, based on newer compiler version (1700). Seems easy enough to take that out, but then code from xkeycheck.h (an MS file) generates errors, because it believes 'noexcept' is a keyword.

In my attempt to hack something together (as I am working towards a proof of concept), I haven't come to a final solution, but I did develop a work around. Just prior to the first error (in juce_Memory.h) I '#undef noexcept', and then '#define noexcept throw()'. So far so good, but would love an official fix.

TheVinn
Offline
Last seen: 3 weeks 2 days ago
Joined: 29 Aug 2009 - 11:31
Re: Problems with noexcept

throw-spec, noexcept, throw(), are all junk anyway.

jules
Online
Last seen: 2 min 52 sec ago
Joined: 29 Apr 2013 - 18:37
Re: Problems with noexcept

I've not installed VS2011 yet (and was hoping to avoid doing so..).

So if setting JUCE_COMPILER_SUPPORTS_NOEXCEPT to 0 causes problems, which include statement is pulling in that xkeycheck.h file?

cpr
cpr's picture
Offline
Last seen: 14 hours 35 min ago
Joined: 25 Apr 2008 - 23:49
Re: Problems with noexcept

It's included by 'yvals.h', which is included by all kinds of other MS headers.. this is obviously a bug in VS, ie. noexcept is NOT part of VS yet, but they won't let us #define it so that we can have cross platform code. Hopefully it will be fixed when the final release is out.

jules
Online
Last seen: 2 min 52 sec ago
Joined: 29 Apr 2013 - 18:37
Re: Problems with noexcept

Ok, well I guess in the meantime I'll just leave JUCE_COMPILER_SUPPORTS_NOEXCEPT set to 0.

But it's odd... Surely other people have been using VS2011? Why has nobody else had this problem?

cpr
cpr's picture
Offline
Last seen: 14 hours 35 min ago
Joined: 25 Apr 2008 - 23:49
Re: Problems with noexcept

I have wondered why no one else is reporting any problems, and I am hoping I am just doing something stupid, which the chance of is increased by the fact that I am importing my projects, and VS may have done some 'backwards compat' thing inside the project files. otoh, this problem is trivial compared to the issue I was seeing trying to port our code to JUCE2.0, which I am hoping the compiler upgrade fixes. That issue was that I have a class that derives from Slider, and when I initialized my member variables, they were overwriting the pimpl pointer in the Slider base class. A couple of days spinning my wheels on that one, and we decided to see if it was a compiler bug..

jules
Online
Last seen: 2 min 52 sec ago
Joined: 29 Apr 2013 - 18:37
Re: Problems with noexcept

cpr wrote:
I have wondered why no one else is reporting any problems, and I am hoping I am just doing something stupid, which the chance of is increased by the fact that I am importing my projects, and VS may have done some 'backwards compat' thing inside the project files. otoh, this problem is trivial compared to the issue I was seeing trying to port our code to JUCE2.0, which I am hoping the compiler upgrade fixes. That issue was that I have a class that derives from Slider, and when I initialized my member variables, they were overwriting the pimpl pointer in the Slider base class. A couple of days spinning my wheels on that one, and we decided to see if it was a compiler bug..

That doesn't sound like a compiler bug to me. More likely you've got more than one version of juce_slider.h, and are including the wrong one somewhere.

cpr
cpr's picture
Offline
Last seen: 14 hours 35 min ago
Joined: 25 Apr 2008 - 23:49
Re: Problems with noexcept

Sadly, it did not turn out to be a compiler bug, which would have made fixing it easy. Lol. Now I need to figure out why different pieces of code see the structure of this class differently (different versions of header, different structure packing, etc). All of which I thought I had checked for. The good news, for me, is that this code worked with the 1.4x codebase, so somehow thru the importing of my vs2005 projects, some settings (include paths, build options, etc) have caused this problem to appear. The other (probably a red hering) thing is that the slider class changed to using the pimpl, and we had made some modifications to allow access to some private members. But I just added some accessor functions to thee new slider class. Any methods of chasing this down would be appreciated. For example, I've used Process Monitor, from SysInternals, to verify that I am only including one copy of the juce_Slider header.

aaronleese
Offline
Last seen: 4 days 15 hours ago
Joined: 5 Feb 2009 - 17:52
Re: Problems with noexcept

Yeah. same issues here.

I just downloaded VS2012. For what it's worth, now it's free (the whole thing apparently, not just a crappy express version) and it seems to be a better program overall than vs2008 was (not saying much there though, still not as nice as xcode in most ways).

I set JUCE_COMPILER_SUPPORTS_NOEXCEPT to 0, but there seems to be plenty of other syntax bits that are not supported anymore (problems with undefined EMIT, errno_t, noreturn all pop up right away).

Using VS2012 with the 2010 toolset seems to work out ok at least.

ok - back to the salt mines.

Aaron Leese
StagecraftSoftware.com

Pages