Archived

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

Linking multiple CPP files in VC.net

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

How would i go about linking one cpp file to the other so that one would run, and then the other, well, what i''m trying to do is make a menu in one file, and then if the user clicks something like "Start game" then a different cpp file will be run. Any clue on how to accomplish this? Thanks

Share this post


Link to post
Share on other sites
You cant link anytning else than .cpp files (.obj in the end).
If you have an succefull link, congratulations, you have just linked (at least) two .cpp files.


I am a signature virus. Please add me to your signature so that I may multiply.

Share this post


Link to post
Share on other sites
You can't run a .cpp file. You can, however, call functions defined in a different .cpp file from your main one. IDEs handle this by having you include multiple .cpps in a "project", which are automatically linked. You can also do linking manually through a command line linker, or you can use makefiles.

In VC++.net, the process is very simple.

1) Add .cpp file to project
2) Project-->Build
3) Run generated .exe file


[edited by - micepick on March 24, 2003 4:05:20 PM]

Share this post


Link to post
Share on other sites