VisualC.html
changeset 521 136d97397288
parent 368 180837a1db89
child 1131 e044e7c70a50
     1.1 --- a/VisualC.html	Tue Oct 08 15:34:19 2002 +0000
     1.2 +++ b/VisualC.html	Tue Oct 08 15:43:40 2002 +0000
     1.3 @@ -1,193 +1,139 @@
     1.4  <HTML>
     1.5 -
     1.6 -
     1.7 -
     1.8 -<HEAD>
     1.9 -
    1.10 -
    1.11 -
    1.12 -<TITLE> Using SDL with Microsoft Visual C++ 5 and 6 </TITLE>
    1.13 -
    1.14 -
    1.15 -
    1.16 -</HEAD>
    1.17 -
    1.18 -
    1.19 -
    1.20 -<BODY>
    1.21 -
    1.22 -
    1.23 -
    1.24 -<H1> Using SDL with Microsoft Visual C++ 5 and 6 </H1>
    1.25 -
    1.26 -<H3>
    1.27 -     by <A HREF="mailto:snowlion@sprynet.com"> Lion Kimbro </A>
    1.28 -</H3>
    1.29 -
    1.30 -
    1.31 -
    1.32 -<p>
    1.33 -    You can either use the precompiled libraries from
    1.34 -    <A HREF="http://www.libsdl.org/download.php">
    1.35 -    the SDL Download web site </A>,
    1.36 -    or you can build SDL yourself.
    1.37 -</p>
    1.38 -
    1.39 -
    1.40 -<H3> Building SDL </H3>
    1.41 -
    1.42 -<P>
    1.43 -     Unzip the <CODE>VisualC.zip</CODE> file into the directory
    1.44 -     that contains this file (<CODE>VisualC.html</CODE>).
    1.45 -</P>
    1.46 -
    1.47 -<P>
    1.48 -     Be certain that you unzip <CODE> VisualC.zip </CODE>
    1.49 -     into <strong>this</strong> directory and not any other
    1.50 -     directory. If you are using WinZip, be careful to
    1.51 -     make sure that it extracts to <strong>this</strong>
    1.52 -     folder, because it's convenient feature of
    1.53 -     unzipping to a folder with the name of the
    1.54 -     file currently being unzipped will get you in
    1.55 -     trouble if you use it right now. And that's all
    1.56 -     I have to say about that.
    1.57 -</P>
    1.58 -
    1.59 -<P>
    1.60 -     Now that it's unzipped, go into the VisualC directory
    1.61 -     that is created, and double-click on the VC++
    1.62 -     workspace file &quot;<CODE>SDL.dsw</CODE>&quot;.
    1.63 -     This should open up VisualC.
    1.64 -</P>
    1.65 -
    1.66 -<P>
    1.67 -     You may be prompted at this point to upgrade the
    1.68 -     workspace, should you be using a more recent version
    1.69 -     of Visual C++. If so, allow the workspace to be
    1.70 -     upgraded.
    1.71 -</P>
    1.72 -
    1.73 -
    1.74 -<P>
    1.75 -     Build the <CODE>.dll</CODE> and <CODE>.lib</CODE> files.
    1.76 -</P>
    1.77 -
    1.78 -<P>
    1.79 -     This is done by right clicking on each project in turn
    1.80 -     (Projects are listed in the Workspace panel in the
    1.81 -     FileView tab), and selecting &quot;Build&quot;.
    1.82 -</P>
    1.83 -
    1.84 -<P>
    1.85 -     You may get a few warnings, but you should not get
    1.86 -     any errors. You do have to have at least the DirectX
    1.87 -     5 SDK installed, however. (I believe...) The latest
    1.88 -     version of DirectX can be downloaded or purchased
    1.89 -     on a cheap CD (my recommendation) from
    1.90 -     <A HREF="http://www.microsoft.com"> Microsoft </A>.
    1.91 -</P>
    1.92 -
    1.93 -<P>
    1.94 -    Later, we will refer to the following .lib and .dll
    1.95 -    files that have just been generated:
    1.96 -</P>
    1.97 -
    1.98 -    <list>
    1.99 -    <li> SDL.dll
   1.100 -    <li> SDL.lib
   1.101 -    <li> SDLmain.lib
   1.102 -    </list>
   1.103 -
   1.104 -<P>
   1.105 -    Search for these using the Windows Find (Windows-F)
   1.106 -    utility, if you don't already know where they should be.
   1.107 -    For those of you with a clue, look inside the Debug
   1.108 -    or Release directories of the subdirectories of the
   1.109 -    VisualC folder. (It might be easier to just use
   1.110 -    Windows Find if this sounds confusing. And don't worry
   1.111 -    about needing a clue; we all need visits from the
   1.112 -    clue fairy frequently.)
   1.113 -</P>
   1.114 -
   1.115 -
   1.116 -
   1.117 -<H3> Creating a Project with SDL </H3>
   1.118 -
   1.119 -<P>
   1.120 -     Create a project as a Win32 Application.
   1.121 -</P>
   1.122 -
   1.123 -<P>
   1.124 -     Create a C++ file for your project.
   1.125 -</P>
   1.126 -
   1.127 -<P>
   1.128 -     Set the C runtime to "Multi-threaded DLL" in the menu:
   1.129 -     <CODE> Project|Settings|C/C++ tab|Code Generation|Runtime Library </CODE>.
   1.130 -</P>
   1.131 -
   1.132 -<P>
   1.133 -     Add the SDL <CODE>include</CODE> directory to your list
   1.134 -     of includes in the menu:
   1.135 -     <CODE> Project|Settings|C/C++ tab|Preprocessor|Additional include directories </CODE>.
   1.136 -</P>
   1.137 -
   1.138 -<P>
   1.139 -     The &quot;include directory&quot; I am referring to is the
   1.140 -     <CODE>include</CODE> folder within the main SDL
   1.141 -     directory (the one that this HTML file located
   1.142 -     within.
   1.143 -</P>
   1.144 -
   1.145 -<P>
   1.146 -     Now we're going to use the files that we had created
   1.147 -     earlier in the Build SDL step.
   1.148 -</P>
   1.149 -
   1.150 -<P>
   1.151 -     Copy the following files into your Project directory:
   1.152 -</P>
   1.153 -
   1.154 -     <list>
   1.155 -     <li> SDL.dll </li>
   1.156 -     </list>
   1.157 -
   1.158 -<P>
   1.159 -     Copy the following files into your Project directory,
   1.160 -     and <em>add them to your Project</em> as well:
   1.161 -</P>
   1.162 -
   1.163 -     <list>
   1.164 +	<HEAD>
   1.165 +		<TITLE>Using SDL with Microsoft Visual C++</TITLE>
   1.166 +	</HEAD>
   1.167 +	<BODY>
   1.168 +		<H1>
   1.169 +			Using SDL with Microsoft Visual C++ 5,6&nbsp;and 7
   1.170 +		</H1>
   1.171 +		<H3>
   1.172 +			by <A HREF="mailto:snowlion@sprynet.com">Lion Kimbro </A>and additions by <A HREF="mailto:james@conceptofzero.net">
   1.173 +				James Turk</A>
   1.174 +		</H3>
   1.175 +		<p>
   1.176 +			You can either use the precompiled libraries from <A HREF="http://www.libsdl.org/download.php">
   1.177 +				the SDL Download web site </A>, or you can build SDL yourself.
   1.178 +		</p>
   1.179 +		<H3>
   1.180 +			Building SDL
   1.181 +		</H3>
   1.182 +		<P>
   1.183 +			Unzip the <CODE>VisualC.zip</CODE> file into the directory that contains this 
   1.184 +			file (<CODE>VisualC.html</CODE>). <STRONG><FONT color="#009900">If you are using Visual 
   1.185 +					C++ 7 (.NET) you will need to use the file <code>VisualC7.zip.</code></FONT></STRONG>
   1.186 +		</P>
   1.187 +		<P>
   1.188 +			Be certain that you unzip the zip file for your compiler into <strong>this</strong>
   1.189 +			directory and not any other directory. If you are using WinZip, be careful to 
   1.190 +			make sure that it extracts to <strong>this</strong> folder, because it's 
   1.191 +			convenient feature of unzipping to a folder with the name of the file currently 
   1.192 +			being unzipped will get you in trouble if you use it right now. And that's all 
   1.193 +			I have to say about that.
   1.194 +		</P>
   1.195 +		<P>
   1.196 +			Now that it's unzipped, go into the VisualC <STRONG><FONT color="#009900">(VisualC7)</FONT></STRONG>
   1.197 +			directory that is created, and double-click on the VC++ file "<CODE>SDL.dsw</CODE>"<STRONG><FONT color="#009900">
   1.198 +					("<CODE>SDL.sln</CODE>").</FONT></STRONG> This should open up the IDE.
   1.199 +		</P>
   1.200 +		<P>
   1.201 +			You may be prompted at this point to upgrade the workspace, should you be using 
   1.202 +			a more recent version of Visual C++. If so, allow the workspace to be upgraded.
   1.203 +		</P>
   1.204 +		<P>
   1.205 +			Build the <CODE>.dll</CODE> and <CODE>.lib</CODE> files.
   1.206 +		</P>
   1.207 +		<P>
   1.208 +			This is done by right clicking on each project in turn (Projects are listed in 
   1.209 +			the Workspace panel in the FileView tab), and selecting "Build".
   1.210 +		</P>
   1.211 +		<P>
   1.212 +			You may get a few warnings, but you should not get any errors. You do have to 
   1.213 +			have at least the DirectX 5 SDK installed, however. The latest 
   1.214 +			version of DirectX can be downloaded or purchased on a cheap CD (my 
   1.215 +			recommendation) from <A HREF="http://www.microsoft.com">Microsoft </A>.
   1.216 +		</P>
   1.217 +		<P>
   1.218 +			Later, we will refer to the following .lib and .dll files that have just been 
   1.219 +			generated:
   1.220 +		</P>
   1.221 +		<ul>
   1.222 +    <li> SDL.dll</li>
   1.223 +    <li> SDL.lib</li>
   1.224 +    <li> SDLmain.lib</li>
   1.225 +    </ul>
   1.226 +		<P>
   1.227 +			Search for these using the Windows Find (Windows-F) utility, if you don't 
   1.228 +			already know where they should be. For those of you with a clue, look inside 
   1.229 +			the Debug or Release directories of the subdirectories of the Project folder. 
   1.230 +			(It might be easier to just use Windows Find if this sounds confusing. And 
   1.231 +			don't worry about needing a clue; we all need visits from the clue fairy 
   1.232 +			frequently.)
   1.233 +		</P>
   1.234 +		<H3>
   1.235 +			Creating a Project with SDL
   1.236 +		</H3>
   1.237 +		<P>
   1.238 +			Create a project as a Win32 Application.
   1.239 +		</P>
   1.240 +		<P>
   1.241 +			Create a C++ file for your project.
   1.242 +		</P>
   1.243 +		<P>
   1.244 +			Set the C runtime to "Multi-threaded DLL" in the menu: <CODE>Project|Settings|C/C++ 
   1.245 +				tab|Code Generation|Runtime Library </CODE>.
   1.246 +		</P>
   1.247 +		<P>
   1.248 +			Add the SDL <CODE>include</CODE> directory to your list of includes in the 
   1.249 +			menu: <CODE>Project|Settings|C/C++ tab|Preprocessor|Additional include directories </CODE>
   1.250 +			.
   1.251 +			<br>
   1.252 +			<STRONG><FONT color="#009900">VC7 Specific: Instead of doing this I find it easier to 
   1.253 +					add the include and library directories to the list that VC7 keeps. Do this by 
   1.254 +					selecting Tools|Options|Projects|VC++ Directories and under the "Show 
   1.255 +					Directories For:" dropbox select "Include Files", and click the "New Directory 
   1.256 +					Icon" and add the [SDLROOT]\include directory (ex. If you installed to 
   1.257 +					c:\SDL-1.2.5\ add c:\SDL-1.2.5\include).&nbsp;Proceed to&nbsp;change the 
   1.258 +					dropbox selection to "Library Files" and add [SDLROOT]\lib.</FONT></STRONG>
   1.259 +		</P>
   1.260 +			<P>
   1.261 +				The "include directory" I am referring to is the <CODE>include</CODE> folder 
   1.262 +				within the main SDL directory (the one that this HTML file located within).
   1.263 +			</P>
   1.264 +			<P>
   1.265 +				Now we're going to use the files that we had created earlier in the Build SDL 
   1.266 +				step.
   1.267 +			</P>
   1.268 +			<P>
   1.269 +				Copy the following files into your Project directory:
   1.270 +			</P>
   1.271 +			<ul>
   1.272 +     <li> SDL.dll</li>
   1.273 +     </ul>
   1.274 +			<P>
   1.275 +				Add the following files to your project (It is not necessary to copy them to 
   1.276 +				your project directory):
   1.277 +			</P>
   1.278 +			<ul>
   1.279       <li> SDL.lib </li>
   1.280 -     <li> SDLmain.lib </li>
   1.281 -     </list>
   1.282 -
   1.283 -<P>
   1.284 -     (To add them to your project, right click on your
   1.285 -     project, and select &quot;Add files to project&quot;)
   1.286 -</P>
   1.287 -
   1.288 -<P>
   1.289 -     (I believe that it's not necessary to actually
   1.290 -     copy the .lib files into your directory; you only
   1.291 -     have to be certain that you add them to your Project.
   1.292 -     If someone is so inclined, correct this document, or
   1.293 -     <A HREF="mailto:snowlion@sprynet.com">
   1.294 -     e-mail me </A>,
   1.295 -     and I'll fix this document.)
   1.296 -</P>
   1.297 -
   1.298 -
   1.299 -
   1.300 -<H3> SDL 101, First Day of Class </H3>
   1.301 -
   1.302 -<P>
   1.303 -     Now create the basic body of your project.
   1.304 -     The body of your program should take the following form:
   1.305 -
   1.306 -<CODE>
   1.307 -<PRE>
   1.308 -#include &quot;SDL.h&quot;
   1.309 +     <li> SDLmain.lib</li>
   1.310 +     </ul>
   1.311 +			<P>
   1.312 +				(To add them to your project, right click on your project, and select "Add 
   1.313 +				files to project")
   1.314 +			</P>
   1.315 +		<P><STRONG><FONT color="#009900">Instead of adding the files to your project it is more 
   1.316 +					desireable to add them to the linker options: Project|Properties|Linker|Command 
   1.317 +					Line and type the names of the libraries to link with in the "Additional 
   1.318 +					Options:" box.&nbsp; Note: This must be done&nbsp;for&nbsp;each&nbsp;build 
   1.319 +					configuration (eg. Release,Debug).</FONT></STRONG></P>
   1.320 +		<H3>
   1.321 +			SDL 101, First Day of Class
   1.322 +		</H3>
   1.323 +		<P>
   1.324 +			Now create the basic body of your project. The body of your program should take 
   1.325 +			the following form: <CODE>
   1.326 +				<PRE>
   1.327 +#include "SDL.h"
   1.328  
   1.329  int main( int argc, char* argv[] )
   1.330  {
   1.331 @@ -195,41 +141,28 @@
   1.332    return 0;
   1.333  }
   1.334  </PRE>
   1.335 -</CODE>
   1.336 -</P>
   1.337 -
   1.338 -<H3> That's it! </H3>
   1.339 -
   1.340 -<P>
   1.341 -     I hope that this document has helped you get
   1.342 -     through the most difficult part of using the
   1.343 -     SDL: installing it. Suggestions for improvements
   1.344 -     to this document should be sent to the writers
   1.345 -     of this document.
   1.346 -</P>
   1.347 -
   1.348 -<P>
   1.349 -     Thanks to Paulus Esterhazy (pesterhazy@gmx.net), for the work on VC++ port.
   1.350 -</P>
   1.351 -
   1.352 -<P>
   1.353 -     This document was originally called &quot;VisualC.txt&quot;,
   1.354 -     and was written by 
   1.355 -     <A HREF="mailto:slouken@libsdl.org">Sam Lantinga</A>.
   1.356 -</P>
   1.357 -
   1.358 -<P>
   1.359 -     Later, it was converted to HTML and expanded into
   1.360 -     the document that you see today by 
   1.361 -     <A HREF="mailto:snowlion@sprynet.com">Lion Kimbro</A>.
   1.362 -</P>
   1.363 -
   1.364 -
   1.365 -
   1.366 -</BODY>
   1.367 -
   1.368 -
   1.369 -
   1.370 +			</CODE>
   1.371 +		<P></P>
   1.372 +		<H3>
   1.373 +			That's it!
   1.374 +		</H3>
   1.375 +		<P>
   1.376 +			I hope that this document has helped you get through the most difficult part of 
   1.377 +			using the SDL: installing it. Suggestions for improvements to this document 
   1.378 +			should be sent to the writers of this document.
   1.379 +		</P>
   1.380 +		<P>
   1.381 +			Thanks to Paulus Esterhazy (pesterhazy@gmx.net), for the work on VC++ port.
   1.382 +		</P>
   1.383 +		<P>
   1.384 +			This document was originally called "VisualC.txt", and was written by <A HREF="mailto:slouken@libsdl.org">
   1.385 +				Sam Lantinga</A>.
   1.386 +		</P>
   1.387 +		<P>
   1.388 +			Later, it was converted to HTML and expanded into the document that you see 
   1.389 +			today by <A HREF="mailto:snowlion@sprynet.com">Lion Kimbro</A>.
   1.390 +		</P>
   1.391 +		<P>Minor Fixes and Visual C++ 7 Information (In Green) was added by <A HREF="mailto:james@conceptofzero.net">James Turk</A>
   1.392 +		</P>
   1.393 +	</BODY>
   1.394  </HTML>
   1.395 -
   1.396 -