# One build error C1001 using Visual Studio 2015



## Adrian Schofield (May 10, 2016)

Hi All

New to this so apologies if I'm asking a daft question.  Basically I have OBS Studio building apart from one error:

Error    C1001    An internal error has occurred in the compiler.    graphics-hook    E:\obsbuild\obs-studio\plugins\win-capture\graphics-hook\d3d9-capture.cpp    65   

The code it fires on is this line here:

static struct d3d9_data data = {};

I've had a dig around and it seems that C1001 is usually thrown because an optimization is being enabled but to my untrained eye I think the project has optimizations all disabled.

Any thoughts on what I am missing here?


----------



## Adrian Schofield (May 12, 2016)

OK bit of an update I have tried this with 32 bit as well and I get the same problem.

My DepsPath is pointing here: E:/obsbuild/deps/win32/include
My QTDIR is pointing here: E:/obsbuild/Qt/5.6/msvc2015

Or 64 bit equivalents.

I also tried a Release build Win32 and got the same error.

Now I am expecting that I've made a mistake somewhere in the configuration. I am using Visual Studio 2015 Community with Update 2 and as far as I can tell that's the latest released compiler.

Any thoughts.


----------



## Birdboat (May 13, 2016)

Try 2013, if you can, I find that VS 2015 often spouted odd bugs that VS 2013 didn't


----------



## Adrian Schofield (May 13, 2016)

Thanks @Birdboat I got around to trying that this morning and it works fine at least that tells me I have got my configuration right :-)  I'd really like to get this working in 2015 though so if anyone has any ideas please do let me know.


----------



## ZeroWalker (May 14, 2016)

i would like to get it working on VS2015 as well, just ran into this issue:)


----------



## Birdboat (May 15, 2016)

I believe I have a solution, in "d3d9-capture.cpp" replace

https://gist.github.com/Birdboat/1ff53064f81f482ff4fa1dc706ff56d6

with

https://gist.github.com/Birdboat/3712cbda4506699fc51afa3bb9cda987

Note that the changes are adding an explicit constructor along with removing the initialize brackets.

Please try it and get back to me.


----------



## llance (May 17, 2016)

Birdboat. Your changes fixed the internal compiler error for me on VS2015 Community Edition.


----------



## Adrian Schofield (May 18, 2016)

I concur works for me as well thanks very much @Birdboat


----------



## Jim (Jun 1, 2016)

This is fixed on latest master -- sorry it took so long.


----------

