0

I'm attempting to write a simple bpm calculation program in C with using the aubio library.

Everything seems to be going smoothly until I attempt to call upon aubio_tempo_do (documentation)

Unfortuantely, make provides me with the error:

‘aubio_tempo_do’ was not declared in this scope

which doesn't seem to make too much sense, considering the aubio library provides this function:

grep -r "aubio_tempo_do" /usr/local/include/aubio/
/usr/local/include/aubio/tempo/tempo.h:void aubio_tempo_do (aubio_tempo_t *o, fvec_t * input, fvec_t * tempo);

I attempt to include the tempo.h file in my header file, but alas the make routine continues to spout out the same error.

// header file
#include <aubio/aubio.h>
#include <aubio/tempo.h>

Any thoughts?

== Edit ===========

It should also be said that I've attempted:

#include <aubio/tempo/tempo.h>

With no luck :\

== Edit ===========

Output of g++ with the -E flag to check preprocesses: http://pastebin.com/mbFEysJ2

Source code can be found here: http://github.com/kellydunn/grover

Relevant source code excerpt: http://pastebin.com/KRmbZqg4

user229044
  • 232,980
  • 40
  • 330
  • 338
kelly.dunn
  • 1,546
  • 3
  • 16
  • 23
  • 1
    You can check the output of the preprocessor by adding the `-E` flag to your GCC command line (e.g. `gcc -E file.c`) and seeing if the necessary declarations are getting included or not. – Adam Rosenfield Jan 28 '11 at 22:26
  • After compiling with the -E flag, I checked the output and confirmed that the aubio_tempo_do method occurs before my code that requires the definition. – kelly.dunn Jan 28 '11 at 22:57
  • @kelly: Can you post a complete example of source code that demonstrates this problem? Can you upload the output of `gcc -E` to pastebin.com? What you've described can only be explained by a compiler bug, which I find to be highly unlikely. – Adam Rosenfield Jan 29 '11 at 00:26
  • sure, I'll make an edit to my original post – kelly.dunn Jan 29 '11 at 00:59
  • @Adam I will try and also cut up the relevant pieces of the source code and paste them into seperate pastebin pages – kelly.dunn Jan 29 '11 at 01:12
  • 1
    @kelly.dunn: Are you writing C or C++? You can't mix the two, they are separate languages. If you're writing C, remove the inclusion of `` and use `` instead; if you're writing C++, change the source filename to `grover.cc`. I suspect this may be related to your problem, although it might be something else. – Adam Rosenfield Jan 29 '11 at 07:23
  • as Adam says, don't compile C code with g++. – Jens Gustedt Jan 29 '11 at 12:40
  • @Adam @Jens Thanks for help! Both of your answers led me in the right direction. Getting the project to compile strictly as C code helped me determine that there was actually a previous installation of the library functions on my machine. it turns out I was calling deprecated methods: functions from `/usr/local/include/aubio` isntead of `/usr/include/aubio` – kelly.dunn Jan 30 '11 at 19:31

2 Answers2

1

As far as I can see you should include another file

#include <aubio/tempo/tempo.h>
Elalfer
  • 5,312
  • 20
  • 25
1

do the arguments you are passing to aubio_tempo_do have the right types?
(aubio_tempo_t *o, fvec_t * input, fvec_t * tempo) I can't tell from the sample code.

If not, the compiler could be complaining that it doesn't see an overloaded version of the function with a signature that matches your arguments... (Although I would think there would be a more descriptive error message for that situation).

AShelly
  • 34,686
  • 15
  • 91
  • 152
  • I thought this might have been the case, but after double checking my variable types, they do match the ones defined in (or more precisely – kelly.dunn Jan 29 '11 at 03:07
  • Ultimately, your answer was the closest. aubio_tempo_do was actually deprecated in terms of the libraries available from apt-get. turns out this method was compiled and installed from source by another package. – kelly.dunn Jan 30 '11 at 19:33