Amalgamated juce

Looks like a namspace collision. Someone more experienced with JUCE can probably tell you what code is colliding.

i coudln’t figure out why free() causes errors, anyway
i commented out the destructor part of the ~ctype() and the project compiled, this is most definetly not a solution however it just shows that this is the only error in this version. the rest works fine in VC6.

[quote=“spiderman”]Another misterious thing:

One of my applications (only one I tested so far) went up in size:

release: 900K to 2.5M
debug: 3M to 5.5M

This could probably be because I skipped a few revisions in the svn, so I guess I have to build the regular stuff from the tip as well.

Edit:
I can confirm now (using the tip of the svn) that the amalgamated version produces about 2.5x larger executable when built (while the static libs are massively smaller than before).[/quote]

… the size grows because now the compiler can SEE the whole library at once. Now, compiler can peform better optimizations, so you can have more INLINED functions packed in your executable file that blow your application size.

Amalgamation is a better choice than a static library to increase your application performance.

Hello Julian.

First, let me thank you for this version of JUCE. Thank you very much.

…everything is Ok except for the OGG Vorbis audio files. They do not play. AudioFormatManager.createReaderFor returns NULL for OGGs. This problem seems specific for GCC and OGG “C” library. There are many OGG specific warnings while compilation. So this is not your fault. Anyway, I do not know what to do to solve the issue.

P.S. AudioFormatManager.createReaderFor(File) and AudioFormatManager.createReaderFor(InputStream) behave differently. “File” version works Ok returning NULL for OGGs, but “InputStream” version creates corrupted streams. I mean, there is an awful noise when trying to play an OGG file.

Sorry - there was a bugette in the ogg code. I checked in a fix for it last night.

Thank you, Julian. Tha amalgamated version of JUCE is just a miracle. A million of thanks :slight_smile:

I’m trying out amalgamated JUCE, no problems on Mac. But I figured I had to define DONT_AUTOLINK_TO_JUCE_LIBRARY on Windows before inlcuding juce.h in my source files to prevent it trying to autolink to the static libs. I was getting link errors (since I purposefully didn’t build the static libs so they’re not there).

Is this the recommended way?

Almost - instead of juce.h, you should include juce_amalgamated.h…

hello

sorry for the dumb question, but I’ve just discovered the amalgamated version of juce.
Why does the demo application in \juce\extras\example projects\example_project_for_Win32 use the amalgamated version of juce, but still is depend on the Juce project ?

thanks

geoffroy

I added the juce project to the solution just so it’s easy to look through the classes. But there’s no need for it to actually be a dependency, I guess.

i’m actually having problems on linux when using the amalgamated version cause of some double defined classes, namely KeyPress Font Time Drawable which are aready defined inside Xlib.h.
I’ve disabled most of the things in the StandardHeader.h before including juce_amalgameted.h to cut out the problems more, but i’m still getting weird things.

Here is an example.

kraken@localhost ~/Projects/JuceAudioPluginLinux/plugins/Jost/build/linux $ make
==== Building jost ====
Config.cpp
StandardLibrary.cpp
../../../../juce/juce_amalgamated.cpp: In member function ‘void juce::Slider::restoreMouseIfHidden()’:
../../../../juce/juce_amalgamated.cpp:44496: warning: converting to ‘int’ from ‘double’
../../../../juce/juce_amalgamated.cpp:44503: warning: converting to ‘int’ from ‘double’
../../../../juce/juce_amalgamated.h: In constructor ‘juce::AudioDeviceSelectorComponent::AudioDeviceSelectorComponent(juce::AudioDeviceManager&, int, int, int, int, bool, bool, bool, bool)’:
../../../../juce/juce_amalgamated.h:51109: warning: ‘juce::AudioDeviceSelectorComponent::hideAdvancedOptionsWithButton’ will be initialized after
../../../../juce/juce_amalgamated.h:51103: warning:   ‘juce::ComboBox* juce::AudioDeviceSelectorComponent::deviceTypeDropDown’
../../../../juce/juce_amalgamated.cpp:66538: warning:   when initialized here
../../../../juce/juce_amalgamated.cpp: At global scope:
../../../../juce/juce_amalgamated.cpp:261921: warning: ‘void juce::trapErrors()’ defined but not used
../../../../juce/juce_amalgamated.cpp:261927: warning: ‘bool juce::untrapErrors()’ defined but not used
Commands.cpp
HostFilterComponent.cpp
../../src/ui/GraphComponent.h:195: error: reference to ‘Font’ is ambiguous
/usr/include/X11/X.h:105: error: candidates are: typedef XID Font
../../../../juce/juce_amalgamated.h:17171: error:                 class juce::Font
../../src/ui/GraphComponent.h:195: error: reference to ‘Font’ is ambiguous
/usr/include/X11/X.h:105: error: candidates are: typedef XID Font
../../../../juce/juce_amalgamated.h:17171: error:                 class juce::Font
../../src/ui/GraphComponent.h:195: error: ‘Font’ does not name a type
../../src/ui/toolbar/ToolbarMainComponent.h:133: error: reference to ‘Drawable’ is ambiguous
/usr/include/X11/X.h:102: error: candidates are: typedef XID Drawable
../../../../juce/juce_amalgamated.h:40447: error:                 class juce::Drawable
../../src/ui/toolbar/ToolbarMainComponent.h:133: error: template argument 1 is invalid
../../src/ui/lookandfeel/jost_JostLookAndFeel.h:64: error: reference to ‘Font’ is ambiguous
/usr/include/X11/X.h:105: error: candidates are: typedef XID Font
../../../../juce/juce_amalgamated.h:17171: error:                 class juce::Font
../../src/ui/lookandfeel/jost_JostLookAndFeel.h:64: error: reference to ‘Font’ is ambiguous
/usr/include/X11/X.h:105: error: candidates are: typedef XID Font
../../../../juce/juce_amalgamated.h:17171: error:                 class juce::Font
../../src/ui/lookandfeel/jost_JostLookAndFeel.h:64: error: ‘Font’ does not name a type
make[1]: *** [../../../../bin/intermediate/jostDebug/HostFilterComponent.o] Error 1
make: *** [jost] Error 2

I’m getting tons of similar errors if i add SHM support for instance. How can we fix these ? It seems i’m unable to make it work actually…

ok i’ve found the culprit (it was my fault but very subtle).

if you include the juce_amalgamated.cpp specifying it in a cpp file inside yur project, you will need to incude it WITHOUT including before juce_amalgamated.h or you will get lots of error (at least on the linux side).

do this:

 // file StandardInclude.h
 #include "your_project_specific_juce_config.h"
 #include "juce_amalgamated.h"

 // file StandardLibrary.cpp
 #include "your_project_specific_juce_config.h"
 #include "juce_amalgamated.cpp"

and not:

 // file StandardInclude.h
 #include "your_project_specific_juce_config.h"
 #include "juce_amalgamated.h"

 // file StandardLibrary.cpp
 #include "StandardInclude.h"
 #include "juce_amalgamated.cpp"

maybe it sound obvious to most of you, but it took me half an hour to discover that (after sleeping the whole night not thinking about it) :confused:

maybe it is better to clear this in the docs somewhere, cause i think it will be useful to other people that have problems in using the amalgamated version of juce.

Interesting. I can probably add a macro to throw an error if you try to do that.

thanx.

i’m pushing the amalgama to the edge. trying to compile a juce application with GCC 4.1.2 with “-O3 -fomit-frame-pointer -s” instead of “-O2 -s”, i get a wonderful gcc segfault:

…/…/…/…/juce/juce_amalgamated.cpp:55702: internal compiler error: Segmentation fault
Please submit a full bug report,
with preprocessed source if appropriate.

not that i need something more than -O2, but just for fun…

:smiley:

Ouch!

[quote=“kraken”]…trying to compile a juce application with GCC 4.1.2 with “-O3 -fomit-frame-pointer -s” instead of “-O2 -s”, i get a wonderful gcc segfault:

…/…/…/…/juce/juce_amalgamated.cpp:55702: internal compiler error: Segmentation fault
Please submit a full bug report,
with preprocessed source if appropriate.

not that i need something more than -O2, but just for fun…

:D[/quote]

I perfectly compile the juce_amalgamated.cpp file by GCC 4.3.1 with “-O3 -fomit-frame-pointer -s” and even with the extreme option “-O5”. Try to upgrade GCC to the 4.3.1 version.

yeah gcc 4.3.2 can produce everything faster with no additional head aches !

Hi, I’m using MinGW with gcc 3.4.5 and had some troubles compiling amalgamated code…

included <crtdbg.h> and <comutil.h> are not part of MinGW

line:239784: error: declaration of bool juce::juce_setFileReadOnly(const juce::String&, bool)' throws different exceptions line:5322: error: than previous declarationbool juce::juce_setFileReadOnly(const juce::String&, bool) throw ()’

line:244884: error: declaration of void juce::juce_setWindowStyleBit(HWND__*, int, int, bool)' throws different exceptions line:243572: error: than previous declarationvoid juce::juce_setWindowStyleBit(HWND__*, int, int, bool) throw ()’

I couldn’t use external jpeg (error at compile time) and png (error at link time) libraries - this could be my fault though

This was command line used:
g++ -Wall -O3 -funit-at-a-time -DNDEBUG -I"." -I/devel/pkg/zlib/1.2.3/include -I/devel/pkg/png/1.2.31/include -I/devel/pkg/zlib/1.2.3/include -I/devel/pkg/jpeg/6b/include -c -o juce_LibrarySource.o juce_LibrarySource.cpp

Bye

Sorry - you’re on your own with mingw. Why are you using it?? Surely it’s really just there so you can compile a unix app on a windows machine… With juce there’s no need to do that!

I’m using MinGW since modem times, today things are different but the size difference of installation is still huge… and well I got used to it in the meantime…

But 2) and 3) are still bugs right?

Bye