I am using qtcreator to compile a large c++ project, the OS is windows, the compiler is visual studio.
There is an option in qtcreator to compile with jom instead of nmake, when it is activated the build of my project is 10 times faster.
I was used to compile this project in release mode with jom, but from weeks it doesn't work anymore. However I can still compile in debug mode with jom or in release mode with nmake.
When I use jom in release build, I get a same error multiple time : C1041 multiple cl.exe write to the same .pdb file. Use /FS
When I look in qt compile output, the commands which seem to create these errors are similar to this :
cl -c -wd4100 -wd4244 -wd4068 -wd4267 -utf-8 /we4715 -O2 -Zi -MD -EHsc -GR -W3 -w34100 -w34189 -w44996 -w44456 -w44457 -w44458 -wd4577 -wd4467 /FdC:/Users/fgodi/Desktop/release/lib64/boost_components.pdb -DUNICODE -D_UNICODE -DWIN32 -D_ENABLE_EXTENDED_ALIGNED_STORAGE -DWIN64 -DNDEBUG -D_REENTRANT -DHAVE_EIGEN -DEIGEN_DONT_PARALLELIZE -DHAVE_HDF5 -DWIN32_LEAN_AND_MEAN -DNOMINMAX -D_CRT_SECURE_NO_WARNINGS -D_SCL_SECURE_NO_WARNINGS -D_USE_DECLSPECS_FOR_SAL -DWINVER=0x0601 -D_WIN32_WINNT=0x0601 -D_SECURE_SCL=0 -D_ITERATOR_DEBUG_LEVEL=0 -DNDEBUG -DARCH_SSE2 -DBOOST_THREAD_PROVIDES_FUTURE -DBOOST_THREAD_VERSION=4 -DBOOST_THREAD_BUILD_LIB -DQT_QML_DEBUG -IC:\Users\fgodi\Desktop\release\src\boost -I. -IC:\Users\fgodi\Desktop\release\src\boost -IC:/Users/fgodi/Desktop/release/src/boost/.libs/boost/libs/math/src/tr1 -IC:\Users\fgodi\Desktop\release\src -IC:\Users\fgodi\Desktop\release\src\boost -IC:\Users\fgodi\Desktop\release\include -IC:\Users\fgodi\Desktop\release\src\eigen -IC:\Users\fgodi\Desktop\release\include\hdf5 -IC:\Qt\5.13.2\msvc2017_64\mkspecs\win32-msvc -Fobuild-msvc-64-release\ @C:\Users\fgodi\AppData\Local\Temp\global_resource.obj.9152.219.jom
global_resource.cpp
- I would like to add /FS in this command but I do not know where this command comes from, most of these options do not come from the .pro. If I add "OPTFLAGS += /FS" in the main .pro of the project, it doesn't change anything. Should I add "OPTFLAGS += /FS" in any .pro ?
- I am not even sure it will solve the problem because, for some reason, I can't just paste the command into command line and try to add the /FS to it. There are other errors when I try to do this, I added cl to my path but some other context is probably needed.
- I don't understand why suddenly I need this /FS while I have been compiling this project for months before without any problem.

You likely need
/FSdue to/Zi. There are two things you can try, either should work:QMAKE_CXXFLAGS *= /FS. Put it in your global compiler settings include, if you have one (tends to be a.prifile). Also, I have never seenOPTFLAGSused in the way you describe, onlyQMAKE_CXXFLAGS. Also, including it in just the main .pro won't do very much, as you observed./Zi. I haven't seen your .pro file but I assume you've included that flag from somewhere - it's generally not a default in release builds.Additional info: Your problem is a simple concurrency issue that arises in multithreaded builds. Sometimes you get lucky with your project structure and have no problems, but eventually you will get them.
Also a tip: Check the generated Makefile.Release for the compiler command line, this is usually quicker than trying to glean it from the compile log.