error with lazy foo project

If you search for those errors I think you'll find that you need to compile using g++ not gcc.

Edit: typo
Last edited on
of course it is a C++ compiler and not C, i forgot it.
I didn't get any errors:

 g++ -o lesson23 lesson23.cpp -lSDL -lSDL_ttf -lSDL_image


Undefined reference -> Link your libraries in the project settings!
(Looks like it's a standard library , which is weird since it uses templates... Make sure you included iostream (NOT iostream.h))

Wait, the last error makes me think you're using gcc, too...

Try a clean project compilation, make sure all your code has either .h or .cpp extensions (no .c) and your project is a C++ project (if you're using an IDE).
Last edited on
Yeah, he is. I just attempted it with gcc on my linux box and got same output.

@legendarysnake
You have to know your tools if you are going to be a successful programmer. With GNU (gcc is the C compiler and g++ is the C++ compiler).
Topic archived. No new replies allowed.