CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3
  1. #1
    John E is offline Elite Member Power Poster
    Join Date
    Apr 2001
    Location
    Manchester, England
    Posts
    4,835

    Compiler (command line) arguments

    I'm working on a project that uses waf as its build tool. The project does build under MSVC but things aren't as I'd expect them. For example, when building a Debug version of the project, it seems to link to the Release version of the MSVC 'C' runtime.

    After examining the waf script, I noticed a couple of places where paramters are getting passed to the compiler using '-' (rather than '/'). For example, waf passes -TP and -MD to the compiler whereas VS's own IDE would pass them as /TP and /MD.

    Are both versions valid or are these mistakes that I'll need to modify in the waf script?

    [Edit...] I'm building with VS2005, BTW
    "A problem well stated is a problem half solved.” - Charles F. Kettering

  2. #2
    Join Date
    Oct 2006
    Location
    Sweden
    Posts
    3,654

    Re: Compiler (command line) arguments

    I really don't know John but since cl -? show all options as / whithout mentioning anything about - I guess - isn't alright. On the other hand if so I guess that you should have some error message logged after building?
    Debugging is twice as hard as writing the code in the first place.
    Therefore, if you write the code as cleverly as possible, you are, by
    definition, not smart enough to debug it.
    - Brian W. Kernighan

    To enhance your chance's of getting an answer be sure to read
    http://www.codeguru.com/forum/announ...nouncementid=6
    and http://www.codeguru.com/forum/showthread.php?t=366302 before posting

    Refresh your memory on formatting tags here
    http://www.codeguru.com/forum/misc.php?do=bbcode

    Get your free MS compiler here
    https://visualstudio.microsoft.com/vs

  3. #3
    Join Date
    Feb 2002
    Posts
    4,640

    Re: Compiler (command line) arguments

    I'm pretty sure you can use either, based on the errors I see:
    Code:
    C:\msvsn2008\VC\bin>cl -TP
    Microsoft (R) 32-bit C/C++ Optimizing Compiler Version 15.00.30729.01 for 80x86
    Copyright (C) Microsoft Corporation.  All rights reserved.
    
    cl : Command line error D8003 : missing source filename
    
    C:\msvsn2008\VC\bin>cl /TP
    Microsoft (R) 32-bit C/C++ Optimizing Compiler Version 15.00.30729.01 for 80x86
    Copyright (C) Microsoft Corporation.  All rights reserved.
    
    cl : Command line error D8003 : missing source filename
    
    C:\msvsn2008\VC\bin>cl /vig
    Microsoft (R) 32-bit C/C++ Optimizing Compiler Version 15.00.30729.01 for 80x86
    Copyright (C) Microsoft Corporation.  All rights reserved.
    
    cl : Command line warning D9002 : ignoring unknown option '/vig'
    cl : Command line error D8003 : missing source filename
    
    C:\msvsn2008\VC\bin>cl -vig
    Microsoft (R) 32-bit C/C++ Optimizing Compiler Version 15.00.30729.01 for 80x86
    Copyright (C) Microsoft Corporation.  All rights reserved.
    
    cl : Command line warning D9002 : ignoring unknown option '-vig'
    cl : Command line error D8003 : missing source filename
    Viggy

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured