Orbiter-Forum  

Go Back   Orbiter-Forum > Orbiter Addons > Addon Development
Register Blogs Orbinauts List Social Groups FAQ Projects Mark Forums Read

Addon Development Developers post news, updates, & discussions here about your projects in development.

Reply
 
Thread Tools
Old 05-07-2011, 08:22 PM   #31
Notebook
Orbinaut
 
Notebook's Avatar

Default

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.
Notebook is offline   Reply With Quote
Old 05-07-2011, 08:38 PM   #32
orb
O-F Administrator
Ninja
 
orb's Avatar

Default

Quote:
Originally Posted by Notebook View Post
 Would never have seen that myself, hard to see on this laptop, but I'll keep that in mind.

{...}

Many thanks, N.
You're welcome.

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).
orb is offline   Reply With Quote
Old 05-07-2011, 08:49 PM   #33
Notebook
Orbinaut
 
Notebook's Avatar

Default

Thats a good idea, I have enough fun and games without fighting the IDE!

N.
Notebook is offline   Reply With Quote
Old 05-08-2011, 04:20 PM   #34
Notebook
Orbinaut
 
Notebook's Avatar

Default

Started Lesson 5, looking good:
http://i89.photobucket.com/albums/k2...tcottP2_3_.jpg

Blits and fonts next, looks heavy...

N.
Notebook is offline   Reply With Quote
Old 05-09-2011, 10:37 AM   #35
Notebook
Orbinaut
 
Notebook's Avatar

Default

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:
MFDButtonCol (VESSEL3 *v, DWORD _lr);
Should *v be pointing to Westcott_P2 vessel?

All help appreciated, N.
Notebook is offline   Reply With Quote
Old 05-09-2011, 11:05 AM   #36
orb
O-F Administrator
Ninja
 
orb's Avatar

Default

Quote:
Originally Posted by Notebook View Post
 I think it may be due to the third code segemnt not relating to my vessel?
Quote:
MFDButtonCol (VESSEL3 *v, DWORD _lr);
Should *v be pointing to Westcott_P2 vessel?
Yes, *v should be pointing to your vessel. Inside of your vessel class it's `this`.

What do you mean by "third code segment not relating to vessel"? Is it outside of the vessel class or something?
orb is offline   Reply With Quote
Old 05-09-2011, 11:58 AM   #37
Notebook
Orbinaut
 
Notebook's Avatar

Default

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.
Notebook is offline   Reply With Quote
Old 05-12-2011, 02:00 PM   #38
Notebook
Orbinaut
 
Notebook's Avatar

Default

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.
Notebook is offline   Reply With Quote
Old 05-12-2011, 02:02 PM   #39
Urwumpe
Donator
 
Urwumpe's Avatar

Default

Don't know...how does the file begin, maybe one of the includes has a tiny error.
Urwumpe is offline   Reply With Quote
Old 05-12-2011, 02:07 PM   #40
Wishbone
Clueless developer
 
Wishbone's Avatar
Default

I don't see any #include's here...
Wishbone is offline   Reply With Quote
Old 05-12-2011, 02:13 PM   #41
Notebook
Orbinaut
 
Notebook's Avatar

Default

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.
Notebook is offline   Reply With Quote
Old 05-12-2011, 02:27 PM   #42
Urwumpe
Donator
 
Urwumpe's Avatar

Default

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.
Urwumpe is offline   Reply With Quote
Old 05-12-2011, 02:31 PM   #43
Notebook
Orbinaut
 
Notebook's Avatar

Default

Thanks Urwumpe, another little? thing I didn't know. Back to the cut&paste..

N.
Notebook is offline   Reply With Quote
Old 05-12-2011, 02:49 PM   #44
Urwumpe
Donator
 
Urwumpe's Avatar

Default

Quote:
Originally Posted by Notebook View Post
 Thanks Urwumpe, another little? thing I didn't know. Back to the cut&paste..

N.
Well, that is pretty deep under the hood of C++.

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.
Urwumpe is offline   Reply With Quote
Thanked by:
Old 05-13-2011, 09:37 AM   #45
Notebook
Orbinaut
 
Notebook's Avatar

Default

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.
Notebook is offline   Reply With Quote
Reply

  Orbiter-Forum > Orbiter Addons > Addon Development


Thread Tools

Posting Rules
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
Forum Jump


All times are GMT. The time now is 07:57 AM.

Quick Links Need Help?


About Us | Rules & Guidelines | TOS Policy | Privacy Policy

Orbiter-Forum is hosted at Orbithangar.com
Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Copyright ©2007 - 2012, Orbiter-Forum.com. All rights reserved.