how to fix C1189 #error: "No Target Architecture"

kuldeep rana 0 Reputation points
2025-12-18T09:07:12.4133333+00:00

I am trying to develop a device driver. But when i build it, then it gives me the errors "C1189 #error: "No Target Architecture". I want to create a utility so first i need to create the driver. I am new in the visual studio. How can i fix this error?
Thank you so much
BR,
Kuldeep Rana

Windows development | Windows Driver Kit (WDK)
{count} votes

2 answers

Sort by: Most helpful
  1. Q&A Assist
    2025-12-18T09:07:20.93+00:00
    AI generated content. This question contains an answer created with AI from Q&A Assist. Learn more

    The error message "C1189 #error: "No Target Architecture"" typically indicates that the target architecture for your driver project has not been specified. To fix this error in Visual Studio, you need to ensure that the project settings are correctly configured to specify the target architecture.

    Here are the steps to resolve this issue:

    1. Open your driver project in Visual Studio.
    2. Access Configuration Manager: Right-click on the solution in the Solution Explorer and select Configuration Manager.
    3. Set Active Solution Platform: In the Configuration Manager, ensure that the Active solution platform is set to either Win32 or x64, depending on your target architecture. If your desired architecture is not listed, you can select <New...> to create a new platform configuration.
    4. Check Project Properties: Right-click on your driver project in the Solution Explorer and select Properties. Under Configuration Properties -> Driver Settings -> General, ensure that the Target Platform is set correctly (e.g., Windows Drivers).
    5. Build the Project: After making these changes, try rebuilding your project by selecting Build Solution from the Build menu or pressing Ctrl+Shift+B.

    By ensuring that the target architecture is specified, you should be able to resolve the C1189 error and proceed with your driver development.


    References:

    0 comments No comments

  2. Danny Nguyen (WICLOUD CORPORATION) 6,125 Reputation points Microsoft External Staff Moderator
    2025-12-19T04:07:09.9433333+00:00

    Hi @kuldeep rana ,

    This error usually happens when the build platform isn't set correctly for driver development. Here are a few things to check:

    1. Set Your Build Platform:

    • Go to BuildConfiguration Manager
    • Make sure Active solution platform is set to x64 (most common for modern drivers)
    • If you don't see x64, click New to add it

    2. Check Your WDK Installation:

    • Make sure you have the Windows Driver Kit (WDK) installed
    • It should match your Visual Studio version
    • You can download it from the Microsoft WDK page

    3. Verify Project Settings:

    • Right-click your project → PropertiesGeneral
    • Check that Platform Toolset is set to "WindowsKernelModeDriver10.0" (or similar)

    4. Use the Right Project Template:

    • If you're starting fresh, use FileNew Project → search for "Kernel Mode Driver (KMDF)"
    • Using the driver template sets up everything correctly automatically
    • Here's a helpful guide: Write a KMDF driver based on a template

    Since you're new to Visual Studio driver development, I'd recommend starting with the KMDF template - it handles most of the configuration for you.

    Hope this helps!


Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.