Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
glVertexAttribPointer error
#12
(03-16-2018, 08:41 PM)Brian Beuken Wrote: hmmm see that question makes me worry that you  still have a little bit to learn on the basics of C++ and this might be a bit too much for you at the moment,

But i will do my best to help, I would like to know if you can cope with it.

All the CPP files in your solution are compiled by the gcc compiler. each cpp file if successfully compiled produces an obj file of the same name
If all files compile, the linker then links all obj files and if all is correct produces the executable file.

Now an classname.H  or header file, contains the definition of a class, and the classname.cpp file needs that to make sure that it has properly built the class as the definition requires.

Other cpp files might need to know or create an instance of a class which is contained in another CPP/OBJ file,  so it includes the definition of the class as an include file.h
That then tells the compiler, what kind of class object it expects, what its methods and members are, and lets the compiler produce the obj file. And again, the linker makes sure that you are using the values correctly and if all ok, patches in the address to find the methods and members.

So while MyFiles.cpp uses the Myfiles.h header to correctly produce the class code,

Your main.cpp  or game.cpp file, only need to include the MyFiles.h so they know what a MyFiles class is, if they want to make one as part of the code in main, or game.

Does that help?
Well yes. So when I include xxx.h, xxx.cpp is included also for compiling?

I included myfiles.h in the game.cpp and it did compile now without errors but I get an error when executing that the image file can not be loaded...

I will first reread my c and c++ books before I continue.

Thanks for your help.
Reply


Messages In This Thread
glVertexAttribPointer error - by pahendriks - 03-16-2018, 07:16 PM
RE: glVertexAttribPointer error - by Brian Beuken - 03-16-2018, 07:29 PM
RE: glVertexAttribPointer error - by pahendriks - 03-16-2018, 07:44 PM
RE: glVertexAttribPointer error - by Brian Beuken - 03-16-2018, 07:46 PM
RE: glVertexAttribPointer error - by pahendriks - 03-16-2018, 07:51 PM
RE: glVertexAttribPointer error - by Brian Beuken - 03-16-2018, 07:45 PM
RE: glVertexAttribPointer error - by Brian Beuken - 03-16-2018, 07:57 PM
RE: glVertexAttribPointer error - by pahendriks - 03-16-2018, 08:14 PM
RE: glVertexAttribPointer error - by Brian Beuken - 03-16-2018, 08:22 PM
RE: glVertexAttribPointer error - by pahendriks - 03-16-2018, 08:32 PM
RE: glVertexAttribPointer error - by Brian Beuken - 03-16-2018, 08:41 PM
RE: glVertexAttribPointer error - by pahendriks - 03-16-2018, 09:08 PM
RE: glVertexAttribPointer error - by Brian Beuken - 03-16-2018, 09:18 PM
RE: glVertexAttribPointer error - by pahendriks - 03-16-2018, 09:28 PM
RE: glVertexAttribPointer error - by Brian Beuken - 03-16-2018, 09:45 PM

Forum Jump:


Users browsing this thread: 1 Guest(s)