Borland.html
author Sam Lantinga <slouken@libsdl.org>
Sun, 09 Feb 2003 02:58:40 +0000
changeset 596 475f969e8c01
parent 465 25f475cd4981
child 642 de622b7108bf
permissions -rw-r--r--
CVS should ignore files automatically generated by building on MacOS X
slouken@465
     1
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
slouken@465
     2
<html>
slouken@465
     3
<head>
slouken@465
     4
  <title>Building SDL with Borland's C++ compilers</title>
slouken@465
     5
                    
slouken@465
     6
  <meta name="author"
slouken@465
     7
 content="David Snopek and updated by Dominique Louis.">
slouken@465
     8
</head>
slouken@465
     9
  <body>
slouken@465
    10
   <xevol @newtonave.net="">      </xevol>   
slouken@465
    11
<h1>Building SDL with Borland's C++ compilers. </h1>
slouken@465
    12
    <b> by <a href="mailto:xevol@users.sourceforge.net"> David Snopek</a></b> 
slouken@465
    13
   and updated by <b><a href="mailto:Dominique@SavageSoftware.com.au">Dominique 
slouken@465
    14
 Louis</a></b>.<br>
slouken@465
    15
    <br>
slouken@465
    16
     These instructions cover how to compile SDL and its included test programs 
slouken@465
    17
 using either  Borland <a href="#bcbwin">C++ Builder 5, 6 for Windows</a>, 
slouken@465
    18
<a href="#k3">C++ Builder for Linux  ( AKA Kylix 3 )</a> or the free <a
slouken@465
    19
 href="#bccc">Borland C++ command-line compiler</a>. <br>
slouken@465
    20
        
slouken@465
    21
<h3> <b> Extract the files </b> </h3>
slouken@465
    22
        
slouken@465
    23
<p> Unzip the Borland.zip archive into <b>this</b> directory.  Do not unzip 
slouken@465
    24
 it into any  other directory because the makefiles ( *.mak ) and project 
slouken@465
    25
files ( *.bpr ) use relative paths to refer to the SDL sources.  This  should 
slouken@465
    26
create a directory named "Borland" inside of the top level SDL source directory. 
slouken@465
    27
  </p>
slouken@465
    28
        
slouken@465
    29
<h3> <b><a name="bcbwin"></a> Using Borland C++ Builder 5, 6 for Windows </b>
slouken@465
    30
</h3>
slouken@465
    31
        
slouken@465
    32
<p> Inside of the "Borland" directory there is a "bcb6" directory that contains 
slouken@465
    33
 a number  of Builder project files.  Double-click on the "libSDL.bpg" file 
slouken@465
    34
 icon.  Once Builder has  started click on the "<u>P</u>rojects" menu on the
slouken@465
    35
 menu-bar and go down to  "B<u>u</u>ild All Projects" option.  <br>
slouken@465
    36
 This will proceed  to build SDL ( with Borland's calling convention ), SDLmain, 
slouken@465
    37
and all  the <a href="#tests">test programs</a>. Currently, all the <a
slouken@465
    38
 href="#tests">test programs</a> 
slouken@465
    39
are dynamically linked to Sam Lantinga's SDL.dll.</p>
slouken@465
    40
 
slouken@465
    41
<p><b>NOTE :</b> Borland's "lib" format and Microsoft's "lib" format are incompatible.
slouken@465
    42
&nbsp;<br>
slouken@465
    43
 If you wish to dynamically link to the SDL library supplied by Sam Lantinga 
slouken@465
    44
in each release, I have created the correct *.libs for SDL 1.2.4 and they 
slouken@465
    45
exist in the "/lib" directory.<br>
slouken@465
    46
 If you would like to create the *.lib files yourself, you will need to make 
slouken@465
    47
use of Borland's "implib.exe" utility.<br>
slouken@465
    48
 </p>
slouken@465
    49
 
slouken@465
    50
<p><tt>IMPLIB</tt> works like this: </p>
slouken@465
    51
   
slouken@465
    52
<pre>    IMPLIB (destination lib name) (source dll)<br></pre>
slouken@465
    53
   
slouken@465
    54
<p> For example,</p>
slouken@465
    55
   
slouken@465
    56
<pre>    IMPLIB SDL.lib SDL.dll<br></pre>
slouken@465
    57
 
slouken@465
    58
<p>This assumes that SDL.dll was compiled with Visual C++ or similar.<br>
slouken@465
    59
 </p>
slouken@465
    60
 
slouken@465
    61
<p>To learn more about the difference between Borland's and Microsoft's *.lib 
slouken@465
    62
format please read the article <a
slouken@465
    63
 href="http://www.bcbdev.com/articles/vcdll.htm">here</a>.<br>
slouken@465
    64
 </p>
slouken@465
    65
 
slouken@465
    66
<p>  <b><br>
slouken@465
    67
 NOTE :</b> The C++ Builder for Windows project format, is not compatible
slouken@465
    68
with the Kylix  3 project format, hence the reason why they are in separate
slouken@465
    69
directories.</p>
slouken@465
    70
        
slouken@465
    71
<h3> <b><a name="bccc"></a> Using the free Borland C++ command-line compiler 
slouken@465
    72
</b> </h3>
slouken@465
    73
        
slouken@465
    74
<p> The free Borland compiler can be downloaded at no charge from <a
slouken@465
    75
 href="http://www.borland.com/bcppbuilder/freecompiler/"> the  Borland website 
slouken@465
    76
 </a>.  Make sure that it is installed and properly configured. </p>
slouken@465
    77
        
slouken@465
    78
<p> Open an MS-DOS Prompt.  Change to the "Borland\freebcc" directory under 
slouken@465
    79
 the  SDL source directory.  Type "make -f SDL.mak" to build SDL and "make 
slouken@465
    80
 -f  SDLmain.mak".  There are also makefiles for all of the <a
slouken@465
    81
 href="#tests">test  programs</a>, if you wish to build them. </p>
slouken@465
    82
        
slouken@465
    83
<h3> <b> Output files </b> </h3>
slouken@465
    84
     No matter which compiler you used, three important files should have 
slouken@465
    85
been  produced:      
slouken@465
    86
<ul>
slouken@465
    87
    	<li> SDL.dll ( Borland format ) </li>
slouken@465
    88
    	<li> SDL.lib&nbsp;( Borland format ) </li>
slouken@465
    89
    	<li> SDLmain.lib&nbsp;( Borland format ) </li>
slouken@465
    90
       
slouken@465
    91
</ul>
slouken@465
    92
     Both of the *.lib files will need to be added to all the projects that 
slouken@465
    93
 use SDL and SDL.dll  must be placed some where the Windows dynamic linker 
slouken@465
    94
 can find it (either in your  project directory or on the system path, C:\WINDOWS\SYSTEM). 
slouken@465
    95
   
slouken@465
    96
<h3> <b><a name="k3"></a> Using Borland C++ Builder for Linux ( AKA Kylix 
slouken@465
    97
3 ) </b> </h3>
slouken@465
    98
          
slouken@465
    99
<p> Inside of the "Borland" directory there is a "k3" directory that contains 
slouken@465
   100
 a number  of Builder project files.  Double-click on the "libSDL.bpg" file 
slouken@465
   101
 icon.  Once Builder has  started click on the "<u>P</u>rojects" menu on the
slouken@465
   102
 menu-bar and go down to  "B<u>u</u>ild All Projects" option.  This will proceed
slouken@465
   103
 to build all  the <a
slouken@465
   104
 href="#tests">test programs</a>.&nbsp;<br>
slouken@465
   105
 Linux  users do not need *.lib files as the Shared Object is linked right 
slouken@465
   106
into the  project ( very neat actually, Windows should do this sort of thing 
slouken@465
   107
as it is a lot easier for the developer ).  <br>
slouken@465
   108
    <b>NOTE :</b>&nbsp;The C++ Builder for Windows project format, is not
slouken@465
   109
compatible with the Kylix  3 project format, hence the reason why they are
slouken@465
   110
in separate directories.</p>
slouken@465
   111
       
slouken@465
   112
<p> On Mandrake 8.1 the shared objects for SDL are located in the /usr/lib 
slouken@465
   113
 directory as libSDL_*.so and the Mesa OpenGL shared objects are located in
slouken@465
   114
 /usr/X11R6/lib as libGL*.so<br>
slouken@465
   115
     <br>
slouken@465
   116
     So if your setup is different you may need to change the project file
slouken@465
   117
 so that they re-link to the ones on your system.<br>
slouken@465
   118
     <br>
slouken@465
   119
     On Mandrake 8.1 the headers files are located at /usr/include/SDL/.
slouken@465
   120
So  if you you have not installed the development RPMs ( usually named libSDL-devel*
slouken@465
   121
  ) for SDL ( not included ) you may have to change the include directory
slouken@465
   122
within  some of the projects.<br>
slouken@465
   123
 </p>
slouken@465
   124
 
slouken@465
   125
<h3> Known Problems</h3>
slouken@465
   126
   The only known problem is that I ( Dominique Louis ), was unable to create 
slouken@465
   127
the projects that rebuilt the SDL shared objects under Linux, due to time 
slouken@465
   128
constraints and my lack of intimate knowledge of Linux.   
slouken@465
   129
<h3><a name="tests"><b> Test programs </b> </a></h3>
slouken@465
   130
 Some of the test programs require included media files ( *.wav; *.bmp etc 
slouken@465
   131
 ).  Before trying to run any of the  test programs, copy these media files 
slouken@465
   132
 from the "tests/" directory into the Borland build directory that you extracted 
slouken@465
   133
 the project files to.  <br>
slouken@465
   134
   <br>
slouken@465
   135
</body>
slouken@465
   136
</html>
slouken@465
   137