[FIX] fatal error LNK1221: a subsystem can’t be inferred and must be defined

In Visual Studio, if you are facing “fatal error LNK1221” while building your project, then this post is for you. Here is the exact error that appears in the output console that you will know how to fix.

fatal error LNK1221: a subsystem can't be inferred and must be defined

The reason behind the error is; the SubSytem value is not set in your project settings or is having a wrong entry. Like other issues in Visual Studio, this is pretty simple, and follow the below steps to fix it.

The “fatal error LNK1221” appears when the subsystem under the Linker section is not defined in Visual Studio. To fix the error, under the Linker section of project properties, go to System → Subsystem and select Windows (/SUBSYSTEM:WINDOWS).

Steps to fix LNK1221 error:

  1. Open the Visual Studio project.
  2. Right-click on the project and go to Properties.
  3. Under the Linker section, select System.
  4. In the right panel, under the SubSystem section, choose Windows (/SUBSYSTEM:WINDOWS) from the list of values.
  5. Click OK to save the project settings.
fatal error LNK1221: a subsystem can't be inferred and must be defined

Now, if you build the project, the error will no longer appear.

That’s all. I hope the issue “fatal error LNK1221: a subsystem can’t be inferred and must be defined” is resolved after following the above steps. Do share your feedback in the comments section or in case you face any issues, we would be happy to help.

Cheers !!!

Other Visual Studio errors:

1. fatal error LNK1561: entry point must be defined in Visual Studio
2. mt.exe : general error c101008d: Failed to write the updated manifest to the resource of file

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top