Skip to main content
gamedev.net
🔒 Locked

Multiple source files?

Started by BSXrider Jan 15, 2002 at 1:30 PM 3 replies 400+ views
Original Post
BSXrider
BSXrider
I''m trying to split my project into two source files, can someone tell me how to make this work? - seb
Oluseyi
Oluseyi
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!
BSXrider
BSXrider
Wonderful. I knew most of that and was doing it all right except I''ve never used "extern" before. All works now - cheers!

- seb
SuperRoy
SuperRoy
heyyyuh....extern is like.....do I use extern in the .h files or the .cpp files?

-roy

//#define IRONY -1
Sup guys?

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.