New Release VC++ 2008 Startup Projects

EtherDragon

Addon Developer
Addon Developer
Joined
Mar 20, 2008
Messages
106
Reaction score
0
Points
0
Location
Ellensburg
This is for you would-be Add-On Developers out there.

I uploaded two ready-to-go Solutions, so you can begin add-on development quicker.

ShuttlePB 2008
[ame="http://www.orbithangar.com/searchid.php?ID=4207"]ShuttlePB SDK for VC++ 2008 Express[/ame]
This preconfigured solution will replace your existing ShuttlePB.dll module with a "new" one that behaves exactly the same. The important difference is, you built it on your machine! You can then get into the source code and use this as a basis for your own space-craft modules.

DeltaGlider 2008
[ame="http://www.orbithangar.com/searchid.php?ID=4208"]DeltaGlider SDK for VC++ 2008 Express[/ame]
This rpeconfigured solution will replace your existing DeltaGlider.dll module with a new one compiled from your computer. You can use this as a launching point for more advanced "DeltaGlider" style custom projects - but mainly I put it up as a reference.

To get started you will need:
Orbiter SDK
http://orbi t.medphys.ucl.ac.uk/orbit.html
Microsoft Visual C++ 2008 Express
http://www .microsoft.com/express/download/
Microsoft Windows SDK for Windows Server 2008 and .NET Framework 3.5
http://www.microsoft.com/downloads/details.aspx?FamilyID=e6e 1c3df-a74f-4207-8586-711ebe331cdc&displaylang=en

~ED
 
I checked OH and noticed about 130-140 downloads of each of these startup projects.

I wanted to know if anyone has had good success / problems / or questions with it?
 
I checked OH and noticed about 130-140 downloads of each of these startup projects.

I wanted to know if anyone has had good success / problems / or questions with it?

Hi and thank you.

I've just installed VC++ 2008 Express and I'm now playing
with your VC++ 2008 Deltaglider SDK as my first venture into
Orbiter add-on's.

So far it goes well, I made a 1680x1050 size 2d panel with
3 MFD's to try to get a feeling, about what it takes to make
add-on's for Orbiter. But I stopped working on the panel for it
was not the default DeltaGlider i wanted to play with, but the
Shuttle A and the 2d panel in particularly.

So :hail:how do I get the Shuttle A from orb2006'SDK to work in VC++ 2008 ?


Jan. Post no. 1
 
Thanks for those, they look really useful.

Has anyone had experience in converting a project from VS 2005 to VS 2008?
 
So :hail:how do I get the Shuttle A from orb2006'SDK to work in VC++ 2008 ?
You can copy DeltaGlider.sln and DeltaGlider.vcproj to ShuttleA directory, rename them, and change what's needed inside those files to work with ShuttleA by using a text editor. Those files are XML, so all what is inside them is just text.

I usually use notepad-like text editor to edit .sln and .vcproj, replace project name / project file name / output file names with new ones, remove unneeded file references, and after opening this project in Visual Studio, I just simply add other files in solution explorer. And it have always worked for me when I did it this way.


Has anyone had experience in converting a project from VS 2005 to VS 2008?
No problems with converting projects from VS2005 to VS2008 here. Have you had any problem?
 
No problems with converting projects from VS2005 to VS2008 here. Have you had any problem?

No, I haven't tried yet. I just assumed from past experience that a 2005 project will not simply load into 2008 without loads of subtle problems.
 
No, I haven't tried yet. I just assumed from past experience that a 2005 project will not simply load into 2008 without loads of subtle problems.

When you open a VC2005 project, it will be converted to VC2008 format. No problems there.
 
You can copy DeltaGlider.sln and DeltaGlider.vcproj to ShuttleA directory, rename them, and change what's needed inside those files to work with ShuttleA by using a text editor. Those files are XML, so all what is inside them is just text.
...
No problems with converting projects from VS2005 to VS2008 here. Have you had any problem?

I've changed the DeltaGlider.vcproj file to reflect the shuttleA settings
to the best of my ability.

But I get a compile error I don't know how to get rid off ?
(i don't have the file msvcirt.lib on my computer.)

1>------ Build started: Project: ShuttleA2008, Configuration: Debug Win32 ------
1>Compiling...
1>ShuttleA.cpp
1>Compiling resources...
1>Microsoft (R) Windows (R) Resource Compiler Version 6.0.5724.0
1>Copyright (C) Microsoft Corporation. All rights reserved.
1>Compiling manifest to resources...
1>Microsoft (R) Windows (R) Resource Compiler Version 6.0.5724.0
1>Copyright (C) Microsoft Corporation. All rights reserved.
1>Linking...
1>LINK : fatal error LNK1104: cannot open file 'msvcirt.lib'
1>Build log was saved at "file://d:\Orbiter\orbitersdk\samples\ShuttleA\Debug\BuildLog.htm"
1>ShuttleA2008 - 1 error(s), 0 warning(s)
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========



Jan
 

Attachments

Last edited:
1>LINK : fatal error LNK1104: cannot open file 'msvcirt.lib'
1>Build log was saved at "file://d:\Orbiter\orbitersdk\samples\ShuttleA\Debug\BuildLog.htm"

Old problem. Go to your project's properties/Linker/Input, and add 'msvcirt.lib' (without quotes) to 'Ignore Specific Library'.
 
Ok, what about this one ?

1>------ Build started: Project: ShuttleA2008, Configuration: Debug Win32 ------
1>Compiling...
1>ShuttleA.cpp
1>Compiling resources...
1>Microsoft (R) Windows (R) Resource Compiler Version 6.0.5724.0
1>Copyright (C) Microsoft Corporation. All rights reserved.
1>Compiling manifest to resources...
1>Microsoft (R) Windows (R) Resource Compiler Version 6.0.5724.0
1>Copyright (C) Microsoft Corporation. All rights reserved.
1>Linking...
1>LINK : .\..\..\..\Modules/ShuttleA.dll not found or not built by the last incremental link; performing full link
1> Creating library .\..\..\..\Modules/ShuttleA.lib and object .\..\..\..\Modules/ShuttleA.exp
1>LINK : warning LNK4098: defaultlib 'MSVCRT' conflicts with use of other libs; use /NODEFAULTLIB:library
1>Embedding manifest...
1>Microsoft (R) Windows (R) Resource Compiler Version 6.0.5724.0
1>Copyright (C) Microsoft Corporation. All rights reserved.
1>Build log was saved at "file://d:\Orbiter\orbitersdk\samples\ShuttleA_Mod\Debug\BuildLog.htm"
1>ShuttleA2008 - 0 error(s), 1 warning(s)
========== Build: 1 succeeded, 0 failed, 0 up-to-date, 0 skipped ==========


The original ShuttleA.dll is 1.6mb the one build above is only 1mb and Orbiter crashes.

Edit: The ShuttleA build above works for the colour change I have made to the MFD
buttons is visible, the crash must be something else, when selecting the default shuttle A scenario.

Jan
 
Last edited:
Some configs are messed up. My advice? Delete that project file, create a new one (File->New->Project from Existing Code, Next, tell VC++ your project's dir and name and tadaa).

Next you need to set some configs in your project's properties:
1. C/C++->Additional Include Directories: put Orbiter SDK include path
2. Linker->Input->Additional Depedencies: from Orbiter SDK lib: Orbitersdk.lib and orbiter.lib.
3. Linker->Input->Ignore Specific Library: msvcirt.lib

Compile and everything should be fine.
 
Ok, what about this one ?

1>LINK : warning LNK4098: defaultlib 'MSVCRT' conflicts with use of other libs; use /NODEFAULTLIB:library
Try to add either libcmt.lib and libcpmt.lib or msvcrt.lib and msvcprt.lib to ignored libraries. IIRC the default runtime library in that project is Multi-threaded DLL (/MD), so add to ignored libraries the former (i.e. libcmt/libcpmt). EDIT: You compile the code in debug mode, so also msvcrtd.lib or libcmtd.lib could conflict with msvcrt.lib.

That's in a project file for "Runtime library: Multi-threaded (/MT)" (statically linked) code:
HTML:
<Tool
	Name="VCLinkerTool"
	IgnoreDefaultLibraryNames="msvcirt.lib;msvcrt.lib;msvcprt.lib"
... snip ...
/>

And this for "Runtime library: Multi-threaded DLL (/MD)" (using MSVC[PR]xx.dll dependencies) code in a project file:
HTML:
<Tool
	Name="VCLinkerTool"
	IgnoreDefaultLibraryNames="msvcirt.lib;libcmt.lib;libcpmt.lib"
... snip ...
/>
 
Last edited:
Does this work on the O10 or just 06?
 
Does this work on the O10 or just 06?
Orbiter 2010 has its own VS2005 project files for all its SDK samples, and property sheets which are inherited in individual samples. They only need to be automatically converted from VS2005 to VS2008 version.
 
Oh, didn't know that, but now that I do I think it's time to go poke that a bit. Maybe I get something released eventually.

8th wonder of the world, something involving VS2008 actually worked the first time I tried it. Now to run a complete system scan to figure out what went wrong. Probably a glitch in the VS.
 
Last edited:
1>------ Build started: Project: ShuttleA, Configuration: Debug Win32 ------
1>Compiling...
1>ShuttleA.cpp
1>Compiling resources...
1>Microsoft (R) Windows (R) Resource Compiler Version 6.0.5724.0
1>Copyright (C) Microsoft Corporation. All rights reserved.
1>Compiling manifest to resources...
1>Microsoft (R) Windows (R) Resource Compiler Version 6.0.5724.0
1>Copyright (C) Microsoft Corporation. All rights reserved.
1>Linking...
1> Creating library .\Debug/ShuttleA.lib and object .\Debug/ShuttleA.exp
1>Embedding manifest...
1>Microsoft (R) Windows (R) Resource Compiler Version 6.0.5724.0
1>Copyright (C) Microsoft Corporation. All rights reserved.
1>Build log was saved at "file://d:\Orbiter2006\samples\ShuttleA\Debug\BuildLog.htm"
1>ShuttleA - 0 error(s), 0 warning(s)
========== Build: 1 succeeded, 0 failed, 0 up-to-date, 0 skipped ==========

Now all compile fine, but Orbiter crashes the moment I load a scenario
with the shuttleA in it.

Has anyone actually successfully got the Shuttle A from orbiter2006SDK
samples/shuttleA to compile and work after it has been converted to
a VC++ 2008 project ?

Edit:
VC++ 2008 is my first Microsoft programming experience, so I might miss
something important.

Jan.
 
Last edited:
Why are you compiling a debug version?
 
Why are you compiling a debug version?

Building a debug version of your add-on is absolutely vital for proper testing and debugging of your code: beyond being able to step through the code with the debugger and inspect variables, debug versions fill unallocated memory with 0xCDCDCDCD or some other pattern so the add-on will crash if unallocated or freed memory is used as a pointer. In fact, you should only build a release version of your DLL when you are doing final testing before making some sort of public release, such as a beta release or later.

EDIT:
Jan, if you're getting a CTD on startup I recommend simply running Orbiter.exe under the Visual Studio debugger and seeing where it crashes. It will quite likely be inside your DLL, and then you can inspect variables and see what caused the crash. This is another reason why debug builds are so important: with the debugger you can actually see what's going on instead of just guessing about it.
 
Last edited:
I think I'm messing more up then what is good.

Orbiter Crashes when loading the scenario 'Shuttle A - Launch'
but not the scenario 'ShuttleA - Olympus spaceport'

So it must be something about ShuttleA's cargo and the default version
that comes with the SDK.

ShuttleA MarkII: is that the default Orbiter2006 release version ?


Jan.
 
Building a debug version of your add-on is absolutely vital for proper testing and debugging of your code: beyond being able to step through the code with the debugger and inspect variables, debug versions fill unallocated memory with 0xCDCDCDCD or some other pattern so the add-on will crash if unallocated or freed memory is used as a pointer. In fact, you should only build a release version of your DLL when you are doing final testing before making some sort of public release, such as a beta release or later.
That said, I'd like to point out that it's absolutely imperative that you build release versions when you go to distribute it or put it up on OrbitHangar, because debug versions won't work without VS installed on the computer (or the necessary DLLs acquired elsewhere).
 
Back
Top