Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project! See Demo

Close

visual studio compiler no console output?

NppExec
Alan Lilly
2012-02-08
2013-05-21
  • Alan Lilly
    Alan Lilly
    2012-02-08

    I am using nppexec to compile my c++ source changes with the following command:
    devenv c:\path\project.sln /Build
    The compile works fine but the output is not being trapped and shown in the console.
    I have tried all 3 console output encodings (ansi, dos, utf8) and it makes no difference.
    If I run the same command in a dos window… the output does appear as expected.

     
  • DV
    DV
    2012-02-08

    You can try the following: 

    cmd /c devenv c:\path\project.sln /Build
    

    Or maybe even this: 

    cmd /c devenv c:\path\project.sln /Build 2>&1
    

    I can't say more as I don't have the environment configured to try your example exactly. I just can add that the manual environment settings described in NppExec Manual "4.7.3. Using Visual Studio's compiler (cl.exe)"  work for me.

     
  • Alan Lilly
    Alan Lilly
    2012-02-08

    Sweet! Adding cmd /c did the trick!

     
  • Kim Brouer
    Kim Brouer
    2012-06-13

    Another way would probably be to write

    devenv.com
    

    rather than just 

    devenv
    

    .

    When running external programs from your code without specifying an extension, Windows searches in the order .exe, .com, .bat.
    When going through COMMAND.COM, and probably CMD.EXE, the search order changes to .com, .exe, .bat.

    IIRC, DEVENV.EXE doesn't output to the console, DEVENV.COM does.

     
  • DV
    DV
    2012-06-13

    Damn, you are right! I still can't get used to new interpretation of ".com" extension which now seems to mean "a console Windows application" - i.e. actually it's an .exe. Whereas in old DOS times the ".com" extension meant a different file format which was not  the same as .exe.