locked
Building sdl with clang RRS feed

  • Question

  • Hello.

    I'm learning sdl and I'm using Visual Studio 2015 update 1. Recently I've move to clang compiler and now sdl is of course not compatible. I wanted to build the library as they suggest, just open *.sln file (from VS10, which was upgraded by my VS15) and build the project, I changed platform toolset to clang, but it didn't work. I can build it with visual c++ compiler, but with clang I get that error: 


    1>C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V140\Microsoft.Cpp.Clang.targets(206,5): error : Element <DebugInformationFormat> has an invalid value of "OldStyle".


    How would I build the library with clang?

    Thanks.
    • Edited by TheHardew Saturday, January 9, 2016 10:31 AM
    Saturday, January 9, 2016 10:30 AM

All replies

  • Hello.

    I'm learning sdl and I'm using Visual Studio 2015 update 1. Recently I've move to clang compiler and now sdl is of course not compatible. I wanted to build the library as they suggest, just open *.sln file (from VS10, which was upgraded by my VS15) and build the project, I changed platform toolset to clang, but it didn't work. I can build it with visual c++ compiler, but with clang I get that error: 


    1>C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V140\Microsoft.Cpp.Clang.targets(206,5): error : Element <DebugInformationFormat> has an invalid value of "OldStyle".


    How would I build the library with clang?

    Thanks.

    Yes, this happened to me also. In my case I just wanted to compile my code using Clang as a test of code compliance, so I just went to Project Settings->C/C++ General and changed Debug Information Format to None.


    David Wilkinson | Visual C++ MVP

    • Proposed as answer by Hart Wang Monday, February 1, 2016 8:01 AM
    Saturday, January 9, 2016 10:57 AM
  • It helped, but now I get error: 1>C:\Users\Piotrek\Desktop\SDL2-2.0.4\VisualC\SDL\/../../include/SDL_stdinc.h(363,13): error : GNU-style inline assembly is disabled.
    Saturday, January 9, 2016 11:06 AM
  • I think I might just give up, enabling clang doesn't disable _MSC_VER, so the file is compiled as it if I used visual c++ compiler and not clang.
    Saturday, January 9, 2016 11:14 AM
  • Which type of project do you create? I have create a win32 project and choose the Clang 3.7 tool set. It didn't come the error. Is there something wrong when you move the project( from VS10, which was upgraded by my VS15) to clang?
    • Proposed as answer by Hart Wang Monday, February 1, 2016 1:38 AM
    Tuesday, January 12, 2016 10:10 AM