VisualC.html
changeset 7229 2636ad0a52e4
parent 2819 222aa027e650
child 7314 b0726d41aa2e
equal deleted inserted replaced
7228:9cf41f66562c 7229:2636ad0a52e4
     2 	<HEAD>
     2 	<HEAD>
     3 		<TITLE>Using SDL with Microsoft Visual C++</TITLE>
     3 		<TITLE>Using SDL with Microsoft Visual C++</TITLE>
     4 	</HEAD>
     4 	</HEAD>
     5 	<BODY>
     5 	<BODY>
     6 		<H1>
     6 		<H1>
     7 			Using SDL with Microsoft Visual C++ 5,6&nbsp;and 7
     7 			Using SDL with Microsoft Visual C++
     8 		</H1>
     8 		</H1>
     9 		<H3>
     9 		<H3>
    10 			by <A HREF="mailto:snowlion@sprynet.com">Lion Kimbro </A>and additions by <A HREF="mailto:james@conceptofzero.net">
    10 			by <A HREF="mailto:snowlion@sprynet.com">Lion Kimbro </A>and additions by <A HREF="mailto:james@conceptofzero.net">
    11 				James Turk</A>
    11 				James Turk</A>
    12 		</H3>
    12 		</H3>
    13 		<p>
    13 		<p>
    14 			You can either use the precompiled libraries from <A HREF="http://www.libsdl.org/download.php">
    14 			You can either use the precompiled libraries from <A HREF="http://www.libsdl.org/download.php"> the SDL Download web site </A>, or you can build SDL yourself.
    15 				the SDL Download web site </A>, or you can build SDL yourself.
       
    16 		</p>
    15 		</p>
    17 		<H3>
    16 		<H3>
    18 			Building SDL
    17 			Building SDL
    19 		</H3>
    18 		</H3>
    20 		<P>
    19 		<P>
    21 			Go into the VisualC directory and double-click on the VC++ file "<CODE>SDL.dsw</CODE>" <STRONG><FONT color="#009900">("<CODE>SDL.sln</CODE>")</FONT></STRONG>. This should open up the IDE.
    20 			Go into the VisualC directory and double-click on the Visual Studio solution for your version of Visual Studio, e.g. <CODE>SDL_VS2008.sln</CODE> This should open up the IDE.
    22 		</P>
       
    23 		<P>
       
    24 			You may be prompted at this point to upgrade the workspace, should you be using 
       
    25 			a more recent version of Visual C++. If so, allow the workspace to be upgraded.
       
    26 		</P>
    21 		</P>
    27 		<P>
    22 		<P>
    28 			Build the <CODE>.dll</CODE> and <CODE>.lib</CODE> files.
    23 			Build the <CODE>.dll</CODE> and <CODE>.lib</CODE> files.
    29 		</P>
    24 		</P>
    30 		<P>
    25 		<P>
    31 			This is done by right clicking on each project in turn (Projects are listed in 
    26 			This is done by right clicking on each project in turn (Projects are listed in 
    32 			the Workspace panel in the FileView tab), and selecting "Build".
    27 			the Workspace panel in the FileView tab), and selecting "Build".
    33 		</P>
    28 		</P>
    34 		<P>
    29 		<P>
    35 			If you get an error about SDL_config.h being missing, you should
       
    36 			copy include/SDL_config.h.default to include/SDL_config.h and try again.
       
    37 		</P>
       
    38 		<P>
       
    39 			You may get a few warnings, but you should not get any errors. You do have to 
    30 			You may get a few warnings, but you should not get any errors. You do have to 
    40 			have at least the DirectX 5 SDK installed, however. The latest 
    31 			have at least the DirectX 9 SDK installed, however. The latest 
    41 			version of DirectX can be downloaded or purchased on a cheap CD (my 
    32 			version of DirectX can be downloaded from <A HREF="http://www.microsoft.com">Microsoft</A>.
    42 			recommendation) from <A HREF="http://www.microsoft.com">Microsoft </A>.
       
    43 		</P>
    33 		</P>
    44 		<P>
    34 		<P>
    45 			Later, we will refer to the following .lib and .dll files that have just been 
    35 			Later, we will refer to the following .lib and .dll files that have just been 
    46 			generated:
    36 			generated:
    47 		</P>
    37 		</P>
    48 		<ul>
    38 		<ul>
    49     <li> SDL.dll</li>
    39     <li> SDL2.dll</li>
    50     <li> SDL.lib</li>
    40     <li> SDL2.lib</li>
    51     <li> SDLmain.lib</li>
    41     <li> SDL2main.lib</li>
    52     </ul>
    42     </ul>
    53 		<P>
    43 		<P>
    54 			Search for these using the Windows Find (Windows-F) utility, if you don't 
    44 			Search for these using the Windows Find (Windows-F) utility inside the VisualC directory.
    55 			already know where they should be. For those of you with a clue, look inside 
       
    56 			the Debug or Release directories of the subdirectories of the Project folder. 
       
    57 			(It might be easier to just use Windows Find if this sounds confusing. And 
       
    58 			don't worry about needing a clue; we all need visits from the clue fairy 
       
    59 			frequently.)
       
    60 		</P>
    45 		</P>
    61 		<H3>
    46 		<H3>
    62 			Creating a Project with SDL
    47 			Creating a Project with SDL
    63 		</H3>
    48 		</H3>
    64 		<P>
    49 		<P>
    94 			</P>
    79 			</P>
    95 			<P>
    80 			<P>
    96 				Copy the following files into your Project directory:
    81 				Copy the following files into your Project directory:
    97 			</P>
    82 			</P>
    98 			<ul>
    83 			<ul>
    99      <li> SDL.dll</li>
    84      <li> SDL2.dll</li>
   100      </ul>
    85      </ul>
   101 			<P>
    86 			<P>
   102 				Add the following files to your project (It is not necessary to copy them to 
    87 				Add the following files to your project (It is not necessary to copy them to 
   103 				your project directory):
    88 				your project directory):
   104 			</P>
    89 			</P>
   105 			<ul>
    90 			<ul>
   106      <li> SDL.lib </li>
    91      <li> SDL2.lib </li>
   107      <li> SDLmain.lib</li>
    92      <li> SDL2main.lib</li>
   108      </ul>
    93      </ul>
   109 			<P>
    94 			<P>
   110 				(To add them to your project, right click on your project, and select "Add 
    95 				(To add them to your project, right click on your project, and select "Add 
   111 				files to project")
    96 				files to project")
   112 			</P>
    97 			</P>
   120 		</H3>
   105 		</H3>
   121 		<P>
   106 		<P>
   122 			Now create the basic body of your project. The body of your program should take 
   107 			Now create the basic body of your project. The body of your program should take 
   123 			the following form: <CODE>
   108 			the following form: <CODE>
   124 				<PRE>
   109 				<PRE>
   125 #include "SDL.h"
   110 #include "SDL2.h"
   126 
   111 
   127 int main( int argc, char* argv[] )
   112 int main( int argc, char* argv[] )
   128 {
   113 {
   129   // Body of the program goes here.
   114   // Body of the program goes here.
   130   return 0;
   115   return 0;