The JUCE cross-platform C++ framework, with DISTRHO/KXStudio specific changes
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

221 lines
13KB

  1. <?xml version="1.0" encoding="windows-1250"?>
  2. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
  3. <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
  4. <head>
  5. <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
  6. <meta http-equiv="Content-Language" content="en-us" />
  7. <meta name="description" content="Raw Material Software" />
  8. <meta name="keywords" content="audio, music, juce, tracktion, c++, sequencer, library, programming, software, julian storer$otherkeywords" />
  9. <meta name="robots" content="index,follow" />
  10. <title>JUCE - installation and compiling</title>
  11. <link href="rawmat.css" rel="stylesheet" type="text/css" media="all" />
  12. </head>
  13. <body>
  14. <div class="pageholder">
  15. <div class="banner">
  16. <a href="http://www.rawmaterialsoftware.com">
  17. <img src="images/rms_logo.gif" alt="raw material software" title="raw material software"/></a>
  18. </div>
  19. <p><a href="#intro">Introduction</a> - <a href="#license">License</a> -
  20. <a href="#install">Installation</a> -
  21. <a href="#buildvc">Building with Visual Studio</a> -
  22. <a href="#buildvc6">Building with VC6</a> -
  23. <a href="#buildxcode">Building with XCode</a> -
  24. <a href="#buildlinux">Building on Linux</a> -
  25. <a href="#buildandroid">Building with Android</a> -
  26. </p>
  27. <h1>JUCE</h1>
  28. <h2><a name="intro"></a>Introduction</h2>
  29. <p>JUCE is an all-encompassing C++ class library for developing cross-platform applications and plugins.</p>
  30. <p>For lots more help and information, please visit the <a href="http://www.rawmaterialsoftware.com/juce">JUCE website</a>.</p>
  31. <p>A complete set of class documentation is available <a href="http://www.rawmaterialsoftware.com/juce/api/index.html" target="juce api">here</a>.</p>
  32. <h2><a name="license"></a>License</h2>
  33. <p>JUCE is released under the <a href="http://www.gnu.org/copyleft/gpl.html">Gnu Public License</a>,
  34. which means it can be freely copied and distributed, and costs nothing to use in open-source applications.</p>
  35. <p>If you'd like to release a closed-source application that uses JUCE, commercial licenses are available
  36. for a fee - click <a href="http://www.rawmaterialsoftware.com/jucelicense.php">here</a> for more information
  37. on pricing and terms.</p>
  38. <h2><a name="install"></a>Installation</h2>
  39. <h3>Installing the source code</h3>
  40. <p>There are a few ways to install a copy of JUCE:</p>
  41. <ul>
  42. <li>You can download a zip file containing the last stable release from <a href="http://sourceforge.net/projects/juce/files/juce/">the JUCE downloads section on SourceForge</a></li>
  43. <li>Download the GIT repository: To grab the latest bleeding-edge version of the code, you can use the command:
  44. <br><code>git clone --depth 1 git://juce.git.sourceforge.net/gitroot/juce/juce</code></li>
  45. <li>Download via the Introjucer: The Introjucer is JUCE's tool for creating and managing JUCE projects, and it also
  46. includes a handy tool which lets you download the latest (bleeding-edge) version of JUCE without needing to install GIT. To use this,
  47. just download a binary of the Introjucer from <a href="http://sourceforge.net/projects/juce/files/juce/">SourceForge</a>,
  48. and run it - its 'update' menu contains an option to download JUCE.</li>
  49. </ul>
  50. <p>The JUCE source code all lives in a folder called, unsurprisingly, <code>juce</code>, which you can unzip
  51. and put somewhere on your system.</p>
  52. <h3>Building the demo applications</h3>
  53. <p>In the <code>juce/extras</code> folder, there are a few demo apps to get you started and to show off JUCE's features.
  54. Each one contains a folder called <code>Builds</code>, containing various projects for different compilers and platforms.
  55. These should all work straight out-of-the-box if you load them into the appropriate development environment. Some of them
  56. (e.g. the audio plugin demo) may require 3rd party libraries or headers to have been installed, but I've made sure that any
  57. include statements that may not be present have comments with a detailed explanation of what's going on, so if you hit a compile
  58. error, just have a look at the code it's pointing to and everything should become clear.</p>
  59. <h2>Creating a new application with the Introjucer</h2>
  60. <p>By far the easiest way to create a new cross-platform JUCE app (or audio plugin) is to let the Introjucer
  61. do the hard work of creating all your projects with the correct settings.</p>
  62. <p>You can either build the Introjucer yourself from the source (in <code>juce/extras/Introjucer</code>), or download
  63. a pre-built binary from <a href="http://sourceforge.net/projects/juce/files/juce/">SourceForge</a>.
  64. <p>If you run it and select the 'new project' menu item, it'll walk you through the stages in setting up an app or
  65. plugin project, and will automatically spit out a collection of project files for all the different platforms and compilers
  66. that you need.</p>
  67. <h1>Requirements for building on different platforms</h1>
  68. <h3><a name="buildvc"></a>Microsoft Visual Studio 2005 or later</h3>
  69. <p>JUCE projects should build and run with no extra set-up needed in all versions of Visual Studio from 2005 onwards.</p>
  70. <p>By far the easiest way to create a new project is by letting the Introjucer do all the hard work, as explained above. But
  71. if you really insist on creating one manually, here are a few tips:</p>
  72. <ol>
  73. <li>Create your new application project as an 'empty' WIN32 application - avoid saying yes to
  74. MFC or any of the other rubbish that Visual Studio might offer you.</li>
  75. <li>Make sure that your project has exception handling and run-time type information (RTTI) turned ON.</li>
  76. <li>Have a look at the example projects, demo projects, or the API documentation about the
  77. <code>JUCEApplication</code> class to find out how to create the application launch code.</li>
  78. </ol>
  79. <h3><a name="buildvc6"></a>Microsoft Visual Studio 6</h3>
  80. <p>JUCE can still be compiled with VC6, although support for this will be dropped at some point in the future...
  81. but here are some tips for getting it going:</p>
  82. <ol>
  83. <li>Install the latest Platform SDK from Microsoft.</li>
  84. <li>Set up your include and library search paths. The first few items on your include path
  85. should look like this (obviously you might have things installed in different places, but the
  86. order is important!):
  87. <pre>C:\Program Files\Microsoft Platform SDK\include
  88. C:\Program Files\Microsoft Platform SDK\include\crt
  89. C:\Program Files\Microsoft Platform SDK\include\mfc
  90. C:\mycode\juce
  91. ...</pre>
  92. And the library search path should begin like this:
  93. <pre>C:\Program Files\Microsoft Visual Studio\VC98\LIB
  94. C:\Program Files\Microsoft Platform SDK\lib
  95. C:\mycode\juce\bin
  96. ...</pre>
  97. </li>
  98. </ol>
  99. <p>Note that there's a rather lame bug in VC6 that causes an internal compiler error if you include
  100. filenames that are too long. This can get triggered if you put the juce folder in a deeply-nested
  101. directory (such as your user home directory). Unfortunately I think the only workaround for this
  102. is to move the source tree to a shallower directory.</p>
  103. <h3><a name="buildxcode"></a>XCode on OSX</h3>
  104. <p>Use XCode 3 or later. You might want to tick the option to install the 10.4 SDK if you want to build binaries
  105. that are backward-compatible with 10.4 and PPCs. If you're going to build for iOS, you'll obviously need the iOS version of XCode.</p>
  106. <p>The easiest way to create a new application is by using the Intojucer, but here are a few tips if you're mad enough
  107. to want to set one up manually:</p>
  108. <ul>
  109. <li>You'll need to add some or all of the following OSX frameworks to your "External Frameworks and Libraries" list,
  110. depending on what features your application uses:
  111. <pre>Cocoa.framework
  112. Carbon.framework
  113. IOKit.framework
  114. CoreAudio.framework
  115. CoreMIDI.framework
  116. WebKit.framework
  117. DiscRecording.framework
  118. QTKit.framework
  119. QuickTime.framework
  120. QuartzCore.framework
  121. AudioUnit.framework
  122. AudioToolbox.framework
  123. OpenGL.framework
  124. AppKit.framework
  125. CoreAudioKit.framework
  126. CoreFoundation.framework</pre>
  127. In future there may be other frameworks that you'll need to link with to support new JUCE features.
  128. (It should be pretty obvious from the link-time error when one of these is missing).
  129. </li>
  130. <li>If you need to link to the JUCE static library rather than using the amalgamated files, you'll need to drag-and-drop
  131. the <code>juce.xcodeproj</code> file into your project's "External Frameworks and Libraries" list. Then, expand this
  132. item in the treeview, and inside there'll be an item "libjuce.a" or "libjucedebug.a" - drag-and-drop
  133. this into the "link binary with libraries" phase inside the xcode target. When you select either a debug
  134. or release juce build these entries will (usually) update themselves to show the correct debug or release library
  135. name. If you want your project to automatically rebuild JUCE when you make changes to a JUCE file, you can
  136. also add JUCE to your target's "Direct Dependency" list (show information for the target, and this is on the
  137. "general" tab).<br/>Alternative ways of linking to JUCE would be to add the libjuce.a or libjucedebug.a library to
  138. your "External Frameworks and Libraries" list, or to add switch to the linker's command-line of either "-ljuce"
  139. or "-ljucedebug".</li>
  140. </ul>
  141. <h3><a name="buildlinux"></a>Linux with GCC</h3>
  142. <p>Most linux distros should come with the tools you need. You may need to install the development packages of
  143. freetype, X11 and pthreads if they're not already available.</p>
  144. <p>If you've enabled the <code>JUCE_USE_XINERAMA</code> option, then you'll also need to install the Xinerama package.
  145. And you'll need the <code>GL</code> and <code>GLU</code> libraries if you've enabled <code>JUCE_OPENGL</code></p>
  146. <p>The makefiles that are generated by the Introjucer can be run by "<code>make CONFIG=Debug</code>",
  147. or "<code>make CONFIG=Release</code>". You can also use "<code>make clean</code>" to delete the
  148. intermediate files.</p>
  149. <h3><a name="buildandroid"></a>Android</h3>
  150. <ul>
  151. <li>First of all, get yourself over to <a href="http://www.android.com">www.android.com</a>, and install the latest
  152. Android SDK and NDK. Follow their instructions for installing Eclipse, and get to the point where you can
  153. build and run some of the Android NDK demo apps in Eclipse before even thinking about trying to do anything with JUCE. The
  154. Android development environment is a hugely complicated mish-mash of random bits of software, lashed together with scripts,
  155. so don't expect a slick installation experience - be prepared to mess about. Once it's installed though, it all more-or-less
  156. seems to work..</li>
  157. <li>The only sensible way to create an Android JUCE project is with the Introjucer - doing it with Eclipse is a nightmare and if
  158. you want to do it manaually, good luck. The Introjucer will produce a folder containing a whole heap of files, and you can open the
  159. folder in Eclipse as a new project (use the "create project" option in Eclipse).</li>
  160. <li>Eclipse should be able to automatically build the project and run it, but you can also build it from the command-line,
  161. by setting your CWD to the Android build folder and using "<code>ant debug</code>" or "<code>ant release</code>"</li>
  162. <li>Be careful that your project folder doesn't contain any spaces in its path - the Android tools can't handle this (!)</li>
  163. <li>The structure that a JUCE app uses is to have a couple of boilerplate java classes which load and run a big native
  164. library containing the juce library and all your app code. JUCE uses JNI internally to call java classes to interact with
  165. the OS.</li>
  166. <li>When you change some of your app code and need to recompile and re-test the app, Eclipse will usually (but certainly
  167. not always) detect the change and re-compile the library. Unfortunately, if there are any errors during compilation, it'll
  168. ignore them, and carry on trying to run the app, after having cleared the console so you can no longer see the errors that
  169. occurred. In these cases, you probably want to build it using the command-line 'ant debug' so you can actually see what happened.</li>
  170. <li>Although Eclipse does manage to rebuild the native library when you change some c++ code, it will fail utterly to re-package the
  171. new library file or to re-install it on the target device. So far, my way of getting it to do this has been to touch one of the
  172. java files whenever I change any c++, and this seems to kick it into life. If anyone has ever had the patience to become an
  173. Eclipse expert and can suggest a proper solution to this, please let me know!!</li>
  174. <li>Often, Eclipse gets confused and insist that there are "mistakes" in the java which prevent it from running the app. Needless
  175. to say, there aren't really any mistakes, and usually doing a "clean" sorts it out.</li>
  176. </ul>
  177. <div class="ad">
  178. <p class="ad">***</p>
  179. </div>
  180. <div class="bottomsection">
  181. <p class="bottombar">- Copyright 2005 Raw Material Software Ltd -</p>
  182. </div>
  183. </div>
  184. </body>
  185. </html>