[CONNECT bmake] Resource Compiler Cannot write to output file

My C++ project that built successfully yesterday fails to build today.  Something's happened to affect rlib.exe. There was an automatic Windows update between good results and bad results.

I opened instead the Basic Dialog Box example, which remains as delivered by the SDK.  Most of the build succeeds.  It's the last part, where rlib is merging resources into the .ma file, that fails...

[== Building G:\PROGRA~1\Bentley\MICROS~2\MICROS~1\mdlapps\basic.ma, (G:\PROGRA~1\Bentley\MICROS~2\SDK\reqdobjs\basic.mi) ==]
rlib @G:\PROGRA~1\Bentley\MICROS~2\SDK\rscobj\make.opt
### Error: File=(G:\PROGRA~1\Bentley\MICROS~2\SDK\reqdobjs\basic.mi), 
		 Type=('MDLn'), RscId=(1), status = (-902)
... many more similar lines
### Error: File=(G:\PROGRA~1\Bentley\MICROS~2\SDK\rscobj\basicmsg.rsc), 
		 Type=('dDef'), RscId=('str#'), status = (-902)
### Cannot write to output file: G:\PROGRA~1\Bentley\MICROS~2\MICROS~1\mdlapps\basic.ma
### Data was saved to a file called: G:\PROGRA~1\Bentley\MICROS~2\MICROS~1\mdlapps\basic.tmp

What is rlib error -902?  It says it cannot write to basic.ma, but I'm doing nothing with that file — MicroStation is not open.  It also tells me that it saved to basic.tmp instead — but that file doesn't exist.

Here's the log of the build:

Tool Output.txt
Bentley Systems Make Utility. Version 10.00.00.26, Mar 15 2018
Sun Oct 18 14:47:05 2020


D:\temp\getucrtversion2017.bat




[== Building G:\PROGRA~1\Bentley\MICROS~2\SDK\objects\basiccmd.h, (G:\PROGRA~1\Bentley\MICROS~2\SDK\examples\DialogBoxes\BasicDialogBox\basiccmd.r) ==]
rcomp @G:\PROGRA~1\Bentley\MICROS~2\SDK\objects\make.opt
MicroStation Resource Compiler 03.19.02
   Generating header file (G:\PROGRA~1\Bentley\MICROS~2\SDK\objects\basiccmd.h) ... done.

[== Building G:\PROGRA~1\Bentley\MICROS~2\SDK\objects\basiccmd.rsc, (G:\PROGRA~1\Bentley\MICROS~2\SDK\examples\DialogBoxes\BasicDialogBox\basiccmd.r) ==]
rcomp @G:\PROGRA~1\Bentley\MICROS~2\SDK\objects\make.opt
MicroStation Resource Compiler 03.19.02

[== Building G:\PROGRA~1\Bentley\MICROS~2\SDK\objects\basictyp.r, (G:\PROGRA~1\Bentley\MICROS~2\SDK\examples\DialogBoxes\BasicDialogBox\basictyp.mt) ==]
rsctype @G:\PROGRA~1\Bentley\MICROS~2\SDK\objects\make.opt
MicroStation Type Resource File Generator 03.19.02

[== Building G:\PROGRA~1\Bentley\MICROS~2\SDK\objects\basictyp.rsc, (G:\PROGRA~1\Bentley\MICROS~2\SDK\objects\basictyp.r) ==]
rcomp @G:\PROGRA~1\Bentley\MICROS~2\SDK\objects\make.opt
MicroStation Resource Compiler 03.19.02

[== Building G:\PROGRA~1\Bentley\MICROS~2\SDK\objects\basic.obj, (G:\PROGRA~1\Bentley\MICROS~2\SDK\examples\DialogBoxes\BasicDialogBox\basic.cpp) ==]
cl -IG:\PROGRA~1\Bentley\MICROS~2\SDK\include\ -IG:\PROGRA~1\Bentley\MICROS~2\SDK\mki\    -fp:precise -GS- -EHc -GR -wd4345 -GF -favor:blend -D_X64_ -wd4701 -wd4244 -wd4564 -wd4840 -wd4702 -c -W4 -DBENTLEY_WARNINGS_HIGHEST_LEVEL -DWIN32 -DwinNT -MD -D__EXCEPTIONS -D_VISCXX -Gy -wd4996 -Ox -Oy- -Os -D_CONVERSION_DONT_USE_THREAD_LOCALE -D_SECURE_SCL=0 -DWIN32_LEAN_AND_MEAN  -DNTDDI_WIN7SP1=0x06010100 -we4692  -nologo -WX -MP -Zi -Zo -FdG:\PROGRA~1\Bentley\MICROS~2\SDK\objects\objects.pdb    -EHs   -fp:precise -FoG:\PROGRA~1\Bentley\MICROS~2\SDK\objects\basic.obj G:\PROGRA~1\Bentley\MICROS~2\SDK\examples\DialogBoxes\BasicDialogBox\basic.cpp 
basic.cpp

[== Building "G:\PROGRA~1\Bentley\MICROS~2\MICROS~1\mdlapps\basic.dll", (G:\PROGRA~1\Bentley\MICROS~2\SDK\objects\basic.obj) ==]
link -out:"G:\PROGRA~1\Bentley\MICROS~2\MICROS~1\mdlapps\basic.dll"  -WX   -Ignore:4087 -Ignore:4089 -Ignore:4199 -Ignore:4281 -MANIFESTUAC:NO -Release   -debug -incremental:no -fixed:no @G:\PROGRA~1\Bentley\MICROS~2\SDK\objects\basiclink.rsp
Microsoft (R) Incremental Linker Version 14.16.27038.0
Copyright (C) Microsoft Corporation.  All rights reserved.

-dynamicbase 
-dll 
"-out:G:\PROGRA~1\Bentley\MICROS~2\MICROS~1\mdlapps\basic.dll" 
"-implib:G:\PROGRA~1\Bentley\MICROS~2\SDK\objects\basic.lib" 
"-pdb:G:\PROGRA~1\Bentley\MICROS~2\MICROS~1\mdlapps\basic.pdb" 
-fixed:no 
G:\PROGRA~1\Bentley\MICROS~2\SDK\objects\basic.obj G:\PROGRA~1\Bentley\MICROS~2\SDK\library\BentleyAllocator.lib gdi32.lib user32.lib kernel32.lib "G:\PROGRA~2\VI44E1~1\VC\Tools\MSVC\14.16.27023\lib\x64\msvcrt.lib" 
G:\PROGRA~1\Bentley\MICROS~2\SDK\library\mdlbltin.lib 
   Creating library G:\PROGRA~1\Bentley\MICROS~2\SDK\objects\basic.lib and object G:\PROGRA~1\Bentley\MICROS~2\SDK\objects\basic.exp

[== Building G:\PROGRA~1\Bentley\MICROS~2\SDK\reqdobjs\basic.mi, (G:\PROGRA~1\Bentley\MICROS~2\SDK\objects\basiccmd.rsc) ==]
rlib @G:\PROGRA~1\Bentley\MICROS~2\SDK\objects\make.opt
MicroStation Resource Librarian 03.19.02

[== Building G:\PROGRA~1\Bentley\MICROS~2\SDK\rscobj\basic.rsc, (G:\PROGRA~1\Bentley\MICROS~2\SDK\examples\DialogBoxes\BasicDialogBox\basic.r) ==]
rcomp @G:\PROGRA~1\Bentley\MICROS~2\SDK\objects\make.opt
MicroStation Resource Compiler 03.19.02

[== Building G:\PROGRA~1\Bentley\MICROS~2\SDK\rscobj\basicmsg.rsc, (G:\PROGRA~1\Bentley\MICROS~2\SDK\examples\DialogBoxes\BasicDialogBox\transkit\basicmsg.r) ==]
rcomp @G:\PROGRA~1\Bentley\MICROS~2\SDK\objects\make.opt
MicroStation Resource Compiler 03.19.02

[== Building G:\PROGRA~1\Bentley\MICROS~2\MICROS~1\mdlapps\basic.ma, (G:\PROGRA~1\Bentley\MICROS~2\SDK\reqdobjs\basic.mi) ==]
rlib @G:\PROGRA~1\Bentley\MICROS~2\SDK\rscobj\make.opt
### Error: File=(G:\PROGRA~1\Bentley\MICROS~2\SDK\reqdobjs\basic.mi), 
		 Type=('MDLn'), RscId=(1), status = (-902)
### Error: File=(G:\PROGRA~1\Bentley\MICROS~2\SDK\reqdobjs\basic.mi), 
		 Type=('CmdT'), RscId=(1), status = (-902)
### Error: File=(G:\PROGRA~1\Bentley\MICROS~2\SDK\reqdobjs\basic.mi), 
		 Type=('CEna'), RscId=(0), status = (-902)
### Error: File=(G:\PROGRA~1\Bentley\MICROS~2\SDK\reqdobjs\basic.mi), 
		 Type=('CEna'), RscId=(1), status = (-902)
### Error: File=(G:\PROGRA~1\Bentley\MICROS~2\SDK\reqdobjs\basic.mi), 
		 Type=('CEna'), RscId=(2), status = (-902)
### Error: File=(G:\PROGRA~1\Bentley\MICROS~2\SDK\reqdobjs\basic.mi), 
		 Type=('CEst'), RscId=(1), status = (-902)
### Error: File=(G:\PROGRA~1\Bentley\MICROS~2\SDK\reqdobjs\basic.mi), 
		 Type=('CEty'), RscId=(0), status = (-902)
### Error: File=(G:\PROGRA~1\Bentley\MICROS~2\SDK\reqdobjs\basic.mi), 
		 Type=('CEty'), RscId=(1), status = (-902)
### Error: File=(G:\PROGRA~1\Bentley\MICROS~2\SDK\reqdobjs\basic.mi), 
		 Type=('CEme'), RscId=(0), status = (-902)
### Error: File=(G:\PROGRA~1\Bentley\MICROS~2\SDK\reqdobjs\basic.mi), 
		 Type=('dDef'), RscId=('CEme'), status = (-902)
### Error: File=(G:\PROGRA~1\Bentley\MICROS~2\SDK\reqdobjs\basic.mi), 
		 Type=('dDef'), RscId=('CEna'), status = (-902)
### Error: File=(G:\PROGRA~1\Bentley\MICROS~2\SDK\reqdobjs\basic.mi), 
		 Type=('dDef'), RscId=('CEst'), status = (-902)
### Error: File=(G:\PROGRA~1\Bentley\MICROS~2\SDK\reqdobjs\basic.mi), 
		 Type=('dDef'), RscId=('CEty'), status = (-902)
### Error: File=(G:\PROGRA~1\Bentley\MICROS~2\SDK\reqdobjs\basic.mi), 
		 Type=('dDef'), RscId=('CmdT'), status = (-902)
### Error: File=(G:\PROGRA~1\Bentley\MICROS~2\SDK\reqdobjs\basic.mi), 
		 Type=('dDef'), RscId=('MDLn'), status = (-902)
### Error: File=(G:\PROGRA~1\Bentley\MICROS~2\SDK\rscobj\basic.rsc), 
		 Type=('dBox'), RscId=(1), status = (-902)
### Error: File=(G:\PROGRA~1\Bentley\MICROS~2\SDK\rscobj\basic.rsc), 
		 Type=('dBox'), RscId=(2), status = (-902)
### Error: File=(G:\PROGRA~1\Bentley\MICROS~2\SDK\rscobj\basic.rsc), 
		 Type=('dTxt'), RscId=(1), status = (-902)
### Error: File=(G:\PROGRA~1\Bentley\MICROS~2\SDK\rscobj\basic.rsc), 
		 Type=('oBtn'), RscId=(1), status = (-902)
### Error: File=(G:\PROGRA~1\Bentley\MICROS~2\SDK\rscobj\basic.rsc), 
		 Type=('pBtn'), RscId=(1), status = (-902)
### Error: File=(G:\PROGRA~1\Bentley\MICROS~2\SDK\rscobj\basic.rsc), 
		 Type=('tBtn'), RscId=(1), status = (-902)
### Error: File=(G:\PROGRA~1\Bentley\MICROS~2\SDK\rscobj\basic.rsc), 
		 Type=('syns'), RscId=(1), status = (-902)
### Error: File=(G:\PROGRA~1\Bentley\MICROS~2\SDK\rscobj\basic.rsc), 
		 Type=('dDef'), RscId=('dBox'), status = (-902)
### Error: File=(G:\PROGRA~1\Bentley\MICROS~2\SDK\rscobj\basic.rsc), 
		 Type=('dDef'), RscId=('dTxt'), status = (-902)
### Error: File=(G:\PROGRA~1\Bentley\MICROS~2\SDK\rscobj\basic.rsc), 
		 Type=('dDef'), RscId=('oBtn'), status = (-902)
### Error: File=(G:\PROGRA~1\Bentley\MICROS~2\SDK\rscobj\basic.rsc), 
		 Type=('dDef'), RscId=('pBtn'), status = (-902)
### Error: File=(G:\PROGRA~1\Bentley\MICROS~2\SDK\rscobj\basic.rsc), 
		 Type=('dDef'), RscId=('syns'), status = (-902)
### Error: File=(G:\PROGRA~1\Bentley\MICROS~2\SDK\rscobj\basic.rsc), 
		 Type=('dDef'), RscId=('tBtn'), status = (-902)
### Error: File=(G:\PROGRA~1\Bentley\MICROS~2\SDK\rscobj\basicmsg.rsc), 
		 Type=('str#'), RscId=(1), status = (-902)
### Error: File=(G:\PROGRA~1\Bentley\MICROS~2\SDK\rscobj\basicmsg.rsc), 
		 Type=('dDef'), RscId=('str#'), status = (-902)
### Cannot write to output file: G:\PROGRA~1\Bentley\MICROS~2\MICROS~1\mdlapps\basic.ma
### Data was saved to a file called: G:\PROGRA~1\Bentley\MICROS~2\MICROS~1\mdlapps\basic.tmp
MicroStation Resource Librarian 03.19.02
Sun Oct 18 14:47:16 2020, elapsed time: 0:11
BMAKE: file [G:\PROGRA~1\Bentley\MICROS~2\MICROS~1\mdlapps\basic.ma] may be incomplete
BMAKE: call trace
    line:  102, G:\Program Files\Bentley\MicroStation CONNECT Edition\SDK\examples\DialogBoxes\BasicDialogBox\BasicDialogBox.mke

Tool completed with exit code 1

  • This has something to do with Windows Admin rights on the ..\MicroStation\mdlapps folder.  The Windows update changed the rights on that drive or folder (It's my alternative Program Files folder).  If I use the SDK command shell as Admin, then everything builds OK. 

    Watch out for Windows automatic updates!

     
    Regards, Jon Summers
    LA Solutions

    Answer Verified By: Jon Summers 

  • Watch out for Windows automatic updates!

    I have not seen such problem (yet? ;-), but it's true that when the last big Windows update was installed, some settings were changed without any notification. And it seems the next one (20H2) is now on the way to users...

    If I use the SDK command shell as Admin, then everything builds OK. 

    Isn't it the mode that should be used always, when e.g. examples (or any other project using mdlapps as output) are compiled?

    This has something to do with Windows Admin rights on the ..\MicroStation\mdlapps folder.

    A question is why to use mdlapps as output folder...

    With regards,

      Jan

  • A question is why to use mdlapps as output folder

    For many years, I've installed MicroStation on a local G: drive, not the C: drive. Windows knows about the C:\Program Files and other protected folders, but historically knew nothing about other local drives where executables might be installed.  Consequently, I used not to need Admin rights when building or modifying stuff in the G:\Program Files\..\MicroStation\mdlapps folder. 

    What happened with a recent Windows 10 update was that the operating system noticed that I have executables installed on my G: drive, and changed the privileges in that folder tree to require Admin rights.

    So now there is no advantage to having a G: drive where I can do as I please with executables and DLLs.

     
    Regards, Jon Summers
    LA Solutions