Jump to content
  • Advertisement
Sign in to follow this  
bikola_p

multiple cpp files

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

Hey guys, i never acctually paid much attention to the use of multiple cpp files, but anyhoo i use multiple headers, however recently thought i would be alot better in my current project with multiple cpp files, how can i achieve this.

Share this post


Link to post
Share on other sites
Advertisement
How to do it depends on your development environment and how you are compiling and linking your files.

If you're using Visual Studio, it's as simple as just adding another source file to your project. If you're using something like gcc - just add the other source file to the arguments string (so, gcc source1.cpp source2.cpp -o executable, or something ).

Share this post


Link to post
Share on other sites
Quote:
Original post by python_regious
How to do it depends on your development environment and how you are compiling and linking your files.

If you're using Visual Studio, it's as simple as just adding another source file to your project. If you're using something like gcc - just add the other source file to the arguments string (so, gcc source1.cpp source2.cpp -o executable, or something ).


Well, it's not quite that simple actually. Were the OP to do only that, he'd soon have compiler errors and odd bugs galore. That's why the organizing files link Konfusius posted is invaluable -- it tells you what you need to do inside your headers and sources to make sure everything works together the way it should.

-Twilight Dragon

Share this post


Link to post
Share on other sites
Quote:
Original post by TDragon
Quote:
Original post by python_regious
How to do it depends on your development environment and how you are compiling and linking your files.

If you're using Visual Studio, it's as simple as just adding another source file to your project. If you're using something like gcc - just add the other source file to the arguments string (so, gcc source1.cpp source2.cpp -o executable, or something ).


Well, it's not quite that simple actually. Were the OP to do only that, he'd soon have compiler errors and odd bugs galore. That's why the organizing files link Konfusius posted is invaluable -- it tells you what you need to do inside your headers and sources to make sure everything works together the way it should.

-Twilight Dragon


Oh, yeah. I just assumed he all ready knew that.

Share this post


Link to post
Share on other sites
Sign in to follow this  

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