Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project! See Demo

Close

IT++ and Xcode

Help
2008-11-20
2013-07-23
  • Hi,

    A few monthes ago I started using IT++ while writing the majority of my programs in TextMate and that has worked out well. However, I really miss having a full IDE which is where my problems begin. I am not sure where to even start with integrating IT++ into xcode. I am mildly familiar with adding frameworks, unfortunately this didn't resolve the issue. I have googled around and no one really seems to list exactly what I need to do.

    Any help, or suggestions or something would be much appreciated.

    I am running Mac OSX 10.5.4 with Xcode 3.1.

    Thomas

     
    • Ok, so I have tried some more stuff.

      First I tried to add /usr/local/include (Which I assume is the default install location) to the header search path and

      /usr/local/lib to the library search path. I tried to compile a program that has previously been compiled sucessfully outside of xcode. I ended up with these errors.

      itpp::Vec<double>::Vec(itpp::Vec<double> const&)", referenced from:
      normReal(itpp::Vec<double>)in main.o
      "itpp::Mat<double>::Mat(int, int, itpp::Factory const&)", referenced from:
      "itpp::Vec<double>::operator()(int)", referenced from:
      "itpp::eig_sym(itpp::Mat<double> const&, itpp::Vec<double>&, itpp::Mat<double>&)", referenced from:
      "itpp::Vec<double>::Vec(int, itpp::Factory const&)", referenced from:
      "itpp::Mat<double>::rows() const", referenced from:
      "itpp::Mat<double>::operator()(int, int)", referenced from: "itpp::Vec<double>::~Vec()", referenced from: "itpp::Vec<double>::length() const", referenced from:
      "itpp::Vec<double>::length() const", referenced from: "itpp::Mat<double>::~Mat()", referenced from: "std::basic_ostream<char, std::char_traits<char> >& itpp::operator<< <double>(std::basic_ostream<char, std::char_traits<char> >&, itpp::Vec<double> const&)", referenced from:

      I went ahead and removed the method references. What it looked like was #include <itbase.h> isn't valid. I did not add anything to the project its self.

       
    • Atakan Gunal
      Atakan Gunal
      2013-07-23

      Hi,
      I recently tried to get IT++ working with XCode(4.6.2) and I think I have succeeded. I'll share the steps I followed. This is assuming you have IT++ installed successfully, being able to compile and run code from command line but XCode failing to build and link successfully with the same code.

      -Create a command line tool C++ project
      -Click on the project file to go to build settings
      -Select the target
      -Under search paths, add the following:
      Header Search Paths: /usr/local/include
      Library Search Paths: /usr/local/lib (and /opt/local/lib if u used macports to install any of the dependencies)
      -Under linking, add the following:
      Other linker flags: -litpp -lfftw3 -llapack -lblas
      -Select build phases tab next to build settings
      -Under link binary with libraries, add the .dylib libraries for itpp, fftw, lapack, blas
      At this point I tried to run the sample code I got from here: http://forums.macrumors.com/archive/index.php/t-1155849.html

      and got the following error:
      Undefined symbols for architecture x86_64:
      "itpp::Mat<double>::set(std::1::basic_string<char, std::__1::char_traits<char="">, std::1::allocator<char> > const&)", referenced from:
      _main in main.o
      "itpp::Vec<double>::set(std::1::basic_string<char, std::__1::char_traits<char="">, std::1::allocator<char> > const&)", referenced from:
      _main in main.o
      "std::1::basic_ostream<char, std::__1::char_traits<char=""> >& itpp::operator<<<double>(std::1::basic_ostream<char, std::__1::char_traits<char=""> >&, itpp::Mat<double> const&)", referenced from:
      _main in main.o
      "std::1::basic_ostream<char, std::__1::char_traits<char=""> >& itpp::operator<<<double>(std::1::basic_ostream<char, std::__1::char_traits<char=""> >&, itpp::Vec<double> const&)", referenced from:
      _main 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)

      After some digging around I figured it had to do with the standard C++ library that xcode defaults to. I'm not exactly sure but there might be an issue with the overloaded << operator not being resolved etc.

      So I went to build settings again
      -Under Apple LLVM compiler 4.2 - Language, change C++ standart library from
      libc++ (LLVM C++ standar library with C++11 support)
      to
      libstdc++ (GNU C++ standard library)

      And it seems to work now, successfully ran the example code in the link.

      Some of the steps might be redundant like adding the linker flags manually even though the libraries were added in build phases, and I don't claim to understand everything that goes on underneath that caused the errors and now got fixed. But I thought I should share because I've been searching for a solution for 3 days and couldn't find anything on the internet. Hope this helps someone.

      Cheers,

      Atakan

      Edit: I did this on OSX 10.8.2. Building IT++ as a static library with -DITPP_SHARED_LIB=off option and dragging (selecting add to target) the .a file into the XCode project also works.

       
      Last edit: Atakan Gunal 2013-07-30
  • Andy2173
    Andy2173
    2011-05-07

    im in same boat. seems after configuring and making. then when i try to use
    the generated library from within xcode seem to get missing symbols. symbols
    such as

    "std::basic_istream<char, std::char_traits<char=""> >&
    itpp::operator>><itpp::bin>(std::basic_istream<char, std::char_traits<char="">

    &, itpp::Vec<itpp::bin>&)", referenced from:

    it also seems like there is minimal support for Xcode mac users with this
    library.

     
  • Bogdan Cristea
    Bogdan Cristea
    2011-05-08

    Hi

    It seems that the issue is related to the integration of IT++ with xcode, not
    with the library compilation itself. Unfortunately, I don't have a MacOS
    available for some tests, so any contribution is welcome. Why don't you try to
    use eclipse instead ?

    regards

    Bogdan

     
  • Andy2173
    Andy2173
    2011-05-08

    yes, i could try that or just use make from outside xcode. i lost a lot of
    time yesterday trying, and i do not know eclipse very well.

    im not so good at all this hacking / command line tweeking, having been spoilt
    with the ease of installing things for years via double clicking and icon in
    windows. only been a mac user for 1 year now.

    its a pity you can't get in touch with macports team, or even boost c++ and
    integrate it with that. If you can get it on these platforms interest in this
    project will grow im sure ?

     
  • Andy2173
    Andy2173
    2011-05-08

    well now i can build it in xcode. only problem now is when i try to run the
    exe it just says cannot execute binary file.

    when i make the libs i get both the debug and release libs:

    libitpp_debug.7.dylib (7.6MB)

    libitpp_debug.dylib (4KB)

    libitpp_debug.la (4KB)

    i have to make sure i build in xcode for 64bit architecture since this is what
    the libs were built upon. also i make sure in project settings i link to the
    header and libs. also make sure i set the "other linker flags" to :

    -litpp_debug.7

    the program im trying to run is Array class test program.

    well i give in now.