7

During the build of xerces 3.1.2 I get:

1>XML256TableTranscoder.cpp : fatal error C1083: Cannot open compiler generated file: '': Invalid argument

The compiler does not appear to be working on the .cpp file itself before the error occurs as I can delete all the source code in the file and still get the error.

Bruce
  • 2,230
  • 18
  • 34

3 Answers3

16

Seems that I was bumping into the path/filename length limitation of Visual Studio. The error message was not particularly descriptive, but reducing the hierarchy solved the problem.

Bruce
  • 2,230
  • 18
  • 34
  • 1
    And what limit might that be? I have the same issue, but not clear where to look. – kalbr May 12 '17 at 15:42
  • @kalbr: Not sure of the exact maximum path length, but if you shorten your paths (especially of the offending file), it will solve the problem. Try working from the root. – Bruce May 12 '17 at 19:04
  • 1
    It's [around 260 bytes](https://stackoverflow.com/q/1880321/509868). It seems that Visual Studio appends the relative path that appears in the error message to the absolute path of the directory with the project file, and the result must be less than 260 bytes. – anatolyg Dec 11 '17 at 18:33
0

Thanks, I would think this would be the same behavior on all systems however, if it were a path issue. I ONLY get this error on my laptop, not on other systems. I reduced the root path down but it still occurs. Also it ONLY occurs on Release builds, not on Debug. Will be trying 2017 soon so hopefully not an issue there.

kalbr
  • 144
  • 6
  • Did you look at permissions of folders and files? – Bruce Jun 19 '17 at 13:58
  • Another thing that could be different across two machines that otherwise have the same operating system: your disk encryption. Granted that the following link pertains to Linux, but it explains why a file path that is much shorter than 200 chars still triggers a length issue when the disk is encrypted. I imagine something similar could happen on other operating systems: https://unix.stackexchange.com/questions/32795/what-is-the-maximum-allowed-filename-and-folder-size-with-ecryptfs – pestophagous Jul 30 '20 at 02:53
0

if you using blaze.build, maybe you can use the option --experimental_shortened_obj_file_path. for example:

bazel --output_base=E:\living\_bazel_output build  --experimental_shortened_obj_file_path  --config=opt //tensorflow/tools/pip_package:build_pip_package
jamlee
  • 1,234
  • 1
  • 13
  • 26