Error uploading sketch from Mozzi liobrary examples

I'm getting this error message whenever I'm trying to upload a sketch from the Mozzi Library Examples. Anyone has any tip to fix this? I'm on "MacBook Pro M3 Max Sonoma" Thank you.

ERROR MESSAGE:
In file included from /Users/giorgio/Documents/Arduino/libraries/Mozzi/internal/config_checks_generic.h:199:0,
from /Users/giorgio/Documents/Arduino/libraries/Mozzi/MozziGuts.h:31,
from /Users/giorgio/Documents/Arduino/libraries/Mozzi/Mozzi.h:33,
from /Users/giorgio/Documents/Arduino/libraries/Mozzi/examples/06.Synthesis/AMsynth_HIFI/AMsynth_HIFI.ino:47:
/Users/giorgio/Documents/Arduino/libraries/Mozzi/internal/../AudioOutput.h:60:10: fatal error: FixMath.h: No such file or directory
#include <FixMath.h>
^~~~~~~~~~~
compilation terminated.
exit status 1

Compilation error: exit status 1

Hi @giominz. Just as you use libraries in your sketch code, libraries may use other libraries. When you are using one of the libraries that does this, it is necessary to install the other libraries on which the library depends in addition to the library you are using directly in your sketch.

The "Mozzi" library has a dependency on the "FixMath" library. You don't have the "FixMath" library installed, so the compilation fails with this "No such file or directory" error.

You can solve it by installing the missing library.

I'll provide instructions you can follow to do that:

  1. Select Sketch > Include Library > Manage Libraries... from the Arduino IDE menus.
    The "Library Manager" dialog will open.
  2. Wait for the update to finish, as indicated by the progress bar at the bottom of the "Library Manager" dialog.
  3. Type FixMath in the "Filter your search..." field.
  4. Press the Enter key.
  5. Scroll down through the list of libraries until you see the "FixMath" entry. Click on it.
    A menu and button will appear at the bottom of the entry.
  6. Click the "Install" button in the "FixMath" entry.
  7. Wait for the installation to finish.
  8. Click the "Close" button in the "Library Manager" dialog.
    The "Library Manager" dialog will close.

Now try compiling or uploading your sketch again. Hopefully this time you won't have any errors and everything will work as expected.

1 Like

Thank you so much!!! All working now.
I really appreciate your help, I should have thought about that....
Ciao! Giorgio

You are welcome. I'm glad it is working now.

Regards,
Per

1 Like

I'm not sure I understood correctly what you mean by this. Please provide a more detailed description of what you mean by "doesn't seem to work" in a reply on this forum thread to help us to understand it, including:

  • What did you do?
  • What were the results you expected from doing that thing?
  • What were the results you observed that did not match your expectations?

Make sure to include the full and exact text of any error or warning messages you might have encountered.

SOLVED: I just replicated the same connections I used on the UNO
Audio: Gnd -Pin 11 or 12
Switches: Pin 8 & 9.

Sorry for waisting your time... g

1 Like

Hello Again, I now have this error appearing, any advice? It says Done Uploading but with all this text, maybe just a warning, not an error?

In file included from /Users/giorgio/Desktop/SYNTHS/*MY SYNTHS/*INSTRUMENTS/Granular Drones (Arduino Nano)/Arduino-drone-sketch-master/Arduino-drone-sketch-master/FJEKUBFHV9FVC0C/FJEKUBFHV9FVC0C.ino:1:0:
/Users/giorgio/Documents/Arduino/libraries/Mozzi/MozziGuts.h:20:2: warning: #warning Direct inclusion of MozziGuts.h is deprecated. Use Mozzi.h, instead, and read about porting to Mozzi 2.0 [-Wcpp]
 #warning Direct inclusion of MozziGuts.h is deprecated. Use Mozzi.h, instead, and read about porting to Mozzi 2.0
  ^~~~~~~
/Users/giorgio/Desktop/SYNTHS/*MY SYNTHS/*INSTRUMENTS/Granular Drones (Arduino Nano)/Arduino-drone-sketch-master/Arduino-drone-sketch-master/FJEKUBFHV9FVC0C/FJEKUBFHV9FVC0C.ino: In function 'void updateControl()':
/Users/giorgio/Desktop/SYNTHS/*MY SYNTHS/*INSTRUMENTS/Granular Drones (Arduino Nano)/Arduino-drone-sketch-master/Arduino-drone-sketch-master/FJEKUBFHV9FVC0C/FJEKUBFHV9FVC0C.ino:98:42: warning: 'uint16_t mozziAnalogRead(uint8_t)' is deprecated: This use of mozziAnalogRead() is not portable. Refer to the API documentation for suggested alternatives. [-Wdeprecated-declarations]
    int freqVal = mozziAnalogRead(LDR3_PIN); // value is 0-1023
                                          ^
In file included from /Users/giorgio/Documents/Arduino/libraries/Mozzi/MozziGuts.h:33:0,
                 from /Users/giorgio/Desktop/SYNTHS/*MY SYNTHS/*INSTRUMENTS/Granular Drones (Arduino Nano)/Arduino-drone-sketch-master/Arduino-drone-sketch-master/FJEKUBFHV9FVC0C/FJEKUBFHV9FVC0C.ino:1:
/Users/giorgio/Documents/Arduino/libraries/Mozzi/mozzi_analog.h:176:150: note: declared here
 MOZZI_DEPRECATED("2.0", "This use of mozziAnalogRead() is not portable. Refer to the API documentation for suggested alternatives.") inline uint16_t mozziAnalogRead(uint8_t pin) { return mozziAnalogRead<MOZZI__INTERNAL_ANALOG_READ_RESOLUTION>(pin); }
                                                                                                                                                      ^~~~~~~~~~~~~~~
/Users/giorgio/Desktop/SYNTHS/*MY SYNTHS/*INSTRUMENTS/Granular Drones (Arduino Nano)/Arduino-drone-sketch-master/Arduino-drone-sketch-master/FJEKUBFHV9FVC0C/FJEKUBFHV9FVC0C.ino:101:40: warning: 'uint16_t mozziAnalogRead(uint8_t)' is deprecated: This use of mozziAnalogRead() is not portable. Refer to the API documentation for suggested alternatives. [-Wdeprecated-declarations]
    int knob2 = mozziAnalogRead(LDR4_PIN); // value is 0-1023
                                        ^
In file included from /Users/giorgio/Documents/Arduino/libraries/Mozzi/MozziGuts.h:33:0,
                 from /Users/giorgio/Desktop/SYNTHS/*MY SYNTHS/*INSTRUMENTS/Granular Drones (Arduino Nano)/Arduino-drone-sketch-master/Arduino-drone-sketch-master/FJEKUBFHV9FVC0C/FJEKUBFHV9FVC0C.ino:1:
/Users/giorgio/Documents/Arduino/libraries/Mozzi/mozzi_analog.h:176:150: note: declared here
 MOZZI_DEPRECATED("2.0", "This use of mozziAnalogRead() is not portable. Refer to the API documentation for suggested alternatives.") inline uint16_t mozziAnalogRead(uint8_t pin) { return mozziAnalogRead<MOZZI__INTERNAL_ANALOG_READ_RESOLUTION>(pin); }
                                                                                                                                                      ^~~~~~~~~~~~~~~
/Users/giorgio/Desktop/SYNTHS/*MY SYNTHS/*INSTRUMENTS/Granular Drones (Arduino Nano)/Arduino-drone-sketch-master/Arduino-drone-sketch-master/FJEKUBFHV9FVC0C/FJEKUBFHV9FVC0C.ino:105:44: warning: 'uint16_t mozziAnalogRead(uint8_t)' is deprecated: This use of mozziAnalogRead() is not portable. Refer to the API documentation for suggested alternatives. [-Wdeprecated-declarations]
   int knob_value = mozziAnalogRead(KNOB_PIN); // value is 0-1023
                                            ^
In file included from /Users/giorgio/Documents/Arduino/libraries/Mozzi/MozziGuts.h:33:0,
                 from /Users/giorgio/Desktop/SYNTHS/*MY SYNTHS/*INSTRUMENTS/Granular Drones (Arduino Nano)/Arduino-drone-sketch-master/Arduino-drone-sketch-master/FJEKUBFHV9FVC0C/FJEKUBFHV9FVC0C.ino:1:
/Users/giorgio/Documents/Arduino/libraries/Mozzi/mozzi_analog.h:176:150: note: declared here
 MOZZI_DEPRECATED("2.0", "This use of mozziAnalogRead() is not portable. Refer to the API documentation for suggested alternatives.") inline uint16_t mozziAnalogRead(uint8_t pin) { return mozziAnalogRead<MOZZI__INTERNAL_ANALOG_READ_RESOLUTION>(pin); }
                                                                                                                                                      ^~~~~~~~~~~~~~~
/Users/giorgio/Desktop/SYNTHS/*MY SYNTHS/*INSTRUMENTS/Granular Drones (Arduino Nano)/Arduino-drone-sketch-master/Arduino-drone-sketch-master/FJEKUBFHV9FVC0C/FJEKUBFHV9FVC0C.ino:118:43: warning: 'uint16_t mozziAnalogRead(uint8_t)' is deprecated: This use of mozziAnalogRead() is not portable. Refer to the API documentation for suggested alternatives. [-Wdeprecated-declarations]
   int LDR1_value= mozziAnalogRead(LDR1_PIN); // value is 0-1023
                                           ^
In file included from /Users/giorgio/Documents/Arduino/libraries/Mozzi/MozziGuts.h:33:0,
                 from /Users/giorgio/Desktop/SYNTHS/*MY SYNTHS/*INSTRUMENTS/Granular Drones (Arduino Nano)/Arduino-drone-sketch-master/Arduino-drone-sketch-master/FJEKUBFHV9FVC0C/FJEKUBFHV9FVC0C.ino:1:
/Users/giorgio/Documents/Arduino/libraries/Mozzi/mozzi_analog.h:176:150: note: declared here
 MOZZI_DEPRECATED("2.0", "This use of mozziAnalogRead() is not portable. Refer to the API documentation for suggested alternatives.") inline uint16_t mozziAnalogRead(uint8_t pin) { return mozziAnalogRead<MOZZI__INTERNAL_ANALOG_READ_RESOLUTION>(pin); }
                                                                                                                                                      ^~~~~~~~~~~~~~~
/Users/giorgio/Desktop/SYNTHS/*MY SYNTHS/*INSTRUMENTS/Granular Drones (Arduino Nano)/Arduino-drone-sketch-master/Arduino-drone-sketch-master/FJEKUBFHV9FVC0C/FJEKUBFHV9FVC0C.ino:136:43: warning: 'uint16_t mozziAnalogRead(uint8_t)' is deprecated: This use of mozziAnalogRead() is not portable. Refer to the API documentation for suggested alternatives. [-Wdeprecated-declarations]
   int LDR2_value= mozziAnalogRead(LDR2_PIN); // value is 0-1023
                                           ^
In file included from /Users/giorgio/Documents/Arduino/libraries/Mozzi/MozziGuts.h:33:0,
                 from /Users/giorgio/Desktop/SYNTHS/*MY SYNTHS/*INSTRUMENTS/Granular Drones (Arduino Nano)/Arduino-drone-sketch-master/Arduino-drone-sketch-master/FJEKUBFHV9FVC0C/FJEKUBFHV9FVC0C.ino:1:
/Users/giorgio/Documents/Arduino/libraries/Mozzi/mozzi_analog.h:176:150: note: declared here
 MOZZI_DEPRECATED("2.0", "This use of mozziAnalogRead() is not portable. Refer to the API documentation for suggested alternatives.") inline uint16_t mozziAnalogRead(uint8_t pin) { return mozziAnalogRead<MOZZI__INTERNAL_ANALOG_READ_RESOLUTION>(pin); }
                                                                                                                                                      ^~~~~~~~~~~~~~~
Sketch uses 7622 bytes (24%) of program storage space. Maximum is 30720 bytes.
Global variables use 910 bytes (44%) of dynamic memory, leaving 1138 bytes for local variables. Maximum is 2048 bytes.

Hi,
Indeed these are just warning that we added to promote good practices with Mozzi2. Worth reading them and applying them :wink: . For more: Porting old sketches to a new Mozzi - Mozzi

1 Like

Thank you Tom!