Where to put the tutorials for easy compile


#1

I’m trying to figure out where to put the https://www.juce.com/tutorials so they compile with no mods.

I made a directory structure in parallel with the Juce directory. The modules were then found, but now when building, projucer complains it can’t find the mm files.

There must be an easier way.

Anybody know?


#2

The default directory for the JUCE modules directory in the tutorials (relative to the tutorial .jucer files) is ../../juce/modules/

This means that your JUCE directory must be called juce and that the tutorials are unzipped to a directory at the same level as juce. For example:

  • juce
  • modules
  • examples
  • …etc
  • YourTutorialsDirectory
  • tutorial_main_component
    • MainComponentTutorial.jucer
  • tutorial_graphics_class
  • …etc

#3

…is that what you did already with a “directory structure in parallel with the Juce directory”?


#4

Yes, that is the directory structure I used. This allowed the modules to be found, but now I get a stream of errors like this:

No global header file was included
error reading 'xxxx/JUICE/tutorials/tutorials/tutorial_main_window/JuceLibraryCode/juce_audio_basics.mm

So it looks like it trying to find the mm files in the downloaded example, but they are not there.

Must be a paths problem. I’ll keep investigating.


#5

The downloaded tutorials have placed the mm files in ‘JuceLibraryCode/Modules’, not ‘juceLibraryCode’.

I would take out the ‘Modules’ directory, but the text file in ‘juceLibraryCode’ says not to put files here or they will be mercilessly deleted.


#6

Also note, that I had to add an extra ‘tutorials’ directory in the path as the tutorial_main_window was looking for JUCE three directories below.


#7

I’ve given up on this. Too many adjustments for a juce beginner to understand.

Why is this so difficult? There are no instructions on the tutorial page and the tutorials obviously are not being kept up to match the latest juce distribution.

Tutorials should be very easy for someone new to juce to download and run.

I am on the mac, in case anyone wants to give it a go and come up with some reasonable instructions on how to run the tutorials.


#8

If you start from the projucer and the modules path is correct, you shouldn’t have to change anything…
Open the .jucer file - Click in the “Config” tab on “Save Project and open in IDE” - there you hit compile and run…
Any mm files are created and/or copied to the locations where they are needed in the projucer exporter, which is the one working when you hit “Save Project and open in IDE”.
Did you do it that way?


#9

How about some simple instructions on the tutorial page? Is that too much to ask?

Like this on a mac:

  1. Download JUCE to a directory of your choosing
  2. Download any of the tutorials to the same directory you downloaded JUCE to.
  3. Run Projucer and open the jucer file of the tutorial you downloaded.
  4. Now go to the Build tab in…

OOPS, big fat error message. The modules can’t be found. WTF!

OK, now try these instructions.

  1. Download JUCE to a directory of your choosing
  2. Create a directory where you downloaded JUCE to called ‘tutorials’
  3. In the ‘tutorials’ directory, create another directory called ‘tutorials’.
  4. Download any of the tutorials to the last ‘tutorials’ directory you created.
  5. Run Projucer and open the jucer file of the tutorial you downloaded.
  6. Now go to the build tab.

Yippee, the modules have been found, but now there is a whole slew of new error messages like

  1. "No global header file was included’
  2. error reading /xxx/tutorial_main_window/JuceLibraryCode/juce_audio_bsics.mm.
  3. many more messages about mm files

Why is this so difficult?


#10

Here are the instructions that work:

  1. Download JUCE to a directory of your choosing
  2. Create a directory where you downloaded JUCE to called ‘tutorials’
  3. In the ‘tutorials’ directory, create another directory called ‘tutorials’.
  4. Download any of the tutorials to the last ‘tutorials’ directory you created.
  5. Run Projucer and open the jucer file of the tutorial you downloaded.
  6. Now go to the projucer File menu and select 'save project’
    This will cause projucer to copy the files to the JuceLibraryCode directory and start compiling
  7. Wait for compile to complete.
  8. From the projucer Build menu, select ‘Launch Application’

Get these instruction on the tutorials page and those new to JUCE won’t have to waste hours of their time.


#11

The instructions above applied to the main window tutorial. The listeners and broadcasters tutorial has various module paths.

Tutorial maintainer needs to really go through these tutorials and get the module paths consistent.


#12

I had the same experience as babazaroni. Very frustrating. Digging deeper I found most tutorials work exactly as martinrobinson described above, with a module path of “…/…/juce/modules”. But the first three graphics tutorials do not, enough to derail many newcomers:

  1. tutorial_main_window.zip
  2. tutorial_main_component.zip
  3. tutorial_graphics_class.zip

These have a module path of “…/…/…/JUCE/modules”. tutorial_graphics_class.zip also has an extra directory layer “GraphicsTutorial” in the zip file. Fixing these inconsistencies, plus instructions on the set up, would remove a major pothole from the JUCE on-ramp

hth,
ch

ps It would also help to add a map of tutorial dependencies. For example, tutorial_simple_synth_noise looks first, and tutorial_synth_level_control looks next, except oops it assumes tutorial_slider_values, and oh wait that assumes tutorial_listeners_and_broadcasters.zip, and where does this rabbit hole really start anyway?


#13

This problem could be reduced greatly by explaining how to set the module path correctly somewhere in the tutorials. This is not obvious for people who don’t know much about projucer and just want to run the tutorials.


#14

It’s good to start with this tutorial: https://www.juce.com/doc/tutorial_new_projucer_project