Archived

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

Nacho

Multiples Files in VC++ 6

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
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