0

Am quite not been able to output to a console using the printf and std::cout statements. I am using Visual Studio for development.

Tried changing SubSystem to Console in project configuration (/Configuration properties/Linker/System). But I am gettig this error : Error LNK2019 unresolved external symbol main referenced in function "int __cdecl invoke_main(void)" (?invoke_main@@YAHXZ)

Is there an alternative ? What am I overlooking here?

What can explain std::cout not to display anything?

How to output to the console in C++/Windows

Tried the solutions here, to the best of my understanding and knowledge.

  • Finally, found something out that is working here : https://stackoverflow.com/questions/1149620/how-to-write-to-the-output-window-in-visual-studio – Roshan Menon Apr 28 '23 at 09:11
  • A program built with Console subsystem must have a function named `main` as its entry point (you program probably has `WinMain` instead). This is what the linker error is telling you. – Igor Tandetnik Apr 29 '23 at 20:44
  • @Igor, This is a GUI (game) application made using Windows subsystem. I got your point though. I understand the differences that might exist between the two. But even a GUI app has no implicit debug logging facilities in VC++, Like you have Console.log() in c# is what surrpises me. – Roshan Menon Apr 30 '23 at 06:35

0 Answers0