• Advertisement

Archived

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

Multiples Files in VC++ 6

This topic is 5851 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 there! I´ve got a very simple question. I want to compile a project in VC++ 6 that has three files: main.cpp (the main program), myclass.cpp (the implementation for the member functions of my class) and myclass.h (the declaration of the class). Hoy do I have to declare the class and the member functions in order to compile the project succesfully? Thanks!

Share this post


Link to post
Share on other sites
Advertisement
myclass.h: class declaration
myclass.cpp: class definition. Includes myclass.h
main.cpp: application definition. Includes myclass.h

Make sure both source files are explicitly part of the project (the header doesn''t matter as much, as it''ll be listed as a dependency). Presto, you''re done.

[ GDNet Start Here | GDNet FAQ | MS RTFM | STL | Google ]
Thanks to Kylotan for the idea!

Share this post


Link to post
Share on other sites
quote:
Original post by Oluseyi
myclass.h: class declaration
myclass.cpp: class definition. Includes myclass.h
main.cpp: application definition. Includes myclass.h

Make sure both source files are explicitly part of the project (the header doesn''t matter as much, as it''ll be listed as a dependency). Presto, you''re done.

[ GDNet Start Here | GDNet FAQ | MS RTFM | STL | Google ]
Thanks to Kylotan for the idea!



Do I have to declare the class as extern or static, or something like that?

Share this post


Link to post
Share on other sites

  • Advertisement