How to force absolute paths for build errors output in Visual Studio

梦想与她 提交于 2021-02-10 19:10:07

问题


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.


回答1:


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.



来源:https://stackoverflow.com/questions/11874086/how-to-force-absolute-paths-for-build-errors-output-in-visual-studio

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!