• Advertisement

Archived

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

Multiple source files?

This topic is 5877 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

I''m trying to split my project into two source files, can someone tell me how to make this work? - seb

Share this post


Link to post
Share on other sites
Advertisement
Place function and structure declarations in header (.h, .hxx, .hpp) files, and implementations in source (.c, .cxx, .C, .cpp) files. Use the extern keyword to create global (shared) variables.

Look up extern, header file, source file and ,tt>multi-file linking in a MSDN Online or at Cplusplus.com.

[ 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
Wonderful. I knew most of that and was doing it all right except I''ve never used "extern" before. All works now - cheers!

- seb

Share this post


Link to post
Share on other sites
heyyyuh....extern is like.....do I use extern in the .h files or the .cpp files?

-roy

//#define IRONY -1

Share this post


Link to post
Share on other sites

  • Advertisement