Foro de elhacker.net

Programación => Programación C/C++ => Mensaje iniciado por: niñopixel en 28 Septiembre 2016, 16:45 pm



Título: Error referencias con las clases
Publicado por: niñopixel en 28 Septiembre 2016, 16:45 pm
Tengo problemas con la referencia de las clases, si alguien me puede sacar de mi ignorancia seria de agradecer, estoy trabajando en DEV C++

graphics.h
 
Código
  1. #ifndef GRAPHICS_H
  2. #define GRAPHICS_H
  3.  
  4. struct SDL_Window;
  5. struct SDL_Renderer;
  6.  
  7. class Graphics {
  8. public:
  9. Graphics();
  10. ~Graphics();
  11. private:
  12. SDL_Window* _window;
  13. SDL_Renderer* _renderer;
  14. };
  15.  
  16. #endif

Graphics.cpp

Código
  1. #include "../SDL/SDL.h"
  2. #include "graphics.h"
  3.  
  4. Graphics::Graphics() {
  5. SDL_CreateWindowAndRenderer(640, 480, 0, &this->_window, &this->_renderer);
  6. SDL_SetWindowTitle(this->_window, "algo");
  7. }
  8.  
  9. Graphics::~Graphics(){
  10. SDL_DestroyWindow(this->_window);
  11. }
  12.  

main.cpp

Código
  1. #include "headers/graphics.h"
  2.  
  3. int main(int argc, const char* argv[])
  4. {
  5. Graphics graphics;
  6. while (true)
  7. {
  8.  
  9. }
  10.  
  11. return 0;
  12. }

(http://img259.imagevenue.com/aAfkjfp01fo1i-2088/loc33/074229626_error1_122_33lo.jpg)

(http://img258.imagevenue.com/aAfkjfp01fo1i-7017/loc506/507404538_error2_122_506lo.jpg)