2

When building in most Visual Studio (2008, but I doubt it matters) projects, if there is error, it lists the absolute path of the file with the error. Like this (ignore the specific errors--I added them intentionally):

1>dope_external.cpp
1>c:\users\me\dope_external.cpp(4) : error C2144: syntax error : 'void' should be preceded by ';'
1>c:\users\me\dope_external.cpp(4) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>Generating Code...

However, the solutions/projects I'm currently working with list relative path names:

1>FileBasedEffect.cpp
1>..\..\..\..\..\..\..\..\tools\blah\code\src\important_file.cpp(10) : error C2653: 'FusionEffectKeys' : is not a class or namespace name
1>..\..\..\..\..\..\..\..\tools\blah\code\src\important_file.cpp(10) : error C2143: syntax error : missing ';' before 'const'
1>..\..\..\..\..\..\..\..\tools\blah\code\src\important_file.cpp(10) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int

This happens in Visual Studio and also if I build from the command-line or in another environment using vcbuild. I'd like to use a different environment to build, at least as an experiment. But the relative paths are horking me a little.

I don't spot any differences in the project properties that are obvious like "UseRelativePathsInBuildErrors", but I don't know the build system that well. Any ideas? Thanks.

SirPentor
  • 1,994
  • 14
  • 24
  • I wonder if it's just the length of the path. Can you try moving the dope_external project you created into a directory somewhere deep in the filesystem and see if the paths start being truncated? – jwismar Aug 08 '12 at 22:30
  • I don't know if this will fix the issue because I can't recreate your errors, but in the Tools-> Options -> Build and Run: You'll see a setting for `MSBuild poject build output verbosity`. Try to set it to detailed or even diagnostic. Let me know please. – ChiefTwoPencils Aug 08 '12 at 22:37
  • @jwismar: good idea but even with a very deep directory level I still see this. – SirPentor Aug 08 '12 at 22:47
  • @RobertoWilko: doing that didn't "fix" things, but I looked at the command-line and in the case where it shows relative paths, the relative path is passed into cl on the command-line and absolute paths are used in the case where it shows an absolute path. – SirPentor Aug 08 '12 at 23:55

1 Answers1

4

I found a solution.

In project properties->configuration properties->c/c++->Advanced, there is a "Use Full Paths" option which appears to make vcbuild pass the /FC flag to cl.exe. This produces full paths in output.

so that solves my problem...but that option isn't set in the case where I already see full paths, so there's something else at play here.

SirPentor
  • 1,994
  • 14
  • 24
  • 1
    The `/ZI` flag (used to get "Edit and Continue" support and almost certainly on in debugging builds) *implies* `/FC` (see [the documentation](https://learn.microsoft.com/en-us/cpp/build/reference/fc-full-path-of-source-code-file-in-diagnostics)). That's probably why you are seeing full paths even without the `/FC` option being explicitly set. – Cody Gray - on strike Sep 24 '22 at 00:41