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.

297 lines
16KB

  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="#buildvc2005">Building with VC2005</a> -
  22. <a href="#buildvcx">Building with VC Express</a> -
  23. <a href="#buildvc6">Building with VC6</a> -
  24. <a href="#buildvc7">Building with VC7</a> -
  25. <a href="#buildxcode">Building with XCode</a> -
  26. <a href="#buildcodeblocks">Building with Code::Blocks</a> -
  27. <a href="#buildlinux">Building on Linux</a> -
  28. </p>
  29. <h1>JUCE</h1>
  30. <h2><a name="intro"></a>Introduction</h2>
  31. <p>JUCE is an all-encompassing C++ class
  32. library for developing cross-platform applications.</p>
  33. <p>A complete doxygen-created API guide is available <a href="http://www.rawmaterialsoftware.com/juce/api/index.html" target="juce api">here</a>
  34. as HTML, or can be downloaded as a precompiled Windows help file from the
  35. <a href="http://www.rawmaterialsoftware.com/juce/download.php">downloads</a> page.</p>
  36. <p>For more help and information, please visit the <a href="http://www.rawmaterialsoftware.com/juce">JUCE website</a>.</p>
  37. <h2><a name="license"></a>License</h2>
  38. <p>JUCE is released under the <a href="http://www.gnu.org/copyleft/gpl.html">Gnu Public License</a>,
  39. which means it can be freely copied and distributed, and costs nothing to use in open-source applications.</p>
  40. <p>If you'd like to release a closed-source application that uses JUCE, commercial licenses are available
  41. for a fee - click <a href="http://www.rawmaterialsoftware.com/juce/licensing.php">here</a> for more information on pricing and terms.</p>
  42. <h2><a name="install"></a>Installation</h2>
  43. <h3>Installing the source code</h3>
  44. <p>The JUCE source code all lives in a folder called, unsurprisingly, <code>juce</code>, which you can unzip
  45. and put somewhere on your system.</p>
  46. <p>To compile the library, there is a subfolder <code>juce/build</code> that contains projects for different
  47. operating systems and compilers.</p>
  48. <h3>Building the demo application</h3>
  49. <p>Inside the <code>juce</code> folder is a demo application that shows off a few of Juce's features.
  50. The <code>juce/extras/juce demo/build</code> folder contains projects and workspaces for the various platforms and compilers.</p>
  51. <h3>The "amalgamated" version of Juce</h3>
  52. <p>One of Juce's features is that it can be linked into your project as a monolithic C++ file, instead of a statically linked
  53. library. This means that you can write a juce application without actually needing to build the
  54. library beforehand, but instead by just adding <code>juce_amalgamated.cpp</code> to the project, and including
  55. <code>juce_amalagamated.h</code> instead of <code>juce.h</code>. The demo apps are designed using this approach, because it means
  56. there's less setting-up required for a new user to do before getting stuck-in, but some compilers
  57. and debuggers can struggle with the huge files involved, so you may prefer to build
  58. your project in the traditional way, using it as a separate library.</p>
  59. <p>A variation on this approach is to include <code>juce_amalgamated_template.cpp</code> in your app, which has the
  60. same effect as the normal amalgamated file, but which actually pulls in all the juce cpp files via #include statements
  61. rather than by pre-munging them into one file. This makes debugging a lot easier</p>
  62. <h2>Creating a new application with JUCE</h2>
  63. <h3>Using the new Jucer</h3>
  64. <p><strong>NOTE!</strong> By far the easiest way to create a new cross-platform Juce app (or audio plugin) is to use the new and
  65. not-yet-finished Jucer to generate all the project files for you... This replacement for the old Jucer is still work-in-progress and
  66. at the "experimental" stage, but it has enough project management features to already be extemely useful. To use it, you'll need to build
  67. and run it - that's pretty easy to do: just open an appropriate project from the <code>juce/extras/Jucer (experimental)/Builds</code> folder,
  68. and compile/run it. The new Jucer has a wizard that will create a new Juce project for you, sorting out all the messy paths and project set-up,
  69. and will spit out a collection of project files for the various IDEs that you can simply open and build.</p>
  70. <p>When complete, the new Jucer will be a big part of future Juce versions, and is already used to auto-generate the makefiles and project
  71. files for all the projects in the juce/extras folder.</p>
  72. <p>However, if you want to create a Juce project manually (i.e. the hard way), here are some instructions:</p>
  73. <h3><a name="buildvc2005"></a>Compiling with Microsoft Visual Studio</h3>
  74. <p>The quickest way to get started is to try building the demo application - there's a Visual Studio
  75. soluion in <code>juce/extras/juce demo/build/win32_vc8/jucedemo.sln</code>.</p>
  76. <p>This should build and run with no extra set-up needed in all versions of Visual Studio from 2005 onwards,
  77. including the free version of Visual Express 2009.</p>
  78. <p>One thing to check if you're unfamiliar with Visual Studio is that the <code>jucedemo</code>
  79. project needs to be selected as your "startup" project (right-click on the
  80. jucedemo project in the solution explorer for this option). Also, the active configuration should be
  81. set to "Debug" or "Release", (the first time you load a project, VS selects one of the configurations by default
  82. and usually picks "Debug DLL", for reasons best known to itself).</p>
  83. <p>To create your own application that links to Juce:</p>
  84. <ol>
  85. <li>Either make a copy of the example project in <code>juce/projects</code> and rename/customise
  86. it, or create a new application project as an 'empty' WIN32 application - avoid saying yes to
  87. MFC or any of the other rubbish that Visual Studio might offer to pollute your application with.</li>
  88. <li>Include the header file <code>juce.h</code> in all your source files (it's best to
  89. put this in a precompiled header).</li>
  90. <li>Ensure that the linker's search path for libraries includes the the <code>juce/bin</code> directory.
  91. This path can be set globally, or can be added to your project's linker settings.</li>
  92. <li>Choose to link to the "Multithreaded" or "Debug Multithreaded" run-time libraries, depending on
  93. whether you're doing a debug or release build. On VC6, this is set in the Project Settings / C/C++ / Code
  94. Generation options panel. In Visual Studio, it's in the project properties.</li>
  95. <li>Make sure that your project has exception handling and run-time type information (RTTI) turned ON.</li>
  96. <li>Have a look at the 'hello world' projects, demo projects, or the API documentation about the
  97. <code>JUCEApplication</code> class to find out how to create the application launch code.</li>
  98. </ol>
  99. <p>Alternatively, you can use the <em>amalgamated</em> form of Juce (see note above). To do this,
  100. all need to do is to add <code>juce_amalagamated.cpp</code> to your project, and include
  101. <code>juce_amalagamated.h</code> instead of <code>juce.h</code>. This pulls the entire library into
  102. your project without needing to link to it separately, so you can skip the steps above that involve
  103. setting up the link paths, etc. Most of the demo apps are written using the amalgamated version,
  104. so refer to these for an example of how to do this.</p>
  105. <h3><a name="buildvc6"></a>Compiling with Microsoft Visual Studio 6</h3>
  106. <p>To compile the JUCE .lib files from the source code:</p>
  107. <ol>
  108. <li>Install the latest Platform SDK from Microsoft.</li>
  109. <li>Set up your include and library search paths. The first few items on your include path
  110. should look like this (obviously you might have things installed in different places, but the
  111. order is important!):
  112. <pre>C:\Program Files\Microsoft Platform SDK\include
  113. C:\Program Files\Microsoft Platform SDK\include\crt
  114. C:\Program Files\Microsoft Platform SDK\include\mfc
  115. C:\mycode\juce
  116. ...</pre>
  117. And the library search path should begin like this:
  118. <pre>C:\Program Files\Microsoft Visual Studio\VC98\LIB
  119. C:\Program Files\Microsoft Platform SDK\lib
  120. C:\mycode\juce\bin
  121. ...</pre>
  122. </li>
  123. <li>Open the juce.dsp project file in <code>juce/build/win32/vc6</code></li>
  124. <li>There are several configurations: debug, release, debug-unicode, and release-unicode.
  125. You can build all or some of these, and the resultant .lib files should end up in the
  126. "juce/bin" folder.</li>
  127. </ol>
  128. <p>Note that there's a rather lame bug in VC6 that causes an internal compiler error if you include
  129. filenames that are too long. This can get triggered if you put the juce folder in a deeply-nested
  130. directory (such as your user home directory). Unfortunately I think the only workaround for this
  131. is to move the source tree to a shallower directory.</p>
  132. <p>For info on how to create an application that uses Juce, see the VC2005 notes above.</p>
  133. <h3><a name="buildvc7"></a>Compiling with Microsoft Visual Studio 7</h3>
  134. <p>For VC7, you can import the VC6 projects and this should work ok. It's also possible to
  135. tweak the version number in the VC8 projects so that they can be opened in VC7, but that's a
  136. less reliable method!</p>
  137. <h3><a name="buildxcode"></a>Compiling with XCode on MacOSX</h3>
  138. <p>To compile the JUCE binaries from the source code:</p>
  139. <ol>
  140. <li>Open the <code>Juce.xcodeproj</code> file in <code>juce/build/macosx</code></li>
  141. <li>This project has "debug" and "release" configurations, and the library files it creates
  142. are <code>libjuce.a</code> (release) and <code>libjucedebug.a</code> (debug), which will appear
  143. in the <code>juce/bin</code> directory.</li>
  144. </ol>
  145. <p>Then, to create and build an application:</p>
  146. <ol>
  147. <li>Either make a copy of the example project in <code>juce/extras/example projects</code> and rename/customise it, or
  148. create a new "Carbon Application" project.</li>
  149. <li>Include the header file <code>juce.h</code> in all your source files.</li>
  150. <li>Get rid of any main() functions that XCode might have generated for you, and instead use the
  151. <code>JUCEApplication</code> class as your application launcher - see the API documentation for this
  152. class for more details, or have a look at the example projects, or demos.</li>
  153. <li>Drag-and-drop the <code>juce.xcodeproj</code> file into the project's "External Frameworks and Libraries"
  154. list.</li>
  155. <li>Expand this item in the treeview, and inside there'll be an item "libjuce.a" or "libjucedebug.a" - drag-and-drop
  156. this into the "link binary with libraries" phase inside the xcode target. When you select either a debug
  157. or release juce build these entries will (usually) update themselves to show the correct debug or release library
  158. name. If you want your project to automatically rebuild Juce when you make changes to a juce file, you can
  159. also add Juce to your target's "Direct Dependency" list (show information for the target, and this is on the
  160. "general" tab).<br/>Alternative ways of linking to juce would be to add the libjuce.a or libjucedebug.a library to
  161. your "External Frameworks and Libraries" list, or to add switch to the linker's command-line of either "-ljuce"
  162. or "-ljucedebug".</li>
  163. <li>You'll also need to add some or all of the following OSX frameworks to your "External Frameworks and Libraries" list,
  164. depending on what features your application uses:
  165. <pre>Cocoa.framework
  166. Carbon.framework
  167. IOKit.framework
  168. CoreAudio.framework
  169. CoreMIDI.framework
  170. WebKit.framework
  171. DiscRecording.framework
  172. QTKit.framework
  173. QuickTime.framework
  174. QuartzCore.framework
  175. AudioUnit.framework
  176. AudioToolbox.framework
  177. OpenGL.framework
  178. AppKit.framework
  179. CoreAudioKit.framework
  180. CoreFoundation.framework</pre>
  181. In future there may be other frameworks that you'll need to link with to support new JUCE features.
  182. (It should be pretty obvious from the link-time error when one of these is missing).
  183. </li>
  184. </ol>
  185. <p>If all this seems too complicated, you can make things slightly easier by using the <em>amalgamated</em> form of Juce
  186. (see earlier note). To do this, all you need to do is to add <code>juce_amalagamated.cpp</code> to your project, and include
  187. <code>juce_amalagamated.h</code> instead of <code>juce.h</code>. This pulls the entire library into your project without needing
  188. to link to it separately, so you can skip the steps above that involve compiling the library, setting up the link paths, etc.
  189. Most of the demo apps are written using the amalgamated version, so have a look through their source code for examples of how
  190. to do this.</p>
  191. <h3><a name="buildcodeblocks"></a>Creating a JUCE application with Code::Blocks and MinGW</h3>
  192. <ol>
  193. <li>open the Juce project: <code>juce/build/win32/codeblocks/juce.cbp</code></li>
  194. <li>open the demo app project: <code>juce/extras/juce demo/build/win32_codeblocks/JuceDemo.cbp</code></li>
  195. <li>Build first the "Juce Library" project, and then the "Juce Demo App" project. If your
  196. build environment is set up correctly, these should just work and the demo app should run.
  197. </ol>
  198. <p>To create your own application:</p>
  199. <ol>
  200. <li>Create a new project, as a "win32 GUI".</li>
  201. <li>Either copy the example main.cpp from the Juce example project, or write your own based
  202. around the <code>JUCEApplication</code> class</li>
  203. <li>In your project's build settings, you'll need to make sure the linker uses the following libraries:
  204. <pre>libjuce.a or libjucedebug.a (these should be created in the juce/bin/codeblocks directory)
  205. libshell32.a
  206. libole32.a
  207. libvfw32.a
  208. libwinmm.a
  209. libwininet.a
  210. libdsound.a
  211. libwsock32.a
  212. libopengl32.a
  213. libglu32.a
  214. libuuid.a
  215. librpcrt4.a (these are all in the MinGW libraries folder)</pre>
  216. </li>
  217. </ol>
  218. <h3><a name="buildlinux"></a>Creating a JUCE application on Linux with GCC</h3>
  219. <ol>
  220. <li>Most linux distros should come with the tools you need, although you might want to get hold of
  221. <a href="http://premake.sourceforge.net/">premake</a>, which is used to automatically generate the
  222. juce makefile. (This isn't necessary if you're just going to use the makefile that's provided).</li>
  223. <li>Get a command prompt and go into <code>/juce/build/linux</code></li>
  224. <li>To build the debug version, use "<code>make CONFIG=Debug</code>", or use "<code>make CONFIG=Release</code>"
  225. to build the release version. You can also use "<code>make clean</code>" to delete the intermediate
  226. files.</li>
  227. </ol>
  228. <p>Then, to create and build an application:</p>
  229. <ol>
  230. <li>Building the library will have produced the library files <code>/juce/bin/libjuce.a</code> and
  231. <code>/juce/bin/libjuce_debug.a</code>. You'll need to link to one of these in your app, and you'll
  232. also need to link to these libraries:
  233. <pre>freetype
  234. pthread
  235. X11</pre>
  236. If you've set the <code>JUCE_USE_XINERAMA</code> flag in juce_Config.h, you'll also need to link to the
  237. <code>xinerama</code> library.
  238. And you'll need the <code>GL</code> and <code>GLU</code> libraries if you've enabled
  239. <code>JUCE_OPENGL</code>
  240. </li>
  241. </ol>
  242. <div class="ad">
  243. <p class="ad">***</p>
  244. </div>
  245. <div class="bottomsection">
  246. <p class="bottombar">- Copyright 2005 Raw Material Software Ltd -</p>
  247. </div>
  248. </div>
  249. </body>
  250. </html>