title: Code::Blocks resource preprocessing error
body: <p>I am trying to add a resource file to include an icon for my win32 form application in Code::Blocks. I created the <code>resource.rc</code> file and added it to my project, and placed my icon in the root folder of the project (where the source files are), and I keep on receiving a preprocessing failed error.</p>
  
  <p>This is what my <code>resource.rc</code> file looks like</p>
  
  <pre><code>#ifndef _resource_rc
  #define _resource_rc
  
  MAINICON ICON "icon1.ico"
  
  #endif
  </code></pre>
  
  <p>My <code>main.cpp</code> file is just a untouched win32 form application, and the project itself is untouched besides adding the <code>resource.rc</code> file to the project.</p>
  
  <p>The build message error is </p>
  
  <pre><code>||preprocessing failed.|
  ||=== Build finished: 1 errors, 0 warnings ===|
  </code></pre>
  
  <p>And the build log is</p>
  
  <pre><code>gcc: Files\: No such file or directory
  gcc: \(x86\)\CodeBlocks\MinGW\include: No such file or directory
  windres.exe: preprocessing failed.
  Process terminated with status 1 (0 minutes, 0 seconds)
  1 errors, 0 warnings
  </code></pre>
  
  <p>I have checked to make sure where Code::Blocks is installed and it is located in <code>\Program Files(x86)\</code> where as it seems gcc is looking at a folder called <code>\(x86)\</code>. May this be the problem?</p>
  
  <p>If I remove the resource file, the application compiles and runs correctly.</p>
  
  <p>Thanks for any help.</p>
  
  <p>edit: I've enabled full compiler output and here is what is being ran:</p>
  
  <pre><code>windres.exe -i C:\Users\user\Desktop\MENOET~1\resource.rc -J rc -o obj\Debug\resource.res -O coff -I"C:\Program Files (x86)\CodeBlocks\MinGW\include" 
  gcc: Files\: No such file or directory
  gcc: \(x86\)\CodeBlocks\MinGW\include: No such file or directory
  windres.exe: preprocessing failed.
  Process terminated with status 1 (0 minutes, 0 seconds)
  1 errors, 0 warnings
  </code></pre>
  
  <p>What I've noticed is that MENOET~1 is some sort of abbreviated name of my project directory and that is not its actual name. Not sure if that has anything to do with it, and I cant seem to change it.</p>
  
  <p>edit2: I managed to fix it, but I rather not do it this way. What I did was copy MingGW to C:\ and then went Settings -> Compiler and debugger -> Search directories -> Resource compiler, and set that path to C:\MingGW\include. This allowed relieved all the errors and the build was successful, although I would much rather not have to have copies of MingGW in my root C:\ directory. Is there any way to fix this so it would work with the original path? I'd imagine it is just goofing up on the spaces in the file name, but I cant figure out where to find the build variables to insert quotes.</p>