介绍

Juce是一个完全围绕C++语言的类库,用来开发跨平台的应用程序。

完整的用doxgen生成的html形式的API手册可以在这里下到。或者可以从下载页面下载预编译的windows帮助文件。

想获取更多的帮助或信息,请访问JUCE的网站

许可

Juce发布遵循Gnu Public License约定,该约定允许Juce可以被自用拷贝或发布,免费用于开源的软件代码中。

如果你想采用Juce开发发布一个非开源的应用,商业许可需要付费-点击这里获取更多关于价格和条款的信息。

安装

Juce的源文件全部放在一个名为juce的文件夹下,你可以解压并且拷贝它到你系统的任何地方。

在juce文件下的子文件下“juce/build”里包含用于不同的系统和编译器的工程文件,你可以编译juce库。

编译实例代码

在juce文件夹里面有例子程序,可以展示Juce的一些特性,在文件夹juce/extras/juce demo/build里包含适用于各种平台和编译器的工程文件,可以用于编译实例程序。

“混合(amalgamated)”版Juce

Juce的一个特性是可以把Juce作为一个独立c++文件链接进你的工程,而不是静态的链接库。也就是你实际上不用事先构建Juce库就把可以编写Juce应用程序,该特性需要在你的工程中添加“juce_amalgamated.cpp”文件,并且包含“juce_amalagamated.h”而不是“juce.h”.所有的例子程序都采用这种方法,因为这样对于一个刚使用Juce的新手来说不需要配置太多的信息。但是有些编译器需要和调试器可能引入巨大的文件,所以建议你采用的传统的方式,将Juce最为一个独立的库使用。

(备注:我测试过,如果采用混合版本,编译器会把所有的Juce库编译进程序中,一个Debug版本helloworld程序都要5M,很吓人,所以文档建议采用传统方式,以库的形式加载)

这中方法的一个变化就是需要包含“juce_amalgamated_template.cpp”在你的应用中,该文件和普通的混合文件一样,但区别是它是通过#include语句包含进来的,而不是把所有文件堆积到一个文件中。这样可以是调试简单一些。

创建一个新的Juce应用程序

在Microsoft Visual Studio中编译Juce程序

最快的方法就是尝试编译demo应用程序,在juce/extras/juce下有个VisualStudio的项目文件demo/build/win32_vc8/jucedemo.sln。该文件可以在vs2005以后包括免费版的VisualExpress2009都可以编译运行而无需额外的配置。

需要确认的是你是否熟悉VisualStudio,因为需要把jucedemo设置成你的启动工程(可以右键点击解决方案面板中jucedemo工程条目将会看到这个选项)。还有当前激活的选项应该被设置为“Debug”或者“Release”.(如果第一次加载工程,vc会选择一个默认的配置,通常选择“Debug DLL”,原因只有它自己知道)

创建你自己的应用程序链接Juce:

1 要么拷贝一份“juce/projects”下的例子工程,重命名和自定义配置一下,或者创建一个新的空的win32工程-不要选择MFC或者其他的项目因为VisualStuido可能污染了你的应用程序(因为vc会添加一些额外的代码进去)

2 在你的源文件中包含“juce.h”文件(最好放在预编译头文件中)

3 确保链接库的搜索路径包含“juce/bin”目录,这个路径可以设置在全局配置中或添加在你工程链接(linker)设置中.

4.是否选择“Multithreaded”或“Debug Multithreaded“运行时库,取决你做的Debug还是release版本编译。在VC6中该属性可以在”工程设置(Project Setting)->C/C++->代码(Code)->通用(General)选项“面板。在Visual Studio,这在"工程属性(Project properites)"面板设置。

5 确保你的工程开启了异常处理和运行时类型信息选项(RTTI)

6 看看"HellowWorld"工程,例子工程或者API文档关于JUCEApplication类的用法,从而知道怎么创建应用程序启动代码。

此外,你也可以使用Juce的混合形式(看下面的注释)。使用这个方法,需要你在你的工程中添加”juce_amalagamated.cpp“文件,包含”juce_amalagamated.h“头文件而不是"juce.h"文件。这个会将整个库拉进你的工程而无需单独去链接库。所以你可以跳过上述关于设置链接路径的步骤,等等。大多的例子程序都是采用这种方法编写,使用混合版本,所以参考这些例子看它怎么做的。

在Microsoft Visual Stuido6中编译Juce程序

由于VC6已经过时,此章节没有翻译

To compile the JUCE .lib files from the source code:
Install the latest Platform SDK from Microsoft.
Set up your include and library search paths. The first few items on your include path should look like this (obviously you might have things installed in different places, but the order is important!):
C:/Program Files/Microsoft Platform SDK/include
C:/Program Files/Microsoft Platform SDK/include/crt
C:/Program Files/Microsoft Platform SDK/include/mfc
C:/mycode/juce
...
And the library search path should begin like this:
C:/Program Files/Microsoft Visual Studio/VC98/LIB
C:/Program Files/Microsoft Platform SDK/lib
C:/mycode/juce/bin
...
Open the juce.dsp project file in juce/build/win32/vc6
There are several configurations: debug, release, debug-unicode, and release-unicode. You can build all or some of these, and the resultant .lib files should end up in the "juce/bin" folder.
Note that there's a rather lame bug in VC6 that causes an internal compiler error if you include filenames that are too long. This can get triggered if you put the juce folder in a deeply-nested directory (such as your user home directory). Unfortunately I think the only workaround for this is to move the source tree to a shallower directory.
For info on how to create an application that uses Juce, see the VC2005 notes above.

在Microsoft Visual Studio7中编译Juce程序

对于VC7,你可以导入VC6的配置应该可以工作。可能需要稍微调整一下VC8工程的版本信息,就可以在VC7中打开,但是这不是一个可靠的方法。

在MacOSX平台上的XCode环境中编译Juce程序

To compile the JUCE binaries from the source code:
Open the Juce.xcodeproj file in juce/build/macosx
This project has "debug" and "release" configurations, and the library files it creates are libjuce.a (release) and libjucedebug.a (debug), which will appear in the juce/bin directory.
Then, to create and build an application:
Either make a copy of the example project in juce/extras/example projects and rename/customise it, or create a new "Carbon Application" project.
Include the header file juce.h in all your source files.
Get rid of any main() functions that XCode might have generated for you, and instead use the JUCEApplication class as your application launcher - see the API documentation for this class for more details, or have a look at the example projects, or demos.
Drag-and-drop the juce.xcodeproj file into the project's "External Frameworks and Libraries" list.
Expand this item in the treeview, and inside there'll be an item "libjuce.a" or "libjucedebug.a" - drag-and-drop this into the "link binary with libraries" phase inside the xcode target. When you select either a debug or release juce build these entries will (usually) update themselves to show the correct debug or release library name. If you want your project to automatically rebuild Juce when you make changes to a juce file, you can also add Juce to your target's "Direct Dependency" list (show information for the target, and this is on the "general" tab).
Alternative ways of linking to juce would be to add the libjuce.a or libjucedebug.a library to your "External Frameworks and Libraries" list, or to add switch to the linker's command-line of either "-ljuce" or "-ljucedebug".
You'll also need to add some or all of the following OSX frameworks to your "External Frameworks and Libraries" list, depending on what features your application uses:
Cocoa.framework
Carbon.framework
IOKit.framework
CoreAudio.framework
CoreMIDI.framework
WebKit.framework
DiscRecording.framework
QTKit.framework
QuickTime.framework
QuartzCore.framework
AudioUnit.framework
AudioToolbox.framework
OpenGL.framework
AppKit.framework
CoreAudioKit.framework
CoreFoundation.framework
In future there may be other frameworks that you'll need to link with to support new JUCE features. (It should be pretty obvious from the link-time error when one of these is missing).
If all this seems too complicated, you can make things slightly easier by using the amalgamated form of Juce (see earlier note). To do this, all you need to do is to add juce_amalagamated.cpp to your project, and include juce_amalagamated.h instead of juce.h. This pulls the entire library into your project without needing to link to it separately, so you can skip the steps above that involve compiling the library, setting up the link paths, etc. Most of the demo apps are written using the amalgamated version, so have a look through their source code for examples of how to do this.

使用Code::Blocks和MinGW创建Juce应用程序

open the Juce project: juce/build/win32/codeblocks/juce.cbp
open the demo app project: juce/extras/juce demo/build/win32_codeblocks/JuceDemo.cbp
Build first the "Juce Library" project, and then the "Juce Demo App" project. If your build environment is set up correctly, these should just work and the demo app should run.
To create your own application:
Create a new project, as a "win32 GUI".
Either copy the example main.cpp from the Juce example project, or write your own based around the JUCEApplication class
In your project's build settings, you'll need to make sure the linker uses the following libraries:
libjuce.a or libjucedebug.a (these should be created in the juce/bin/codeblocks directory)
libshell32.a
libole32.a
libvfw32.a
libwinmm.a
libwininet.a
libdsound.a
libwsock32.a
libopengl32.a
libglu32.a
libuuid.a
librpcrt4.a (these are all in the MinGW libraries folder)

Linux平台利用Gcc创建Juce应用程序
Creating a JUCE application on Linux with GCC

Most linux distros should come with the tools you need, although you might want to get hold of premake, which is used to automatically generate the juce makefile. (This isn't necessary if you're just going to use the makefile that's provided).
Get a command prompt and Go into /juce/build/linux
To build the debug version, use "make CONFIG=Debug", or use "make CONFIG=Release" to build the release version. You can also use "make clean" to delete the intermediate files.
Then, to create and build an application:
Building the library will have produced the library files /juce/bin/libjuce.a and /juce/bin/libjuce_debug.a. You'll need to link to one of these in your app, and you'll also need to link to these libraries:
freetype
pthread
X11
If you've set the JUCE_USE_XINERAMA flag in juce_Config.h, you'll also need to link to the xinerama library. And you'll need the GL and GLU libraries if you've enabled JUCE_OPENGL
***

Juce-强大的开源类库的更多相关文章

  1. 一些iOS高效开源类库

    因为iOS SDK相对比较底层,所以开发者就得受累多做一些体力活.不过幸运的是,有很多第三方的类库可以用来简化很多不必要的工作.笔者整理了一下在本人学习过程中用到的一些比较有用Objective-C开 ...

  2. dropzonejs中文翻译手册 DropzoneJS是一个提供文件拖拽上传并且提供图片预览的开源类库.

    http://wxb.github.io/dropzonejs.com.zh-CN/dropzonezh-CN/ 由于项目需要,完成一个web的图片拖拽上传,也就顺便学习和了解了一下前端的比较新的技术 ...

  3. C#常用开源类库

    一.AOP框架        Encase 是C#编写开发的为.NET平台提供的AOP框架.Encase 独特的提供了把方面(aspects)部署到运行时代码,而其它AOP框架依赖配置文件的方式.这种 ...

  4. iOS高效开源类库

    因为iOS SDK相对比较底层,所以开发者就得受累多做一些体力活.不过幸运的是,有很多第三方的类库可以用来简化很多不必要的工作.笔者整理了一下在本人学习过程中用到的一些比较有用Objective-C开 ...

  5. 浅谈 Java 主流开源类库解析 XML

    在大型项目编码推进中,涉及到 XML 解析问题时,大多数程序员都不太会选用底层的解析方式直接编码. 主要存在编码复杂性.难扩展.难复用....,但如果你是 super 程序员或是一个人的项目,也不妨一 ...

  6. .net开源框架开源类库(整理)

    源:http://www.cnblogs.com/chinanetwind/p/3715809.html 常用库 Json.NET https://github.com/JamesNK/Newtons ...

  7. [IOS A] - 一些开源类库

    因 为iOS SDK相对比较底层,所以开发者就得受累多做一些体力活.不过幸运的是,有很多第三方的类库可以用来简化很多不必要的工作.笔者整理了一下在本人学习过程 中用到的一些比较有用Objective- ...

  8. Atitit java onvif 开源类库 getProfiles getStreamUri

    Atitit java onvif 开源类库 getProfiles getStreamUri 1. ONVIF Java Library by Milgo1 1.1. https://github. ...

  9. [转]C#常用开源类库收集

    .net PDF 类库 PDFsharp PDFsharp是一款可以让.NET框架支持的任何语言很容易的创建PDF文件的类库. ASP.NET FO PDF FO PDF 是一款C#编写类似于ASP. ...

  10. Json序列化之.NET开源类库Newtonsoft.Json的研究

     一.Json简介 JSON(全称为JavaScript Object Notation) 是一种轻量级的数据交换格式.它是基于JavaScript语法标准的一个子集. JSON采用完全独立于语言的文 ...

随机推荐

  1. urllib使用一

    urllib.urlopen()方法: 参数: 1.url(要访问的网页链接http:或者是本地文件file:) 2.data(如果有,就会由GET方法变为POST方法,提交的数据格式必须是appli ...

  2. 笔记-HTTP及HTTPS

    笔记-HTTP及HTTPS 1.      HTTP 1.1.    简介 HTTP:hyper text transfer protocol 超文本传输协议 http常用请求方式,method ge ...

  3. fromkeys语法/set集合/深浅拷贝/列表/字典的删除

    fromkeys语法: dic = {"apple":"苹果", "banana":"香蕉"} 返回新字典. 和原来的没 ...

  4. 关于android 5.0报错:dlopen failed: couldn't map ... Permission denied

    问题描述: 我的应用当中集成了一个安全相关的sdk,而这个sdk中使用的so是加过壳的. 它加载native so的方式是:Java System.loadLibrary --> native ...

  5. gradle编译很慢解决方法

    1.升级内存,内存最好在8g以上. 我的12g,编译运行,2s22ms,不到3s. 2.设置Android staido 不要 打开instant run

  6. react基本知识点合集

    妹子UI里面有React的相关组件与用法:http://amazeui.org/react/components React官方网站:https://facebook.github.io/react/ ...

  7. 【Random Forest】林轩田机器学习技法

    总体来说,林对于random forest的讲解主要是算法概况上的:某种程度上说,更注重insights. 林分别列举了Bagging和Decision Tree的各自特点: Random Fores ...

  8. python-使用unittest和ddt实现数据驱动

    一.数据驱动的概念 相同测测试脚本使用不同的测试数据来执行,测试数据和测试行为完全分离,这样的测试脚本设计模式成为数据驱动.测试框架使用unittest 和ddt模块相结合的方式 二.unittest ...

  9. hdu 2492 树状数组 Ping pong

    欢迎参加——BestCoder周年纪念赛(高质量题目+多重奖励) Ping pong Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 3 ...

  10. jQuery Ajax(load,post,get,ajax)

    1.load(url, [data], [callback]) 载入远程 HTML 文件代码并插入至 DOM 中. 默认使用 GET 方式 - 传递附加参数时自动转换为 POST 方式.jQuery ...