October 28, 200619 yr 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
October 28, 200619 yr 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
October 28, 200619 yr 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
October 28, 200619 yr 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.
October 29, 200619 yr Moderator >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... ;) Fr. Bill AOPA Member: 07141481 AARP Member: 3209010556 Avsim Board of Directors | Avsim Forums Moderator
November 27, 200619 yr Author >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? Jeff Bea I am an avid globetrotter with my trusty Lufthansa B777F, Polar Air Cargo B744F, and Atlas Air B748F.
Create an account or sign in to comment