怎样在不打开VC集成开发环境的情况下,编译生成一个DLL文件?

解决方案 »

  1.   

    打开vb集成开发环境 :),开玩笑,帮你up
      

  2.   

    命令行下调用相应的编译器,详情请参看MSDN的 cl
      

  3.   

    微软DDK中有很多DLL都是用命令行编译的,可以下一个参考一下
      

  4.   

    可以直接调用msdev
    msdev project.dsp /MAKE "project - Win32 Release" /REBUILD
      

  5.   

    cl的LD参数创建DLL(其实是这个是传递给linker的参数),LDd创建DLL的debug library
      

  6.   

    如果你不用集成环境要手动设计CL很多参数,十分麻烦.
    你可以试着分析一下工程设置里的参数.
    以前在命令行编译程序的时代,建一个make.bat是个解决办法.
      

  7.   

    to flyelf(空谷清音)
    我新建一个空的工程用你给的命令,报错,错误如下:
    C:\Program Files\Microsoft Visual Studio\Common\MSDev98\Bin>msdev .\2\1\1.dsp /M
    AKE "1 - Win32 Debug" /REBUILD
    Deleting intermediate files and output files for project '1 - Win32 Debug'.
    --------------------Configuration: 1 - Win32 Debug--------------------
    Compiling resources...
    Compiling...
    StdAfx.cpp
    c:\program files\microsoft visual studio\vc98\include\winnls.h(514) : error C201
    8: unknown character '0x10'
    c:\program files\microsoft visual studio\vc98\include\objidl.h(9586) : error C20
    18: unknown character '0xed'
    c:\program files\microsoft visual studio\vc98\include\objidl.h(9586) : error C20
    61: syntax error : identifier 'IEnu'
    Error executing cl.exe.
      

  8.   

    参考msdn里面的命令行参数,楼主何苦啊?
      

  9.   

    用cl啊,就可以啊 cl/ld 后面跟上其他的选项和文件名就可以了cl的格式是CL [option...] file... [option | file]... [lib...] [@command-file] [/link link-opt...]The following table describes input to the CL command.Entry Meaning 
    option One or more CL options. Note that all options apply to all specified source files. Options are specified by either a forward slash (/) or a dash (–). If an option takes an argument, the option’s description documents whether a space is allowed between the option and the arguments. Option names (except for the /HELP option) are case sensitive. 
    See Order of CL Options for more information.  
    file The name of one or more source files, .OBJ files, or libraries. CL compiles source files and passes the names of the .OBJ files and libraries to the linker. See CL Filename Syntax for more information.  
    lib One or more library names. CL passes these names to the linker. 
    command-file A file that contains multiple options and filenames. See CL Command Files for more information. 
    link-opt One or more linker options. CL passes these options to the linker.