![]() |
|
|||||||
| Addon Development Developers post news, updates, & discussions here about your projects in development. |
![]() |
|
|
Thread Tools |
|
|
#31 |
|
Orbinaut
![]() ![]() |
Good Greif Orb, well spotted, compiles and links now, no errors or warnings.
Would never have seen that myself, hard to see on this laptop, but I'll keep that in mind. Works nicely in the cockpit too, scrolls up and down, onto part 2 tommorow... Many thanks, N. Last edited by Notebook; 05-07-2011 at 08:29 PM. |
|
|
|
|
|
#32 |
|
O-F Administrator
![]() ![]() ![]() |
Quote:
![]() I wouldn't have spotted it myself if I hadn't changed color for operators in the editor of the VS IDE (Tools -> Options... -> Environment -> Fonts and Colors -> Operator). |
|
|
|
|
|
#33 |
|
Orbinaut
![]() ![]() |
Thats a good idea, I have enough fun and games without fighting the IDE!
N. |
|
|
|
|
|
#34 |
|
Orbinaut
![]() ![]() |
Started Lesson 5, looking good:
http://i89.photobucket.com/albums/k2...tcottP2_3_.jpg Blits and fonts next, looks heavy... N. |
|
|
|
|
|
#35 |
|
Orbinaut
![]() ![]() |
I'm not getting any MFD buttons after completing Part 2:
http://www.orbiter-forum.com/blog.php?b=576 Haven't put the second code segment in relating to fonts, I'm hoping I can get away with that. I'll be happy with blank buttons till I understand the fonts and labelling stuff. Attached "instruments.cpp" & "instuments.cpp" to the project, and corrected as per Bibi Uncle's comments. Compiles, links and runs OK, no buttons though, just my plain background and the surface MFD. I think it may be due to the third code segemnt not relating to my vessel? Quote:
All help appreciated, N. |
|
|
|
|
|
#36 |
|
O-F Administrator
![]() ![]() ![]() |
Quote:
What do you mean by "third code segment not relating to vessel"? Is it outside of the vessel class or something? |
|
|
|
|
|
#37 |
|
Orbinaut
![]() ![]() |
Thaknks for the reply Orb.
Bigger problems I think! While I added the instrument.h and instruments.cpp to the project, I didn't #iinclude them in Westcott_P2.cpp (or Westcott_P2.h)?. Done that now, and its happy #including Instruments.h, but I get lots of linker errors if I try to include Instruments.cpp. I guess I'll have to sort this out before I get any further? Thanks, N. |
|
|
|
|
|
#38 |
|
Orbinaut
![]() ![]() |
Thought it was going too well...Don't know what I've done, think I'll delete and start again.
Before that, anything here that stands out obvious to the experts? http://i89.photobucket.com/albums/k2...tcottP2_4_.jpg All input appreciated. N. |
|
|
|
|
|
#39 |
|
Donator
![]() ![]() |
Don't know...how does the file begin, maybe one of the includes has a tiny error.
|
|
|
|
|
|
#40 |
|
Clueless developer
![]() |
I don't see any #include's here...
|
|
|
|
|
|
#41 |
|
Orbinaut
![]() ![]() |
There was a #include "Instrument.h" in the Instruments.cpp file, but I moved that to the Wescott_P2.h file, good move?...
Totally lost now, I'll start again and see if I can get the Instruments.cpp and Instuments.h files to compile and link. They did yesterday, so I've obviously chopped a , or a ; off somewhere. Thanks, N. |
|
|
|
|
|
#42 |
|
Donator
![]() ![]() |
well, remember that ".h" files are completely ignored unless you include them in the current CPP (that just gets compiled) - every CPP that relies on the interfaces defined in the header file has to include the header - either directly by a #include statement, or indirectly by getting included by an header file that was already included by the CPP (directly or indirectly).
If you have multiple CPP files in your project, that all refer to the same header, every CPP file has to include this header. There is no implicit inclusion of the header files. |
|
|
|
|
|
#43 |
|
Orbinaut
![]() ![]() |
Thanks Urwumpe, another little? thing I didn't know. Back to the cut&paste..
N. |
|
|
|
|
|
#44 |
|
Donator
![]() ![]() |
Quote:
Every .cpp is compiled independently into a so-called object file, and these object files are after all cpp files had been compiled, joined together by the linker to form the module. The header files are the only parts that are really shared between the object files and should only contain interface definitions, but no executable code (Except short inline functions, inline functions are short snippets of code that are copied into the place in which you call the inline function, different to normal function calls, which permits optimizing each "function call" for the context, making your program faster). You should define the interfaces of all your functions in the appropriate header file, such forward declarations help you finding errors later, even if you don't always need them. In brief: In the headers you describe how the functions are called or how the data structures look like, in the cpp files you describe how they behave. |
|
|
|
| Thanked by: |
|
|
#45 |
|
Orbinaut
![]() ![]() |
Plodding on...
Getting this error: http://i89.photobucket.com/albums/k2...tcottP2_5_.jpg Dosen't like y0/y1 being re-defined, don't particulary want to, but how do I stop it? The constants in this group are ones I just made up, trying to get it to compile/link at the moment. Haven't altered the Instrument.h/cpp files yet. All help appreciated. N. |
|
|
|
![]() |
|
| Thread Tools | |
|
|
|||||
| Quick Links | Need Help? |