0

i start sfml but can't success tutorial because of..

enter image description here

and it says

The variable "namespace" is not a type name.
4723 error code

What should i do?

2
  • 1
    Did you actually declare a variable called namespace? Are you using a really old C++ compiler? Is it even a C++ compiler? Can you compile this program:namespace foo {} int main() {} ? Edit: Turns out you didn't use a C++ compiler but a C compiler as @Botje noticed :-) Commented Jun 23, 2020 at 21:18
  • Don't paste images of your code. Show text. Although in this instance it actually helped... Commented Jun 23, 2020 at 21:20

1 Answer 1

2

You are trying to compile C++ code as C code. You get an error because namespace is a C++ concept.

Rename your file to test.cpp.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.