PocketMatrix forums

A read-only archive of the PocketMatrix forums (2001–2014). Posting and accounts are closed.

A question about the code

Hello all,

I have a question about how organize my code. I looked the examples and I see that all the code is in file *.h
Is that for a particular reason? :roll:

I have another question. I was doing my code with class defining the *.h and the implementation in files *.cpp
I want to use edge in these classes but if I include edgemain.h when I build says:

"Error LNK2005 ............ already defined in myProgram.obj"

If I don't include the edgemain.h it says

"error C2065: 'E3DSurface' : undeclared identifier"

Could you help me?

Thanks a lot.
Hi Meiline,

If you're using multiple .cpp source files, you need to include edgemain.h only once.

For the source file containing the EdgeMain function, you need to include edgemain.h. For the others, you need to include edge.h.
Ok!

Thank you very much! :D
Hi Meiline,

I moved your new question to a separate topic.