Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to run the examples in MacOS XCode #58

Closed
KonstantinosTro opened this issue Feb 12, 2014 · 3 comments
Closed

How to run the examples in MacOS XCode #58

KonstantinosTro opened this issue Feb 12, 2014 · 3 comments

Comments

@KonstantinosTro
Copy link

Hello,

I am interested in using essentia library in MacOS XCode. I have succesfully installed the library. I am trying to compile the examples in the src/examples directory.

  • I include Essentia's headers properly (from /usr/local/include/essentia)
  • I link against libessentia.a

But I run into some errors. Below are the error and some screen shot which shows the settings of the projects.
Any help would be appreciated

Thanks,
Costas

Undefined symbols for architecture x86_64:
"essentia::nameOfType(std::type_info const&)", referenced from:
essentia::TypeProxy::checkType(std::type_info const&, std::type_info const&) const in main.o
"essentia::ParameterMap::add(std::string const&, essentia::Parameter const&)", referenced from:
essentia::EssentiaFactoryessentia::standard::Algorithm::create_i(std::string const&, std::string const&, essentia::Parameter const&) const in main.o
essentia::EssentiaFactoryessentia::standard::Algorithm::create_i(std::string const&, std::string const&, essentia::Parameter const&, std::string const&, essentia::Parameter const&) const in main.o
"essentia::loggerInstance", referenced from:
essentia::EssentiaFactoryessentia::standard::Algorithm::create_i(std::string const&) const in main.o
essentia::EssentiaFactoryessentia::standard::Algorithm::create_i(std::string const&, std::string const&, essentia::Parameter const&) const in main.o
essentia::EssentiaFactoryessentia::standard::Algorithm::create_i(std::string const&, std::string const&, essentia::Parameter const&, std::string const&, essentia::Parameter const&) const in main.o
"essentia::EssentiaFactoryessentia::standard::Algorithm::_instance", referenced from:
essentia::EssentiaFactoryessentia::standard::Algorithm::instance() in main.o
"essentia::debugIndentLevel", referenced from:
essentia::EssentiaFactoryessentia::standard::Algorithm::create_i(std::string const&) const in main.o
essentia::EssentiaFactoryessentia::standard::Algorithm::create_i(std::string const&, std::string const&, essentia::Parameter const&) const in main.o
essentia::EssentiaFactoryessentia::standard::Algorithm::create_i(std::string const&, std::string const&, essentia::Parameter const&, std::string const&, essentia::Parameter const&) const in main.o
"essentia::activatedDebugLevels", referenced from:
essentia::EssentiaFactoryessentia::standard::Algorithm::create_i(std::string const&) const in main.o
essentia::EssentiaFactoryessentia::standard::Algorithm::create_i(std::string const&, std::string const&, essentia::Parameter const&) const in main.o
essentia::EssentiaFactoryessentia::standard::Algorithm::create_i(std::string const&, std::string const&, essentia::Parameter const&, std::string const&, essentia::Parameter const&) const in main.o
"essentia::Pool::add(std::string const&, std::vector<float, std::allocator > const&, bool)", referenced from:
_main in main.o
"essentia::init()", referenced from:
_main in main.o
"essentia::Logger::debug(essentia::DebuggingModule, std::string const&, bool)", referenced from:
essentia::EssentiaFactoryessentia::standard::Algorithm::create_i(std::string const&) const in main.o
essentia::EssentiaFactoryessentia::standard::Algorithm::create_i(std::string const&, std::string const&, essentia::Parameter const&) const in main.o
essentia::EssentiaFactoryessentia::standard::Algorithm::create_i(std::string const&, std::string const&, essentia::Parameter const&, std::string const&, essentia::Parameter const&) const in main.o
"essentia::shutdown()", referenced from:
_main in main.o
"essentia::standard::Algorithm::processingMode", referenced from:
essentia::EssentiaFactoryessentia::standard::Algorithm::create_i(std::string const&) const in main.o
essentia::EssentiaFactoryessentia::standard::Algorithm::create_i(std::string const&, std::string const&, essentia::Parameter const&) const in main.o
essentia::EssentiaFactoryessentia::standard::Algorithm::create_i(std::string const&, std::string const&, essentia::Parameter const&, std::string const&, essentia::Parameter const&) const in main.o
"essentia::standard::Algorithm::input(std::string const&)", referenced from:
_main in main.o
"essentia::standard::Algorithm::output(std::string const&)", referenced from:
_main in main.o
"essentia::Parameter::~Parameter()", referenced from:
_main in main.o
std::pair<std::string const, essentia::Parameter>::~pair() in main.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

screen shot 2014-02-12 at 5 25 13 pm

@jmt508
Copy link

jmt508 commented Mar 25, 2014

Hey Costas,
I was actually having similar issues up until last night. Here's how I got Essentia to compile with my app. I'm using XCode 5.0.2 on OSX 10.9.1 for reference.

  1. Build Essentia as recommended on the documentation. I'm using the normal install locations and homebrew, so libessentia.a and its dependencies are located in /usr/local/lib. The dependencies themselves are symbolically linked from /usr/local/Cellar. The include files for Essentia are located in /usr/local/include/essentia
  2. In the project settings in XCode, under Build Settings, add /usr/local/lib to the Library Search Paths option and set its search mode to recursive. I'm not sure that this step was completely necessary, but for some reason XCode wasn't looking there by default on my machine.
  3. Drag the folder /usr/local/include/essentia into your XCode project and choose the option to copy the folder if needed. This means that the includes in your code should be #include "essentia/essentia.h" and whatever other files are needed for your particular application. Mine, for instance, uses the algorithmfactory.h file, as do a few of the examples.
  4. Again under the Build Settings tab of your project settings, add -lessentia -lfftw -lyaml -lavcodec -lavformat -lavutil -lsamplerate -ltag -lswresample -lfftw3f to the Other Linker Flags options. One of those may have actually been for my own project, but I think that's all of them.
  5. Finally, under the Apple LLVM 5.0 - Language - C++ settings on the Build Settings page, change the C++ Language Dialect to C++11 and the C++ Standard Library to libc++. I was getting wacky errors because of the version of the C++ standard library that was being used by default.

Keep in mind that I was using an XCode template for a particular SDK, so your millage may vary in terms of the settings that you end up having to change. In any case, I hope that this can be of some help to you.

  • John

@dbogdanov
Copy link
Member

Thanks for your comment, I have added a link to it to FAQ: https://github.com/MTG/essentia/blob/master/FAQ.md

@jumeca
Copy link

jumeca commented Nov 19, 2023

I have installed essentia with homebrew but it is not making a static build so in the lib folder I don't have libessentia.a

Could you please guide me on how to install essentia and get a static library so I can follow these steps? Thank you

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants