locked
Can I get the absolute file path printed out to the warning information? RRS feed

  • Question

  • Hi guys,

        In most cases, relative paths or file names are printed out to the compiler warning information.

        Do we have ways getting the absolute file path printed out?

        Thanks!

    Dongwei 

    Friday, September 12, 2008 3:59 PM

Answers

  • Check the /FC compile option.
    Hans Passant.
    • Marked as answer by Yan-Fei Wei Thursday, September 18, 2008 9:54 AM
    Tuesday, September 16, 2008 12:28 PM

All replies

  • That's pretty odd.  Here's what I see in the Output window:

    1>c:\projects\cpptemp3\dllmain.cpp(18) : warning C4244: 'initializing' : conversion from 'int' to 'short', possible loss of data

    Hans Passant.
    Tuesday, September 16, 2008 11:33 AM
  • But in most cases, I got the output as follows: 

    .\AppSharingUtils.cxx(308) : error C2664: 'wcsncpy' : cannot convert parameter 2 from 'WORD *' to 'const wchar_t *'
            Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
    .\AppSharingUtils.cxx(510) : warning C4996: 'strcpy' was declared deprecated
            c:\Program Files\Microsoft Visual Studio 8\VC\include\string.h(73) : see declaration of 'strcpy'


    I get this kind of output from both Visual Studio 2003 and Visual Studio 2005.
    Tuesday, September 16, 2008 12:15 PM
  • Check the /FC compile option.
    Hans Passant.
    • Marked as answer by Yan-Fei Wei Thursday, September 18, 2008 9:54 AM
    Tuesday, September 16, 2008 12:28 PM
  • Thank you very much, Hans!

    I can get the expected result when /FC is set in GUI "Preference..." dialog as follows:

    Project -> References... -> Configuration Properties -> C/C++ -> Advanced -> Use full path

    But how about on command line?

    As usual, we use two methods to do the compilation.

    1. devenv rfb.vcproj /build

    2. devenv vnc.sln /build

    As we know,  /FC is not one of the devenv command options. So what can we do based on the command line usage mentioned above?

    Thank you in advance! :)

    Dongwei Xu
    Wednesday, September 17, 2008 2:36 AM
  • Have you tried it?  It will work, it picks up /FC from the rfb.vcproj file.
    Hans Passant.
    Wednesday, September 17, 2008 9:56 AM
  • You mean that I have to set the /FC option in GUI dialog manually, then run the command line. correct? Yes, I can get the abs path.

    But is there any way to get abs path without setting /FC ahead of time, say, maybe we can just make the settings on command line?

    Thanks!

    Dongwei Xu

    Wednesday, September 17, 2008 10:03 AM
  • Hi,

    We can't make the settings on the command line, you need to set it in the project option dialog or modify the .vcproj file.

    Thanks!
    Thursday, September 18, 2008 8:39 AM
  • Thank you very much,  Antonio!
    Thursday, September 18, 2008 12:00 PM