Thursday, 6 August 2009

How to fix fatal error A1000 while compiling Crypto++ 5.5.2 on VS 2005

The possible cause

A white space on the path to the asm file.

The possible solution

If so, the solution is really simple (well, once you know it or you read it here or in such a place): open the solution in VS 2005, in the solution explorer locate x64masm.asm (should be between the Source Files of the crypdll project), right click on the file name (or do whatever you need to do to get the context menu), select the property menu item, go to Configuration Properties/Custom Build Step/General, and change the Command Line property from:
ml64.exe /c /nologo /Fo"$(IntDir)\x64masm.obj" /Zi $(InputPath)
ml64.exe /c /nologo /Fo"$(IntDir)\x64masm.obj" /Zi "$(InputPath)"
Remember to do it for each configuration (Release, Debug, ..)

The story behind that possible solution

A long time ago, while trying to compile Crypto++ in Microsoft Visual Studio 2005, I got a "MASM : fatal error A1000: cannot open file : C:\Projects\Blabla\My" compile error.
The file name actually gave me straight away the lead on what was going wrong, as the asm file was located in something like "C:\Projects\Blabla\My Project\myasm.asm", and it was self evident the issue was with the space on the path.
After spending an inordinate amount of time to find out to fix it, I did fix it only for the Release x64 configuration, so the issue came back to haunt me later on, that's it this morning, when I was wishing to compile again Crypto++ (5.5.2, I don't know if they fixed it on 5.6.0), this time in the Debug x64 configuration.
After spending another inordinate amount of time on the issue and finding again the way to fix it, I decided to put in on my blog, so next time I may have the chance to google my own solution.

1 comment:

Anonymous said...
This comment has been removed by a blog administrator.