Author Topic: newbie erro  (Read 4178 times)

Vampire

  • Newbie
  • *
  • Posts: 11
    • View Profile
newbie erro
« on: February 07, 2014, 15:10:55 »
I've been looking to recompile BeatRoot, but so as to get a tempo output too. Have a compiling question, it seems to find the make file and the headers and start compiling, but has the following errors:

Vampires-MacBook-Pro:pluginDev vampire$ make

g++ -mmacosx-version-min=10.5 -arch i386 -arch x86_64 -I../../vamp-plugin-sdk -Wall -fPIC   -c -o myVampPlugin.o myVampPlugin.cpp
In file included from myProcessor.h:19,
                 from myVampPlugin.cpp:17:
Peaks.h:22: error: expected constructor, destructor, or type conversion before ‘using’
Peaks.h:36: error: expected ‘,’ or ‘...’ before ‘<’ token
Peaks.h:36: error: ISO C++ forbids declaration of ‘vector’ with no type
Peaks.h:44: error: ISO C++ forbids declaration of ‘vector’ with no type
..loads of this kind of stuff..

the line in question is form Beatroot peaks.h
[line number]
[19]#include <vector>
[20]#include <cmath>
[21]
[22]using std::vector;


is this something to be fixed in the Make file?
why would it have a problem finding vector?

any tips appreciated

cannam

  • Administrator
  • Sr. Member
  • *****
  • Posts: 273
    • View Profile
Re: newbie erro
« Reply #1 on: February 07, 2014, 16:47:45 »
Hi there --

My wild guess is that this is a problem with the selection of compiler SDK (i.e. which set of OS/X platform libraries the compiler tries to build for).

Try getting the compiler to switch back to its default settings (to compile for the current platform only) by removing the "-mmacosx-version-min=10.5 -arch i386 -arch x86_64" flags from the Makefile you're using, and see if that helps.


Chris

Vampire

  • Newbie
  • *
  • Posts: 11
    • View Profile
Re: newbie erro
« Reply #2 on: February 08, 2014, 01:32:32 »
I think it might be the way I'm linking the files.

If I wanted to add the simplest class, at the moment I've gone back to Skeleton example and am adding a class that does almost nothing, just has a single int value. How can I extend the Makefile to include that okay?

I would expect, for the new class called simpleClass.h, we'd write something like

simpleClass.o: simpleClass.cpp simpleClass.h

and add that to make file?

maybe now the skeleton plugin depends on that?

I'm not familiar with writing make so anyone who has experience here, would much appreciate it!

cannam

  • Administrator
  • Sr. Member
  • *****
  • Posts: 273
    • View Profile
Re: newbie erro
« Reply #3 on: February 10, 2014, 21:35:51 »
(The error you quoted is actually from the compile stage, not the linking stage. Did you try what I suggested, and if so, what happened?)

In answer to your most recent question, "make" is a declarative language -- instead of telling it what to do, you tell it what your targets depend on and (in theory) it works out what to do to build them. So if you write

simpleClass.o: simpleClass.cpp simpleClass.h

you are telling make that the .o file depends on the .cpp file and the .h file. That's great -- it's what you want -- but it's only a dependency, not an instruction. You also need to give make a hint that it actually needs to produce the .o file.

To do this, you'd normally add the .o file as a dependency of something somewhere else, such as the library file. There is often a variable that contains a list of the object files that need to be linked together to put together the library, and you'll want to add you new .o file to that.


Chris