title: Why can't Visual Studio find my main function once I add an hlsl/fx file?
body: <p><em>Sidenode: I'm not asking anyone to help me with a directx tutorial. I think this error is a normal Visual Studio win32 API error.</em></p>
  <p>Hey guys and girls,
  I'm trying to learn some DirectX 11 for fun and I found those directx11 examples on github. Now I'm trying to understand each function and see how everything works together. I created a new VS project just to play around with stuff. I copy-pasted all of the code in Tutorial02.cpp into my own project, created a new filter called &quot;Shaders&quot; and changed the properties of my VS solution. At that point I don't have any problems to compile my code. Once I add the Tutorial02.fx, Tutorial02_VS.hlsl and Tutorial02_PS.hlsl to the solution VS can't compile and gives me the following error code:</p>
  <pre><code>X3501   'main': entrypoint not found    Project00   C:\Users\Meow\Desktop\directx-tests\Project00\Project00\Project00\FXC   1   
  </code></pre>
  <p>Github link (directx11 tutorial main file):<a href="https://github.com/walbourn/directx-sdk-samples/blob/master/Direct3D11Tutorials/Tutorial02/Tutorial02.cpp" rel="nofollow noreferrer">https://github.com/walbourn/directx-sdk-samples/blob/master/Direct3D11Tutorials/Tutorial02/Tutorial02.cpp</a></p>
  <p>What I did:</p>
  <ol>
  <li>I created a new VS project called Project00 in my directx-tests folder</li>
  <li>I created a new file called Source.cpp</li>
  <li>I copy-pasted everything from Tutorial02.ccp (github) into my Source.cpp</li>
  <li>I added the resource.h file to my project</li>
  <li>I added under &quot;Project00 -&gt; Properties -&gt; Linker -&gt; Input&quot; the same libs as the tutorial</li>
  </ol>
  <pre><code>d3d11.lib
  d3dcompiler.lib
  dxguid.lib
  winmm.lib
  comctl32.lib
  </code></pre>
  <ol start="6">
  <li>I changed under &quot;Properties -&gt; Link -&gt; System&quot; the SubSystem to Windows(:SUBSYSTEM/WINDOWS)</li>
  <li>I copy-pasted the .hlsl and .fx file/s into my project directory (didn't add it to the VS solution yet)
  At that point it works just fine. It compiles without a problem.</li>
  </ol>
  <p>But when I add the Tutorial02.fx, Tutorial02_VS.hlsl and Tutorial02_PS.hlsl to my Shader filter or any other filter and recompile visual studio tells me: 'main': entrypoint not found -- Once I remove (not delete) the files again it works just fine.</p>
  <p>Does anyone know why?</p>
  <p>(In the tutorial solution they add these files to the solution aswell and it works just fine)</p>