CompileWithVisualCpp

(Difference between revisions)
Jump to: navigation, search
(3 intermediate revisions by one user not shown)
Line 1: Line 1:
 
{{obsolete}}
 
{{obsolete}}
 
These instruction should work for Stellarium version 0.10.2 or before. For more recent versions, please use the [[Windows_Build_Instructions]] method which is much simpler.  
 
These instruction should work for Stellarium version 0.10.2 or before. For more recent versions, please use the [[Windows_Build_Instructions]] method which is much simpler.  
 +
 +
Qt now contains a version for use with Visual Studio.  This method may be relevant and should be investigated
  
 
== Visual Studio settings ==
 
== Visual Studio settings ==

Revision as of 23:04, 10 August 2012

Some or all of the information on this page is no longer accurate.

It may be relevant to an older version of Stellarium, or it may not be relevant at all. This page itself should be updated, archived or deleted.

This warning has been here since some undetermined moment.

These instruction should work for Stellarium version 0.10.2 or before. For more recent versions, please use the Windows_Build_Instructions method which is much simpler.

Qt now contains a version for use with Visual Studio. This method may be relevant and should be investigated

Contents

Visual Studio settings

before compiling

Adding paths

Adding paths for include files and libary files To add newly added libraries to default search path for compilation and debugging : start Visual Studio and go to Tools->Options Add external Directories to "Microsoft Visual Studio" from Tools->Options, select "Project and Solutions" anf from there "VC++ Directories".

Select "Include files" from "Show directories for:" and add directories :

C:\Zlib\include
C:\SDL\include
C:\freetype\include
C:\libjpeg\include
C:\libpng\include
C:\Boost\include
C:\GnuWin32\include

Next add Library locations of libraries, Select "Library Files" from "Show directories for:" and add directories:

C:\Zlib\lib
C:\SDL\lib
C:\freetype\lib
C:\libjpeg\lib
C:\libpng\lib
C:\Boost\lib
C:\GnuWin32\lib

Create Solution

1) To create solution for stellarium

* Select "New...->Project" from "File"-menu
* From "Visual C++" type select general and from there select "Empty Project"
* Enter name form project "Stellarium"
* Enter name for Solution "Stellarium"
* If You want to change the location of project just do it ;}
* Click "OK"

Now there should be a solution called "stellarium" and under it project called "stellarium". Next step is to set the project properties

2) Project Properties

Select "Project->Properties"
* Select "All Configurations" from "Configuration:", browse and set 
  in "Configuration Properties" and set 
 General : 
  Output Directory as C:\Stellarium
  Configuration Type as Appllication (.exe)
 C/C++
  General
   Additional Include Directories:
    ...\stellarium\src\planetsephems;
    ...\stellarium\src\stelutils;
    ...\stellarium\src\msdirent;
    ..\stellarium\src;
   Preprocessor
    Preprocessor Definitions:
     _USE_MATH_DEFINES;
     _CRT_SECURE_NO_DEPRECATE;
     _ATL_SECURE_NO_DEPRECATE;
     main=SDL_main;
     POSIX;
     WIN32;
     WIN32_LEAN_AND_MEAN
 Linker
  Input
   Additipnal Dependices
    msvcrt.lib 
    Ws2_32.lib 
    freetype221.lib 
    libpng13.lib 
    SDL.lib 
    libjpeg.lib 
    libintl.lib 
    SDLmain.lib 
    zdll.lib 
    Opengl32.lib 
    Glu32.lib 
   Ignore Specific Libraries as LIBCMT.lib
  System
   SubSystem as Console (/SUBSYSTEM:CONSOLE)
* Select "Release" from "Configuration:", browse and set 
  in "Configuration Properties" and set 
 C/C++
  General
   Optimization as Optimization: Maximize Speed (/O2)
* Select "Debug" from "Configuration:", browse and set 
  in "Configuration Properties" and set 
 C/C++
  General			
   Debug Information Format as Program Database for Edit & Continue (/ZI)
   Optimization
    Optimization as Disabled (/Od)
   Preprocessor
     _USE_MATH_DEFINES;
     _CRT_SECURE_NO_DEPRECATE;
     _ATL_SECURE_NO_DEPRECATE;
     main=SDL_main;
     POSIX;
     WIN32;
     WIN32_LEAN_AND_MEAN
     DEBUG
   Output Files
    Program Database File Name as $(TargetDir)\vc80.pdb
  Linker
   Input
    Ignore Specific Libraries as LIBCMT.lib
   Debugging
    Generate Debug Info as Yes(/DEBUG)

2) Add files to "stellarium" project Add existing files to project:

"Header Files"  : Add existing files, select all header files from ...\Stellarium\src
"Source Files"  : Add existing files, select all header files from ...\Stellarium\src

Now we have solution and project for stellarium, next thing is to add projects for "iniparser", "msdirent", "plantetsephms" and "stelutils". The creation of these projects is similar to "stellarium" project except the :

"Project type"s areStatic Library (.lib) 

and the

"C/C++->Preprocessor->Preprocessor Defines"s are 
_CRT_SECURE_NO_DEPRECATE;_USE_MATH_DEFINES 

also the "stelutils"-project should have

"Additional Include Directories" as 
...\stellarium\src\stelutils\iniparser
...\stellarium\src\planetsephems;
...\stellarium\src\stelutils;
...\stellarium\src\msdirent;
...\stellarium\src

Create dependencies

To create dependencies right-click on "Stellarium" solution and select "Properties" 1) check that the "Single startup project" in "Common Properties->Startup Project" is checkd and the project selected is "Stellarium". 2) on "Project Dependencies" Stellarium is depended all other projects and other projects are independed

Build

Yes, that's all folks! Just try to build the solution first on "Debug"-mode

Run

Before actually run the application You must copy the libraries *.dll's into the target directory of build e.g. C:\Stellarium or have the *.dll's in Your path (I prefere the first: copy the dll's)

Also the directory structure of config/data/texture and so on must be present in the target directory e.g. C:\Stellarium

That's all !

Now! Just have fun and don't hesitate to contact me if You have problems and/or suggestions

Lippo (lippo dot huhtala at saunalahti dot fi)

Personal tools
Namespaces
Variants
Actions
in this wiki
other languages
Toolbox