To create a midi-player I use an example found on the Internet. When building, I get a bunch of error alerts like “is not a member of” and “has no member” because the third-party code employs a lib from GitHub. I’m a newbie to Juce. So how should I correctly connect a third-party library?
Please re-format your post so that your code snippet becomes more readable. Put a line of ``` above and below your code and everything in between will become nicely readable.
Then without reformatting, I spot the line: double TPQN = static_cast(mFile.getTimeFormat());. That won’t compile – you need to specify to what type you want to cast your argument. E.g. like
double d = 2.0;
int i = static_cast<int> (d); //--> this casts the double above into an int
float f = static_cast<float> (d); // --> this casts the double above into a float
Not sure if this was a copy&paste error (we all do them) or if you should start with some c++ basics before trying to link to 3rd party code?
Thank you for reformatting – looks a lot more readable now
By scanning over the code snippets you supplied I don’t spot any obvious call to none-juce functionality from a third party lib . Could you give a pointer on which exact library do you need to add to your project? There is no one-fits-all answer on how to handle libraries correctly, it depends a lot of how the library is designed.
Error C2039 pointerParameter: is not a member of “juce::Message”
Error C2039 isValidMessageListener: is not a member of “juce::MessageListener”
E0135 class “juce::MessageListener” has no member “isValidMessageListener”
E0135 class “juce::Message” has no member “pointerParameter”
TBH if that project has no readme file, where it explains how it is intended to be used, I wouldn’t waste my time with it.
It would also help the community to help, if you told which project you are talking about (link?)
The term library is quite generic, and the method how to add it to your project vary, like PluginPenguin pointed out. There are:
static libraries
dynamic libraries
header only libraries
some refer to 3rd-party juce modules as libraries
Again, telling which library you try to add would help people helping…
juce::MessageListener::isValidMessageListener was removed in commit e905f52 (around JUCE 2.0.0), in March 2012. If that third-party code was not updated in 8 years, you won’t have a good time using it.