-2

I am making a project on Visual Studio Community in C++.All of my code is correct, but when I run it, it does not show me the wanted output, nor does it show the console.The output should be a green screen on the console, but instead doesn't even show the console. I am a beginning C++ programmer, so I decided to come here and wait if somebody could answer. I would really appreciate it. Thank you. Here is a screenshot link of Visual Studio Community and my code:

And here is the link of the youtube video I was following:

https://www.youtube.com/watch?v=QQzAHcojEKg&list=PLhfAbcv9cehhkG7ZQK0nfIGJC_C-wSLrx

Jabberwocky
  • 48,281
  • 17
  • 65
  • 115
  • 1
    your code does not compile, you have some link errors. See your build logs ... – Landstalker Apr 03 '20 at 11:55
  • 5
    Don't post pictures of text. Post text as text. Read this: [ask]. https://idownvotedbecau.se/imageofcode – Jabberwocky Apr 03 '20 at 11:56
  • 2
    And please, _please_ understand the difference between code that compiles, and code that does what it was intended to do. It's kind of like saying that your text doesn't have any spelling errors and wondering why your teacher gave you a failing grade. – dandan78 Apr 03 '20 at 12:00
  • 2
    You included the 64bit library SDL but your project is 32 bits. Chose `x64` here: https://i.stack.imgur.com/jouUH.png – Jabberwocky Apr 03 '20 at 12:02
  • 1
    The question may be poorly written, but it's not a duplicate of https://stackoverflow.com/questions/12573816/what-is-an-undefined-reference-unresolved-external-symbol-error-and-how-do-i-fix – Jabberwocky Apr 03 '20 at 12:03
  • 4
    This is off topic but genuinely meant. If you are trying to learn C++ then games programming is not the place to start. C++ is a complex language and is better learned with simpler projects than writing games. And if you want to write games then there are other languages that would be easier to start with than C++, Python perhaps. – john Apr 03 '20 at 12:18
  • 1
    The linker problem is you are mixing 32 and 64 bit. Since you are building a 32 bit application I assume the sdl libraries are 64 bit. The best solution these days is to switch to build a x64 application in Visual Studio. There is not a lot of need to build 32 bit windows binaries in 2020. – drescherjm Apr 03 '20 at 12:45
  • john, actually I meant a beginner C++ GAME MAKER. –  Apr 13 '20 at 16:12

1 Answers1

1

You seem to have 64-bit SDL libraries but are building a 32-bit project in visual studio. You can't mix 32 and 64-bit code. Change the x86 dropdown in the toolbar to x64.

Alan Birtles
  • 32,622
  • 4
  • 31
  • 60
  • I'm sorry, but it gives me errors when I do that. Do you have any more advice/answers? –  Apr 03 '20 at 20:16
  • You probably did not apply the include directory or link settings you applied to the x86 configurations. – drescherjm Apr 04 '20 at 02:38
  • Also that is probably a different question having nothing to do with selecting the wrong configuration in Visual Studio. – drescherjm Apr 04 '20 at 02:39