LINK : fatal error LNK1221: a subsystem can't be inferred and must be defined
Asked Answered
H

2

7

I have no other errors or warning in my solution, which would be great but this error has totally baffled me. I have three projects, one references none, and the other two both reference it.

One is a windowsservice, ah, that is also the one that doesn't link, I think this means I ought to add the service installer class in the morning, thought the MS example doesn't bother on the ServiceBase page of MSDN : http://msdn.microsoft.com/en-us/library/system.serviceprocess.servicebase%28v=VS.80%29.aspx

I'll need to test that example later. But if anyone can help in the mean time, thanks.

The project with no references is a dll. The other is a standard app, which up until about a month ago was all that I'd considered building.

Hellenism answered 15/10, 2011 at 2:7 Comment(0)
A
15

You need to set the subsystem in your C++ project under Project Properties -> Configuration Properties -> Linker -> System -> SubSystem. And you probably want to use SUBSYSTEM:WINDOWS.

enter image description here

Athapaskan answered 15/10, 2011 at 2:48 Comment(2)
Thank you. Genius. I like the simple solution.Hellenism
Also make sure you are setting this for All Platforms.Troika
A
0

This is so easy don't worry about this. Let go to you file name and click on right side go to properties and click on linker and select the system you will see the top option of subsystem select it to first option that is Console (/SUBSYSTEM:CONSOLE)

correct image for your desire

Alsacelorraine answered 2/9, 2019 at 16:32 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.