none
how to compile C++ code using wdk build components in windows 8 ? ANd Wher will i start learn with MSBUILD? RRS feed

  • Question

  • i am studying "Inside Windows Debugging". I downloaded companion code from "https://www.microsoftpressstore.com/store/inside-windows-debugging-9780735662780#downloads"

    the code works with windows 7 and ddk.

    given below a simple HelloWorld.cpp

    #include "stdafx.h"
    
    class CMainApp
    {
    public:
        HRESULT MainHR( void )
        {
            ChkProlog();
    
            wprintf(L"Hello World!\n");
    
            ChkNoCleanup();
        }
    };
    
    int __cdecl wmain(void)
    {
        HRESULT hr;
        CMainApp app;
    
        hr = app.MainHR();
        if (FAILED(hr))
        {
            wprintf(L"HRESULT: 0x%08X\n", hr);
        }
        else
        {
            wprintf(L"Success.\n");
        }
        return 0;
    }
    

    source

    TARGETNAME          = HelloWorld
    TARGETTYPE          = PROGRAM
    
    UMTYPE = console
    UMENTRY = wmain
    
    C_DEFINES=$(C_DEFINES) -DUNICODE -D_UNICODE
    
    USE_MSVCRT=1
    
    SOURCES=\
        main.cpp \
    
    INCLUDES= \
        $(INCLUDES); \
        ..\..\common\corelib; \
    
    TARGETLIBS= \
        $(SDK_LIB_PATH)\kernel32.lib \
    

    i installed VISUAL STUDIO 2013 ULTIMATE. All WDK, SDK all are latest upto date Softwares.

    I found that now windows uses "MSBUILD" instead of "build".

    when I try to build this I get error.

    am coming from Linux background. So From where I will Start to get a full knowledge to build C++ codes(using visual studio and using MSBUILD)?

    Can't I use "gcc" to build c++?

    And I would like to develop C++ code. For that from where I will start? Am so much confused about windows world.

    I need examples with explanations. Can any one help me to start with WDK and MSBUILD and debugging ?

    Saturday, October 4, 2014 8:00 AM

Answers

  • Is there a driver with the program?  If this is a standalone program just choose new project under the file menu and then choose a console program.   The visual studio environment is set up for GUI operations.  If you have a driver and program combination, the easiest way is to look at one of the WDK samples with a test program.

    For a simple approach to getting started take a look at http://msdn.microsoft.com/en-us/library/jj620919.aspx


    Don Burn Windows Filesystem and Driver Consulting Website: http://www.windrvr.com

    Saturday, October 4, 2014 11:33 AM