FHT compile error

i have tried other posted solutions but i can get it figured out

i am using fht4 from the open music lab site

using the fht adc serial sketch untouched that came with it

here is my error

Arduino: 1.6.12 (Windows 10), Board: "Arduino/Genuino Uno"

fht_log_out' referenced in section .text.startup' of C:\Users\george\AppData\Local\Temp\ccxX36WK.ltrans0.ltrans.o: defined in discarded section `.text' of sketch\fht_adc_serial.pde.cpp.o (symbol from plugin)

fht_log_out' referenced in section .text.startup' of C:\Users\george\AppData\Local\Temp\ccxX36WK.ltrans0.ltrans.o: defined in discarded section `.text' of sketch\fht_adc_serial.pde.cpp.o (symbol from plugin)

collect2.exe: error: ld returned 1 exit status

exit status 1
Error compiling for board Arduino/Genuino Uno.

Can someone please help me figure it out i would very much appreciate it

The name "sketch\fht_adc_serial.pde.cpp.o" indicates to me an old (PDE) project version, which is no more supported by the current IDE.

That particular error arises from changes in the new version of the gcc compiler.

New versions of the FFT and FHT libraries have very recently been posted at the Open Music Labs web site and should solve the problem.

i downloaded the new fht version 4 and started with that one the examples are the ones that came with it the fht_adc works kinda (can't read the garbage it shows in the serial monitor just shows garbage) no errors but i get the compile error on the fht_adc_serial one

For informed help, please read and follow the directions in "How to use this forum".

minimax55:
i downloaded the new fht version 4

Please post a link to where you downloaded the library from. I only see V3.0 available from:
http://wiki.openmusiclabs.com/wiki/ArduinoFHT

minimax55:
can't read the garbage it shows in the serial monitor just shows garbage

Make sure you have the correct baud rate set in the menu in the lower right corner of the Serial Monitor window.

Note that some of the Open Music Lab examples use Serial.write() to send binary data back to the computer for plotting, and this will look like garbage on the serial monitor.

The Serial Plotter can be used instead of the Serial Monitor (Tools menu), for plotting such data. The output protocol may have to be changed to CSV, as expected by Serial Plotter.

the link is correct it says version 3 on their site but the download file says fht4 so sorry for the confusion
i figured it has to do with the Serial.println because it wont error with Serial.write in the other file example

i get the compile error on the fht_adc_serial

I confirm the compilation error. I was able to fix it by:

Open the file FHT/FHT.h in a text editor.
Change line 112 from:

 uint8_t fht_log_out[(FHT_N/2)]; // FHT log output magintude buffer

to:

 uint8_t __attribute__((used)) fht_log_out[(FHT_N/2)]; // FHT log output magintude buffer

Save the file.

Arduino AVR Boards 1.6.12 and newer uses LTO(link time optimization) to significantly reduce memory usage in some cases but in other cases the optimization is too aggressive and breaks things as with the FHT library. Adding the used attribute tells the compiler not to discard fht_log_out.

Thank you pert it worked.