Talk:Free Compiler Setup

From OrbiterWiki
Revision as of 03:17, 28 July 2006 by Rko281 (talk | contribs) (Notes on starting a new project from scratch)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Starting from scratch

I spent several frustrating days trying to get the CustomMFD to compile and was glad to find this wiki page with one of the things I was missing; excluding msvsirt.lib. I still kept running into problems, however, since I moved the location of the API and wasn't able to change the ..\..\lib\ references through the IDE directly. Eventually I threw in the towl and created a new project from scratch rather than converting the sample project files to the new format (which I'm guessing had the hardcoded directories.)

I'm including my notes on how to set this up below in the hopes that 1) it may save someone hours of frustration, and 2) if anyone else has a similar experience they can incorporate some of this back into the main article. I'm hesistant on the latter part since I did this on a development machine with an older version of the SDK. I don't want to clutter the main article if these problem were unique to me. With that said, here goes.

First, I moved the Orbiter SDK to the Projects directory and created a new "Empty Project" in Projects as well. I then copied over the cpp and h file for the CustomMFD sample and nothing else. After fixing the fstream include problem mentioned in the main article and setting the configuration to Release, I changed the following settings under Properties:

  • Configuration Properties:
  • General
  • Configuration Type: Dynamic Library (.dll)
  • C/C++
  • Genreal
  • Additional Include Directories:"C:\Program Files\Microsoft Platform SDK\Include";"C:\Documents and Settings\username\My Documents\Visual Studio 2005\Projects\Orbitersdk\include"
  • Warning Level: Level 3 (/W3)
  • Preprocessor
  • Preprocessor Definitions: _CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE
  • Code Generation
  • Runtime Library: Multi-threaded DLL (/MD)
  • Command Line: /O2 /I "C:\Program Files\Microsoft Platform SDK\Include" /I "C:\Documents and Settings\username\My Documents\Visual Studio 2005\Projects\Orbitersdk\include" /D "_CRT_SECURE_NO_DEPRECATE" /D "_CRT_NONSTDC_NO_DEPRECATE" /D "_WINDLL" /FD /EHsc /MD /Fo"Release\\" /Fd"Release\vc80.pdb" /W3 /nologo /c /TP /errorReport:prompt
  • Linker
  • General
  • Output File: $(OutDir)\$(ProjectName).dll
  • Additional Library Directories: "C:\Program Files\Microsoft Platform SDK\Lib";"C:\Documents and Settings\username\My Documents\Visual Studio 2005\Projects\Orbitersdk\lib"
  • Input
  • Additional Dependencies: user32.lib gdi32.lib orbiter.lib orbitersdk.lib
  • Ignore Specific Library: msvcirt.lib
  • Command Line: /OUT:"C:\Documents and Settings\username\My Documents\Visual Studio 2005\Projects\CustomMFD\Release\CustomMFD.dll" /NOLOGO /LIBPATH:"C:\Program Files\Microsoft Platform SDK\Lib" /LIBPATH:"C:\Documents and Settings\username\My Documents\Visual Studio 2005\Projects\Orbitersdk\lib" /DLL /MANIFEST /MANIFESTFILE:"Release\CustomMFD.dll.intermediate.manifest" /NODEFAULTLIB:"msvcirt.lib" /ERRORREPORT:PROMPT user32.lib gdi32.lib orbiter.lib orbitersdk.lib kernel32.lib

In the above settings list, I included the "Command Line" just as a reference. I didn't manually edit it. This setup was tested using Microsoft Visual Studio 2005 Version 8.0.50727.42.

One item of particular interest is the extra preprocessor includes. Without those, I was getting dozens of compile warnings related to the string functions. You can search the MSDN forums for more information on those.

And again, if anyone finds help with any of this, please merge the useful bits back to the main article.

--Rko281 07:17, 28 July 2006 (MSD)