Include Problem

D

Danile Tagman

Hi
iam having troubles getting two classes to work the way I want. Both
classes are pretty much fully inlined ( theyre math classes, vector
and matrix ). Now I defined a function side the vector class that uses
a matrix function and vice versa... So far - no problem, if they
werent inlined. But since both of the functions using the other class
are inlined, I cant resolve the problem by simply putting a forward
declaration like class CVec3; in front of the matrix class. Everything
works well if iam not inlining these functions. Any idea how to
resolve that problem?

Thanks in advance :)
 
V

Victor Bazarov

Danile said:
iam having troubles getting two classes to work the way I want. Both
classes are pretty much fully inlined ( theyre math classes, vector
and matrix ). Now I defined a function side the vector class that uses
a matrix function and vice versa... So far - no problem, if they
werent inlined. But since both of the functions using the other class
are inlined, I cant resolve the problem by simply putting a forward
declaration like class CVec3; in front of the matrix class. Everything
works well if iam not inlining these functions. Any idea how to
resolve that problem?

Pull those functions out of the class definition and declare them 'inline'
outside. Keep them in the header.

V
 
D

dtag00

Thx alot :) I pulled the inline defs to .inl files and included them
after the headers. That worked ;)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
474,296
Messages
2,571,535
Members
48,281
Latest member
DaneLxa72

Latest Threads

Top