Visual Studio 11 support?

For Windows specific issues

Visual Studio 11 support?

Postby Tsury » Wed Feb 29, 2012 10:03 pm

Has someone managed to compile JuceDemo under Visual Studio 11?
I am getting these errors:

Error 13 error C1189: #error : keyword defined before including C++ standard header c:\program files (x86)\microsoft visual studio 11.0\vc\include\xkeycheck.h 124

I know its not officially supported, I was just messing with it.
User avatar
Tsury
JUCE Obsessive
 
Posts: 96
Joined: Thu May 12, 2011 7:18 pm

Re: Visual Studio 11 support?

Postby jules » Wed Feb 29, 2012 10:22 pm

There's no reason why it wouldn't work. That error has nothing to do with juce though, it's an MS header file!
User avatar
jules
Fearless Leader
 
Posts: 17218
Joined: Mon Sep 06, 2004 9:03 am
Location: London, UK

Re: Visual Studio 11 support?

Postby Tsury » Wed Feb 29, 2012 10:49 pm

http://www.itk.org/pipermail/insight-us ... 43177.html

It seems like this header file checks for redefinition of reserved words; maybe Microsoft added more words to that list?
Here's a paste of the relevant part: http://pastebin.com/xrZSrpES

Edit:Found the culprit in juce_PlatformDefs.h:
Code: Select all
#if ! (DOXYGEN || JUCE_COMPILER_SUPPORTS_NOEXCEPT)
#define noexcept  throw()
#endif


Also in stream_decoder.cpp:
Code: Select all
#if _MSC_VER <= 1600 || defined __BORLANDC__ /* @@@ [2G limit] */
#define fseeko fseek
#define ftello ftell
#endif

_MSC_VER is now 1700...

Also, before you can even try to build, this is what happens:

Code: Select all
C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V110\Microsoft.Cpp.Platform.targets(34,5): error MSB8020: The builds tools for Visual Studio 2010 (Platform Toolset = 'v100') cannot be found. To build using the v100 build tools, either click the Project menu or right-click the solution, and then select "Update VC++ Projects...". Install Visual Studio 2010 to build using the Visual Studio 2010 build tools.


To resolve this issue you can either 'Update VC++ Projects' or just install Visual Studio 2010.
If you choose the option of installing Visual Studio 2010, it will compile, but when trying to start the compiled product, I get this messagebox:

Code: Select all
---------------------------
Microsoft Visual Studio
---------------------------
Unable to cast object of type 'Microsoft.VisualStudio.Project.ConfiguredProjectCache`1[Microsoft.VisualStudio.Project.Immutables.ImmutableHashMap`2[System.String,System.Threading.Tasks.Task`1[Microsoft.VisualStudio.Project.PropertyPages.PropertyPagesCatalog]]]' to type 'Microsoft.VisualStudio.Project.ConfiguredProjectCache`1[Microsoft.VisualStudio.Project.Immutables.ImmutableHashMap`2[System.String,Microsoft.VisualStudio.Project.PropertyPages.PropertyPagesCatalog]]'.
---------------------------
OK   
---------------------------

Probably some incompatibility between VS11 debugger and VS10 build tools.

I upgraded the projects and now I have JuceDemo running under Visual Studio 11 and Windows 8 Consumer Preview :)
User avatar
Tsury
JUCE Obsessive
 
Posts: 96
Joined: Thu May 12, 2011 7:18 pm

Re: Visual Studio 11 support?

Postby Tsury » Thu Mar 01, 2012 1:18 am

To sum it up for future IntroJucer compatibility:
  1. in juce_PlatformDefs.h, change the line
    Code: Select all
    #if ! (DOXYGEN || JUCE_COMPILER_SUPPORTS_NOEXCEPT)
    to
    Code: Select all
    #if ! ((DOXYGEN || JUCE_COMPILER_SUPPORTS_NOEXCEPT) && _MSC_VER < 1700)
  2. in stream_decoder.cpp change line
    Code: Select all
    #if _MSC_VER <= 1600 || defined __BORLANDC__ /* @@@ [2G limit] */
    to
    Code: Select all
    #if _MSC_VER <= 1700 || defined __BORLANDC__ /* @@@ [2G limit] */
  3. Produce vcxproj files which uses build tools v110 (have no idea how to do it but I figure you've got a clue).

This should probably be enough :)
User avatar
Tsury
JUCE Obsessive
 
Posts: 96
Joined: Thu May 12, 2011 7:18 pm

Re: Visual Studio 11 support?

Postby jules » Thu Mar 01, 2012 10:01 am

Thanks!

The whole point of that JUCE_COMPILER_SUPPORTS_NOEXCEPT flag is to detect whether noexcept is a keyword, so it'd be better to actually set the flag correctly! e.g. in juce_PlatformDefs.h, line 300:

Code: Select all
#if defined (_MSC_VER) && _MSC_VER >= 1600
#if _MSC_VER >= 1700
  #define JUCE_COMPILER_SUPPORTS_NOEXCEPT 1
#else
  #define JUCE_COMPILER_SUPPORTS_NOEXCEPT 0
#endif
#define JUCE_COMPILER_SUPPORTS_NULLPTR 1
#define JUCE_COMPILER_SUPPORTS_MOVE_SEMANTICS 1
#endif


?

But the changes to stream_decoder look sensible, thanks!
User avatar
jules
Fearless Leader
 
Posts: 17218
Joined: Mon Sep 06, 2004 9:03 am
Location: London, UK

Re: Visual Studio 11 support?

Postby Tsury » Thu Mar 01, 2012 11:31 am

No problem. I will update the NOEXCEPT part.
Any chance of seeing IntroJucer support anytime soon?
User avatar
Tsury
JUCE Obsessive
 
Posts: 96
Joined: Thu May 12, 2011 7:18 pm

Re: Visual Studio 11 support?

Postby jules » Thu Mar 01, 2012 11:52 am

Tsury wrote:Any chance of seeing IntroJucer support anytime soon?


I'll support it soonish, but doesn't it import the VS2010 projects?
User avatar
jules
Fearless Leader
 
Posts: 17218
Joined: Mon Sep 06, 2004 9:03 am
Location: London, UK

Re: Visual Studio 11 support?

Postby Tsury » Thu Mar 01, 2012 12:07 pm

It does, but I want to work with someone who uses VS10 and the Upgrade VC++ Projects changes them to require VS11.
User avatar
Tsury
JUCE Obsessive
 
Posts: 96
Joined: Thu May 12, 2011 7:18 pm

Re: Visual Studio 11 support?

Postby abudaan » Fri Mar 23, 2012 9:56 pm

I ran into the same issue with VS11:

#error : keyword defined before including C++ standard header c:\program files (x86)\microsoft visual studio 11.0\vc\include\xkeycheck.h 124

and i solved in a very blunt way by just commenting out line 90 in xkeycheck.h

After that the JuceBrowserPluginDemo compiled just fine.


But other projects gave a huge amount of these error messages:

error C3646: 'noexcept' : unknown override specifier


So i added the line "#define noexcept throw()" in juce_PlatformDefs.h at line 302

Here is the code starting from line 300:

Code: Select all
#if defined (_MSC_VER) && _MSC_VER >= 1600
#if _MSC_VER >= 1700
  #define noexcept  throw()
  #define JUCE_COMPILER_SUPPORTS_NOEXCEPT 1
#else
  #define JUCE_COMPILER_SUPPORTS_NOEXCEPT 0
#endif
#define JUCE_COMPILER_SUPPORTS_NULLPTR 1
#define JUCE_COMPILER_SUPPORTS_MOVE_SEMANTICS 1
#endif
abudaan
JUCE Weenie
 
Posts: 1
Joined: Fri Mar 23, 2012 9:49 pm


Return to Windows

Who is online

Users browsing this forum: No registered users and 1 guest