Building VSG on windows 11, with VS 2022

123 views
Skip to first unread message

Nay Lin

unread,
Mar 26, 2022, 11:36:23 PM3/26/22
to vsg-users : VulkanSceneGraph Developer Discussion Group
Hi all,

I tried to build VSG on windows and got error around two functions:

std::string debugFormatShaderSource (line 72 of ShaderCompiler.cpp)
std::string ShaderCompiler::combineSourceAndDefines (line 310 of ShaderCompiler.cpp)

Screenshots are attached. Pls may I know, what might be the cause of error.
I compile with C++ 17 switched on.
Thanks
NLin

debugFormatShaderSource.jpg
combineSourceAndDefines.jpg

"François Cami"

unread,
Mar 27, 2022, 6:34:57 AM3/27/22
to vsg-...@googlegroups.com
Hi,

On Sun, Mar 27, 2022 at 5:36 AM Nay Lin <nayli...@gmail.com> wrote:
>
> Hi all,
>
> I tried to build VSG on windows and got error around two functions:
>
> std::string debugFormatShaderSource (line 72 of ShaderCompiler.cpp)
> std::string ShaderCompiler::combineSourceAndDefines (line 310 of ShaderCompiler.cpp)
>
> Screenshots are attached.

Only one screenshot of the code itself was attached.

> Pls may I know, what might be the cause of error.

Please attach the build log showing all errors (find the first one).
Please also note that I'm replying to help you complete your request
but I don't use Windows/VS at all.

François

> I compile with C++ 17 switched on.
> Thanks
> NLin
>
>
> --
> You received this message because you are subscribed to the Google Groups "vsg-users : VulkanSceneGraph Developer Discussion Group" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to vsg-users+...@googlegroups.com.
> To view this discussion on the web, visit https://groups.google.com/d/msgid/vsg-users/161c612c-74bc-4d5c-a9d9-1ed0e586ee6an%40googlegroups.com.

Nay Lin

unread,
Mar 27, 2022, 9:55:12 AM3/27/22
to vsg-users : VulkanSceneGraph Developer Discussion Group
Hi,
Thanks for the help.
Below is the error list from VC++.

Severity        Code        Description        Project        File        Line        Suppression State
Error (active)        E0070        incomplete type is not allowed        vsg        E:\Libs\VulkanSceneGraph\src\vsg\vk\ShaderCompiler.cpp        74        
Error (active)        E0070        incomplete type is not allowed        vsg        E:\Libs\VulkanSceneGraph\src\vsg\vk\ShaderCompiler.cpp        75        
Error (active)        E0304        no instance of overloaded function "std::getline" matches the argument list        vsg        E:\Libs\VulkanSceneGraph\src\vsg\vk\ShaderCompiler.cpp        79        
Error (active)        E0349        no operator "<<" matches these operands        vsg        E:\Libs\VulkanSceneGraph\src\vsg\vk\ShaderCompiler.cpp        81        
Error (active)        E3365        incomplete class type "std::basic_ostringstream<char, std::char_traits<char>, std::allocator<char>>" is not allowed        vsg        E:\Libs\VulkanSceneGraph\src\vsg\vk\ShaderCompiler.cpp        84        
Error (active)        E0349        no operator "<<" matches these operands        vsg        E:\Libs\VulkanSceneGraph\src\vsg\vk\ShaderCompiler.cpp        374        
Error (active)        E0070        incomplete type is not allowed        vsg        E:\Libs\VulkanSceneGraph\src\vsg\vk\ShaderCompiler.cpp        377        
Error (active)        E0070        incomplete type is not allowed        vsg        E:\Libs\VulkanSceneGraph\src\vsg\vk\ShaderCompiler.cpp        378        
Error (active)        E0070        incomplete type is not allowed        vsg        E:\Libs\VulkanSceneGraph\src\vsg\vk\ShaderCompiler.cpp        379        
Error (active)        E0304        no instance of overloaded function "std::getline" matches the argument list        vsg        E:\Libs\VulkanSceneGraph\src\vsg\vk\ShaderCompiler.cpp        386        
Error (active)        E3365        incomplete class type "std::basic_ostringstream<char, std::char_traits<char>, std::allocator<char>>" is not allowed        vsg        E:\Libs\VulkanSceneGraph\src\vsg\vk\ShaderCompiler.cpp        425        
Error (active)        E3365        incomplete class type "std::basic_ostringstream<char, std::char_traits<char>, std::allocator<char>>" is not allowed        vsg        E:\Libs\VulkanSceneGraph\src\vsg\vk\ShaderCompiler.cpp        425       

All errors are in ShaderCompiler.cpp

Thanks in advance
NayLin

Robert Osfield

unread,
Mar 27, 2022, 10:40:47 AM3/27/22
to vsg-users : VulkanSceneGraph Developer Discussion Group
Hi Naylin,

I don't use Windows so can test out myself.  From the "incomplete type is not allowed" warning on use of std::istringstream + ostringstream classes my best guess is that VisualStudio has moved these classes so now one needs to include them in a different way.

Could you look to see what is the recommend included for these classes with VisualStudio 2022?

Cheers,
Robert.

Robert Osfield

unread,
Mar 27, 2022, 11:11:04 AM3/27/22
to vsg-users : VulkanSceneGraph Developer Discussion Group
HI Naylin

Looking at the various includes and the class that is failing to compile it looks like the VisualStudio 2022 now requires the sstream header to be included so I've checked this into VSG master.  Could you please test VSG master to see if this resolves the issue.

$ git diff
diff --git a/src/vsg/vk/ShaderCompiler.cpp b/src/vsg/vk/ShaderCompiler.cpp
index 5ee97de8..3551c59b 100644
--- a/src/vsg/vk/ShaderCompiler.cpp
+++ b/src/vsg/vk/ShaderCompiler.cpp
@@ -27,6 +27,7 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
 
#include <algorithm>
#include <iomanip>
+#include <sstream>
#include <iostream>
 
#if VK_VERSION_1_1 == 1


Nay Lin

unread,
Mar 27, 2022, 11:11:46 AM3/27/22
to vsg-users : VulkanSceneGraph Developer Discussion Group
Hi
Thanks for help. I just included <string> and it finished the build.

Thanks
NayLin

Nay Lin

unread,
Mar 27, 2022, 11:14:23 AM3/27/22
to vsg-users : VulkanSceneGraph Developer Discussion Group
Sorry, it is <sstream> that solves the issue.

Best regards
NayLin
Reply all
Reply to author
Forward
0 new messages