Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

Bruno

extern Classes

This topic is 5799 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi Supose i have a class like this : class foo { AddLine(Char *blab); }; This class is defined in first.cpp as foo myfoo; Now, i would like to use this class in another file in the same project, in second.cpp for example. myfoo.AddLine("foo again"); so, i declare the variable as external in this second.cpp as extern myfoo; The problem now is that when compiling i have this error : error C2228: left of ''.AddLine'' must have class/struct/union type Looks like he doens''t recognize the funtions inside the class.. How can i do this ? thanks, Bruno

Share this post


Link to post
Share on other sites
Advertisement
Doens't work either.., , like that i get this error :

error C2146: syntax error : missing ';' before identifier 'foo'

[edit]
It's working.., i forgot to include the header file
thanks
[\edit]

[edited by - Bruno on December 7, 2002 8:36:06 AM]

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!