Error using example code from FHT library

Hello,

I’m trying to use the FHT library to analyse sound from a microphone. I am using the example code from FHTExample - Open Music Labs Wiki
but this code is giving me the following error messages:

`_window_func' referenced in section `.text.startup' of C:\Users\Sjoerd\AppData\Local\Temp\cc7ajKGW.ltrans0.ltrans.o: defined in discarded section `.text' of sketch\sketch_may25a.ino.cpp.o (symbol from plugin)

`_window_func' referenced in section `.text.startup' of C:\Users\Sjoerd\AppData\Local\Temp\cc7ajKGW.ltrans0.ltrans.o: defined in discarded section `.text' of sketch\sketch_may25a.ino.cpp.o (symbol from plugin)

`_reorder_table' referenced in section `.text.startup' of C:\Users\Sjoerd\AppData\Local\Temp\cc7ajKGW.ltrans0.ltrans.o: defined in discarded section `.text' of sketch\sketch_may25a.ino.cpp.o (symbol from plugin)

`_reorder_table' referenced in section `.text.startup' of C:\Users\Sjoerd\AppData\Local\Temp\cc7ajKGW.ltrans0.ltrans.o: defined in discarded section `.text' of sketch\sketch_may25a.ino.cpp.o (symbol from plugin)

`_cas_constants' referenced in section `.text.startup' of C:\Users\Sjoerd\AppData\Local\Temp\cc7ajKGW.ltrans0.ltrans.o: defined in discarded section `.text' of sketch\sketch_may25a.ino.cpp.o (symbol from plugin)

`_cas_constants' referenced in section `.text.startup' of C:\Users\Sjoerd\AppData\Local\Temp\cc7ajKGW.ltrans0.ltrans.o: defined in discarded section `.text' of sketch\sketch_may25a.ino.cpp.o (symbol from plugin)

`_log_table' referenced in section `.text.startup' of C:\Users\Sjoerd\AppData\Local\Temp\cc7ajKGW.ltrans0.ltrans.o: defined in discarded section `.text' of sketch\sketch_may25a.ino.cpp.o (symbol from plugin)

`_log_table' referenced in section `.text.startup' of C:\Users\Sjoerd\AppData\Local\Temp\cc7ajKGW.ltrans0.ltrans.o: defined in discarded section `.text' of sketch\sketch_may25a.ino.cpp.o (symbol from plugin)

collect2.exe: error: ld returned 1 exit status

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

I have installed the library as instructed.
Any help would be appreciated.

I just downloaded and installed the FHT library, from the "Download" link on this page:-
http://wiki.openmusiclabs.com/wiki/ArduinoFHT?action=AttachFile&do=view&target=ArduinoFHT2.zip
then copied the code example that you linked, and it compiles fine for me, using IDE V1.6.9 on Windows 10 Pro 64-bit, with the UNO board selected.
Edit: I just realised that the same code example is provided with the library, so I didn't really need to mess around removing line numbers manually after all. :frowning:

I think that you'd better provide more information regarding your IDE version and operating system, so that someone can give you the right advice.

I am using windows 10 64 bit.
I am using Arduino IDE 1.6.8
I am also using the Arduino UNO.

I am currently installing the most recent version of the IDE to see if that works.

EDIT:
It didn't work, I am getting the exact same error message unfortunately.

sjoerdvdbelt:
I am using windows 10 64 bit.
I am using Arduino IDE 1.6.8

The only difference between your setup and mine is the fact that you're using IDE V1.6.8. There were quite a few problems with that release. Perhaps this is one of them.

Maybe upgrading to V1.6.9 would help. It's very stable, that's why I've kept it rather than upgrading. I can't vouch for the later versions. V1.6.10 was also fairly problematic, and I'm not sure about V1.6.11 because it's too new to be sure.

If you do upgrade to V1.6.9, it's a good idea to delete the "Arduino15" folder after uninstalling V1.6.8.
Before uninstalling, you'll find the path to the folder by clicking on ">File >Preferences", and the path will be shown near the bottom of the window. Record that location to make deleting the folder easier. It's a hidden folder, so you'll temporarily need to change your folder view settings to enable "Hidden items" before it'll be visible.

You could wait and see if someone else comes up with a better answer first, but that's all I can think of, assuming that you've correctly installed the "FHT" library.

Edit: While I was typing, you tried IDE V1.6.11. You might still need to follow my advice above.

First, how did you install the library?
I downloaded and unzipped the library, then copied the "FHT" folder, and pasted it into the "libraries" folder inside my sketchbook folder. I didn't bother with the library's outer folder, which was named "ArduinoFHT2".
Edit: If you do install the whole "ArduinoFHT2" folder in your "libraries" folder you'll get an error stating that "FHT.h" can't be found. (I just tested this.)

I had first reinstalled to IDE 1.6.9 without deleting Arduino15 folder (i forgot to do so) and the error remained.
But when I reinstalled again with deleting the Arduino15 folder the error went away!
Thank you very much for the help.

sjoerdvdbelt:
I had first reinstalled to IDE 1.6.9 without deleting Arduino15 folder (i forgot to do so) and the error remained.
But when I reinstalled again with deleting the Arduino15 folder the error went away!
Thank you very much for the help.

Excellent. I'm pleased to hear that. And glad to have helped.
Now you can finally get on with testing the library. :slight_smile: