Sign in to follow this  
ahuimanu

Eventually stupid question about VC++2K5 Express

Recommended Posts

Hey folks,there one little detail that I appear to be too stupid to figure out.When opening up the FSX SDK sample gauge file in VC++ 2005 Express, all single *.cpp sub gauge files as well as the main gauge CPP appear under Source Files within the Project Explorer.In that gauge and also in my own gauges the sub gauges are included via #include "subgauge.cpp" from the main gauge, just as usual.But now, if I create a new project and add the files to the Project Explorer, things won't compile anymore. The only solution seems to be removing the sub gauges from the explorer. It seems that then only the main CPP is being compiled directly, which of course still includes the sub gauges using the #include directive.Obviously I would like to have all my sub gauges within the Project Explorer though for much improved access...If I have all the sub gauges within the Project Explorer it seems the compiler tries to compile every single file more or less out of context. I wonder why it works in the MS sample though.What am I missing here??Thanks for any hint,Etienne

Share this post


Link to post
Share on other sites
Help AVSIM continue to serve you!
Please donate today!

If you right-click on the sub-gauge file in the Solution Explorer, you should find the option to "Exclude from Build." You need to ensure you have excluded all of the sub-gauge source files here, as they are compiled by way of the #include statements in your main source file.Doug

Share this post


Link to post
Share on other sites

Thanks for the prompt reply, exactly the one I was looking for.Still, the MS sample does not seem to need this option...Glad it now works though. :)Thanks again!Etienne

Share this post


Link to post
Share on other sites

If you write click on them in the MS sample, you should see that they are alread excluded, that is why.You can only build them once... either by putting them under source, or by #including them.You could put a "#pragma once" at the top too if you want I suppose.Most of us here do not use the MS way (including source) as this is considered bad form. Most of us have a completely different setup so that we can use C++ as well.

Share this post


Link to post
Share on other sites

>Most of us here do not use the MS way (including source) as>this is considered bad form. Most of us have a completely>different setup so that we can use C++ as well....and at least one of us (me) uses a modified form which combines both... ;)

Share this post


Link to post
Share on other sites

>If you write click on them in the MS sample, you should see>that they are alread excluded, that is why.>>You can only build them once... either by putting them under>source, or by #including them.>>You could put a "#pragma once" at the top too if you want I>suppose.>>Most of us here do not use the MS way (including source) as>this is considered bad form. Most of us have a completely>different setup so that we can use C++ as well.>can you elaborate?

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this