Command line compile, no output file
CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3

Thread: Command line compile, no output file

  1. #1
    Join Date
    Dec 2007
    Location
    France
    Posts
    229

    Command line compile, no output file

    Im compiling a .cpp file from a .bat file with these commands.

    It compiles without error and I get an .obj file but no .exe. The object file gets created in the VS bin directory.
    I tried it with the switch /FeD:\zzz.exe but it's the same, no exe output.

    I suspect that it because I dont link it with libcpmt.lib. But its not asking for it and when I include it it gives me strange errors that I dont get when I compile a simple test.cpp file linked with libcpmt.lib.

    Code:
    c:
    
    cd  "C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\bin"
    
    set MSVC="C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\Include"
    set INCLUDE="C:\Program Files (x86)\Microsoft SDKs\Windows\v7.1A\Include"
    set SRC="D:\test.cpp"
    
    cl /c /Zi /W3 /WX- /sdl /O2 /Oi /Oy- /GL /D _USING_V110_SDK71_ /D _MBCS /Gm- /EHsc /MD /GS /Gy /fp:precise /Zc:wchar_t /Zc:forScope /I%INCLUDE%  /I%MSVC% /Gd /TP %SRC%
    Last edited by MasterDucky; July 28th, 2014 at 08:34 AM.

  2. #2
    VictorN's Avatar
    VictorN is online now Super Moderator Power Poster
    Join Date
    Jan 2003
    Location
    Wallisellen (ZH), Switzerland
    Posts
    17,477

    Re: Command line compile, no output file

    Are you sure you are using correct options to create an exe?
    For instance:
    /c - Compiles without linking
    /MD - Creates a multithreaded DLL, using MSVCRT.LIB
    Victor Nijegorodov

  3. #3
    Join Date
    Dec 2007
    Location
    France
    Posts
    229

    Re: Command line compile, no output file

    OK, that's my bad, I just copied the command from Visual Studio 2013 where it was compiling and creating the .exe.

    If I remove /c and link it with the libs it should work.

    Thanks for the help Victor.

Posting Permissions

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


Windows Mobile Development Center


Click Here to Expand Forum to Full Width

This is a CodeGuru survey question.


Featured


HTML5 Development Center