代码之家  ›  专栏  ›  技术社区  ›  Joel

Windows Mobile命令行编译器

  •  1
  • Joel  · 技术社区  · 17 年前

    我已经安装了VisualStudio2008Professional,我需要能够从命令行编译程序。我在VisualStudio中检查了项目属性,它显示了传递给编译器的所有参数,但没有显示编译器本身的名称。

    4 回复  |  直到 17 年前
        1
  •  3
  •   JaredPar    17 年前

    命令行C++编译器的名称是C.exe。

    x86_arm可以替换为x86_mips或x86_sh,具体取决于特定的体系结构。

    http://msdn.microsoft.com/en-us/library/aa448630.aspx

        2
  •  3
  •   Michael Burr    17 年前

    cl.exe ,但根据需要执行的操作,您可能需要研究从命令行调用devenv-

    Microsoft (R) Visual Studio Version 9.0.21022.8.
    Copyright (C) Microsoft Corp. All rights reserved.
    
    Use:
    devenv  [solutionfile | projectfile | anyfile.ext]  [switches]
    
    The first argument for devenv is usually a solution file or project file.
    You can also use any other file as the first argument if you want to have the
    file open automatically in an editor. When you enter a project file, the IDE
    looks for an .sln file with the same base name as the project file in the
    parent directory for the project file. If no such .sln file exists, then the
    IDE looks for a single .sln file that references the project. If no such single
    .sln file exists, then the IDE creates an unsaved solution with a default .sln
    file name that has the same base name as the project file.
    
    Command line builds:
    devenv solutionfile.sln /build [ solutionconfig ] [ /project projectnameorfile [     /projectconfig name ] ]
    
    etc...
    

    这样做的潜在优势是,您可以从命令行驱动编译,但它将使用项目/解决方案中定义的设置。这样,您就不必使makefile与IDE中对项目所做的更改保持同步。

        3
  •  2
  •   user148673 user148673    16 年前

    在Visual Studio中,打开工具/选项/“项目和解决方案”/“VC++目录”对话框,从平台下拉列表中选择适当的值(例如“Windows Mobile 6 Professional SDK(ARMV4I)”。现在切换“显示目录”下拉列表中的各种值(例如“可执行文件”、“包括文件”、“参考文件”、“库文件”),并记下每个列表中显示的目录。这些是命令行工具所需的目录。

    然后,您可以创建一个批处理文件,用于为Windows Mobile开发设置命令行环境:

    SET PATH=[Executable Files separated by semicolons]
    SET INCLUDE=[Include Files separated by semicolons]
    SET LIBPATH=[Reference Files separated by semicolons]
    SET LIB=[Library Files separated by semicolons]
    
        4
  •  1
  •   Jared Miller    17 年前

    MSBuild也运行良好。

    你的论点可能会有所不同。

    C:\WINDOWS\Microsoft.NET\Framework\v3.5\MSBuild.exe  /t:Rebuild /p:Configuration="Release";Platform="Windows Mobile 5.0 Pocket PC SDK (ARMV4I)"; /v:normal /m "C:\MySolutions\MySolution.sln"