介绍

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. .net开源框架开源类库(整理)

    常用库 Json.NET https://github.com/JamesNK/Newtonsoft.Json Json.Net 是一个读写Json效率比较高的.Net框架.Json.Net 使得在. ...

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

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

  3. 2020年最新整理20个必备PHP开源类库,武装生产力

    PHP 2020年上半年已完结,PHP依旧是Z好的语言,推荐20个必备的PHP开源类库,只推荐综合排名第一的类库,其他第二第三的就不考虑了,有些类库已经年久失修,推荐就推荐这条街最靓的仔.本文覆盖了框 ...

  4. Github上的600多个iOS开源类库

     这是小弟的,目的是收集开发中常用的扩展和类,以便于日后开发的重用,希望各位大神们能指点迷津↓https://github.com/yoimhere/Ios_Extensions    这是开源类库的 ...

  5. 推荐几个开源类库,超好用,远离996!

    今天给大家分享几个 Java 的开源类库,亲测非常好用! 有了它们之后,你就可以和很多重复劳动说再见了. 1. MapStruct MapStruct是干什么的? MapStruct是个代码产生器,它 ...

  6. 【开源】高颜值 功能强大的开源Markdown编辑器

    开源最前线(ID:OpenSourceTop) 猿妹编译 地址:https://github.com/notable/notable Markdown是一种可以使用普通文本编辑器编写的标记语言,通过简 ...

  7. 手把手教你使用CocoaPods管理你的iOS第三方开源类库

    手把手教你使用CocoaPods管理你的iOS第三方开源类库 本文转载自:http://kittenyang.com/cocoapods 鉴于我开这个博客的初衷是记录自己平时的技术积累,而我平时又属研 ...

  8. mysql 监控 开源_强大的开源企业级数据库监控利器Lepus

    Lepus监控简单介绍 开源企业级数据库监控系统 简洁.直观.强大的开源数据库监控系统,MySQL/Oracle/MongoDB/Redis一站式性能监控,让数据库监控更简单 简单介绍: Lepus( ...

  9. 关于android开源类库StickyListHeaderAdapter 的写法注意

    最近作比赛用到了android的这一个开源类库,然后费劲千辛万苦写好了之后,发现Header部分 ,就是图片中的2014年02月10日不会随着item的日期内容进行更新,拜读了大神的博客之后,(htt ...

  10. c++ 命令行错误: 无法打开 元数据 文件_PostgreSQL:强大的开源对象关系数据库管理系统...

    PostgreSQL是一个功能强大的开源对象关系数据库管理系统(ORDBMS),用于安全地存储数据,它是是跨平台的,可以在许多操作系统上运行,如Linux,FreeBSD,OS X,Solaris和M ...

最新文章

  1. 有哪些高效看文献的方法?
  2. Eclipse OSGi调试过程
  3. html判断是否有某个元素,jquery怎么判断元素是否存在?
  4. 社区计算机义务维修策划书,计协义务维修策划书(模板).doc
  5. 企业微信万亿级日志检索系统
  6. python电脑截图文字识别软件_Python实现文字识别,来看看大牛怎么实现截图/
  7. 2010年11月编程语言排行榜:手机里的代码
  8. Java内部类 Inner Class
  9. Asp.net MVC3 Razor语法小记
  10. python研究背景与意义_立体匹配的研究背景以及意义
  11. Photoshop CS3 中文版安装教程
  12. 图像检索--联合加权聚合深度卷积特征的图像检索方法
  13. 大数据技术应用于金融行业,主要有什么影响?
  14. Bootstrap折叠导航栏
  15. 软件测试找游戏bug,游戏测试用例及游戏测试bug详解
  16. 简一论币:8.14 晚间BTC行情分析及操作建议
  17. Resource leak解决办法
  18. 分销的智能变局,华为好望云服务的铁索连环
  19. 亿级流量网站架构核心技术
  20. Bilateral attention network for RGB-D salient object detection阅读笔记

热门文章

  1. 想做合格的产品经理,你需要这个证书
  2. 数据库导入导出的几种方式
  3. 顶级 Vue.js 开发工具
  4. [计算机系统-01] 计算机系统漫游
  5. PMP ITTO 和 4W1H
  6. 【历史上的今天】1 月 1 日:惠普诞生;互联网的规范化;百度成立
  7. PyQt窗口设计之Qt Designer
  8. 安装最新版 MySQL 8.0.30
  9. 基于php的企业公文流转审批系统
  10. 计算机初级程序员哪里颁发的,初级程序员证书怎么考_初级程序员证书考什么_上学吧...