title: Error building wxWidgets using -j (jobs) option with MinGW
body: <p>I'm compiling WxWidgets for Windows using the following command line:</p>
  
  
  
  <pre class="lang-none prettyprint-override"><code>mingw32-make -f makefile.gcc BUILD=release SHARED=1 -j6
  </code></pre>
  
  <p>The last parameter (<code>-j</code>) is used to speed up the compilation by running <a href="https://www.gnu.org/software/make/manual/html_node/Parallel.html#Parallel" rel="nofollow">multiple jobs in parallel</a>, in my case making full use of my 6-core processor. A single-threaded build normally takes <em>very</em> long.</p>
  
  <p>However, I get the following output when hitting Enter:</p>
  
  <pre class="lang-none prettyprint-override"><code>if not exist gcc_mswudll mkdir gcc_mswudll
  if not exist ..\..\lib\gcc_dll mkdir ..\..\lib\gcc_dll
  if not exist ..\..\lib\gcc_dll\mswu\wx\setup.h copy ..\..\include\wx\msw\setup.h ..\..\lib\gcc_dll\mswu\wx\setup.h
  gcc -c -o gcc_mswudll\wxregex_regcomp.o  -O2 -mthreads  -DHAVE_W32API_H -DNDEBUG -I..\..\include -I..\..\lib\gcc_dll\msw
  u -D__WXMSW__  -D_UNICODE   -MTgcc_mswudll\wxregex_regcomp.o -MFgcc_mswudll\wxregex_regcomp.o.d -MD -MP ../../src/regex/
  regcomp.c
  The system can not find the path specified.
          0 file(s) copied.
  makefile.gcc:5651: recipe for target '..\..\lib\gcc_dll\mswu\wx\setup.h' failed
  mingw32-make: *** [..\..\lib\gcc_dll\mswu\wx\setup.h] Error 1
  mingw32-make: *** Waiting for unfinished jobs....
  In file included from ..\..\include/wx/defs.h:27:0,
                   from ../../src/regex/regcustom.h:39,
                   from ../../src/regex/regguts.h:38,
                   from ../../src/regex/regcomp.c:33:
  ..\..\include/wx/platform.h:183:22: fatal error: wx/setup.h: No such file or directory
   #include "wx/setup.h"
                        ^
  compilation terminated.
  makefile.gcc:5702: recipe for target 'gcc_mswudll\wxregex_regcomp.o' failed
  mingw32-make: *** [gcc_mswudll\wxregex_regcomp.o] Error 1
  </code></pre>
  
  <p>Then, if I just repeat the same command a second time, the following output is shown:</p>
  
  <pre class="lang-none prettyprint-override"><code>if not exist ..\..\lib\gcc_dll\mswu mkdir ..\..\lib\gcc_dll\mswu
  if not exist ..\..\lib\gcc_dll\mswu\wx\setup.h copy ..\..\include\wx\msw\setup.h ..\..\lib\gcc_dll\mswu\wx\setup.h
  gcc -c -o gcc_mswudll\wxregex_regcomp.o  -O2 -mthreads  -DHAVE_W32API_H -DNDEBUG -I..\..\include -I..\..\lib\gcc_dll\msw
  u -D__WXMSW__  -D_UNICODE   -MTgcc_mswudll\wxregex_regcomp.o -MFgcc_mswudll\wxregex_regcomp.o.d -MD -MP ../../src/regex/
  regcompThe system can not find the path specified.
  .c
          0 file(s) copied.
  makefile.gcc:5651: recipe for target '..\..\lib\gcc_dll\mswu\wx\setup.h' failed
  mingw32-make: *** [..\..\lib\gcc_dll\mswu\wx\setup.h] Error 1
  mingw32-make: *** Waiting for unfinished jobs....
  In file included from ..\..\include/wx/defs.h:27:0,
                   from ../../src/regex/regcustom.h:39,
                   from ../../src/regex/regguts.h:38,
                   from ../../src/regex/regcomp.c:33:
  ..\..\include/wx/platform.h:183:22: fatal error: wx/setup.h: No such file or directory
   #include "wx/setup.h"
                        ^
  compilation terminated.
  makefile.gcc:5702: recipe for target 'gcc_mswudll\wxregex_regcomp.o' failed
  mingw32-make: *** [gcc_mswudll\wxregex_regcomp.o] Error 1
  </code></pre>
  
  <p>Then... If I try a third time, the compilation finishes successfully.</p>
  
  <p><strong>Question:</strong> Is it ok to follow this procedure to build WxWidgets in parallel, or is there a possibility that it will lead to problems when using the compiled binaries later on?</p>