Using IT++ in Visual Studio 2012 project

Help
Ulis
2014-04-08
2014-04-08
  • Ulis

    Ulis - 2014-04-08

    Hi all,
    I am really need ICA implementation and I am happy that I have found that project.
    I am already build ICPP library with Cygwin (results: cygitpp-8.dll, cygitpp-8.dll.a) and netlib's libraries that I am build from ITPP_exports source code.

    1) Now I have problems with linking.
    This is my code

    #include <iostream>
    #include <itpp/base/mat.h>
    #include <itpp/signal/fastica.h>
    
    using namespace std;
    using namespace itpp;
    
    int main(){
        cout<<"Hello IT++\n";
    
    mat sources("0.134 0.424 0.653 0.739 0.932 0.183 0.834;0.314 0.154 0.732 0.932 0.183 0.834 0.134;0.824 0.534 0.314 0.654 0.739 0.932 0.183");
    Fast_ICA fastica(sources);
    fastica.set_nrof_independent_components(sources.rows());
    fastica.set_non_linearity(FICA_NONLIN_TANH);
    fastica.set_approach(FICA_APPROACH_DEFL);
    fastica.separate();
    mat ICs = fastica.get_independent_components();
    
    cout<<ICs;
    
        return 0;
    }
    

    And this is output

    1>main.obj : error LNK2001: unresolved external symbol "declspec(dllimport) const >itpp::Factory::`vftable'" (imp_??7Factory@itpp@@6B@)
    1>main.obj : error LNK2001: unresolved external symbol "declspec(dllimport) public: thiscall >itpp::Mat<double>::~Mat<double>(void)" (imp_??1?$Mat@N@itpp@@QAE@XZ)
    1>main.obj : error LNK2001: unresolved external symbol "
    declspec(dllimport) public: thiscall >itpp::Mat<double>::Mat<double>(class itpp::Mat<double> const &)" (imp
    ??0?$Mat@N@itpp@@QAE@ABV01@@Z)
    1>main.obj : error LNK2001: unresolved external symbol "declspec(dllimport) public: thiscall >itpp::Mat<double>::Mat<double>(char const *,class itpp::Factory const &)" >(imp_??0?$Mat@N@itpp@@QAE@PBDABVFactory@1@@Z)
    1>main.obj : error LNK2001: unresolved external symbol "
    declspec(dllimport) public: class >itpp::Mat<double> thiscall itpp::Fast_ICA::get_independent_components(void)" >(imp_?get_independent_components@Fast_ICA@itpp@@QAE?AV?$Mat@N@2@XZ)

    ect.

    2) I have build and run this code in cygwin.

    $ g++ main.cpp /usr/local/lib/libitpp.dll.a

    output:

    Hello IT++
    [[2.14376 1.24159 -0.717437 0.0177637 1.52973 1.53424 -0.206808]
    [-3.66793 -3.3096 -4.21498 -5.93664 -5.56882 -5.0307 -3.33891]
    [0.786617 1.55295 0.703094 0.966627 3.17445 -0.0197132 2.28339]]

    I know how to ajust settings in MSVS, but I don't know wich files I must to use. I am already tried to link cygitpp-8.dll, cygitpp-8.lib(self made with lib.exe).
    Help me please.

     
  • Bogdan Cristea

    Bogdan Cristea - 2014-04-08

    Hi
    From the title of your post I assume that you need to compile with VS 2012. In this case you need to compile IT++ with VS2012, then make sure that the headers and lib files are found from VS.
    regards
    Bogdan

     
  • Ulis

    Ulis - 2014-04-08

    Thanks for answer, Bogdan.
    I tried.
    My CMAKE cannot find BLAS and LAPACK (lib-files, that I got here http://icl.cs.utk.edu/lapack-for-windows/clapack/index.html)
    So I add params:

    LAPACK_LIBRARIES C:/Program Files (x86)/Microsoft Visual Studio 11.0/VC/lib/lapack.lib
    BLAS_LIBRARIES C:/Program Files (x86)/Microsoft Visual Studio 11.0/VC/lib/blas.lib

    Then VS project was created, but I can not build it.

    What does that mean?

    ...
    Error   74  error LNK2019: unresolved external symbol _s_cmp referenced in function _ilaenv_    C:\Users\Anton\Desktop\itpp-4.3.1\build\itpp\lapack.lib(ilaenv.obj)
    Error   70  error LNK2019: unresolved external symbol _s_cat referenced in function _dgesvd_    C:\Users\Anton\Desktop\itpp-4.3.1\build\itpp\lapack.lib(dgesvd.obj)
    Error   115 error LNK2019: unresolved external symbol _pow_zi referenced in function _zlahqr_   C:\Users\Anton\Desktop\itpp-4.3.1\build\itpp\lapack.lib(zlahqr.obj)
    Error   91  error LNK2019: unresolved external symbol _pow_di referenced in function _dlamc2_   C:\Users\Anton\Desktop\itpp-4.3.1\build\itpp\lapack.lib(dlamch.obj)
    Error   112 error LNK2019: unresolved external symbol _pow_dd referenced in function _dbdsqr_   C:\Users\Anton\Desktop\itpp-4.3.1\build\itpp\lapack.lib(dbdsqr.obj)
    Error   114 error LNK2019: unresolved external symbol _i_nint referenced in function _iparmq_   C:\Users\Anton\Desktop\itpp-4.3.1\build\itpp\lapack.lib(iparmq.obj)
    Error   109 error LNK2019: unresolved external symbol _i_dnnt referenced in function _dlaqps_   C:\Users\Anton\Desktop\itpp-4.3.1\build\itpp\lapack.lib(dlaqps.obj)
    Error   88  error LNK2019: unresolved external symbol _e_wsfe referenced in function _dlamc2_   C:\Users\Anton\Desktop\itpp-4.3.1\build\itpp\lapack.lib(dlamch.obj)
    Error   89  error LNK2019: unresolved external symbol _do_fio referenced in function _dlamc2_   C:\Users\Anton\Desktop\itpp-4.3.1\build\itpp\lapack.lib(dlamch.obj)
    Error   78  error LNK2019: unresolved external symbol _d_sign referenced in function _zlarfg_   C:\Users\Anton\Desktop\itpp-4.3.1\build\itpp\lapack.lib(zlarfg.obj)
    Error   104 error LNK2019: unresolved external symbol _d_lg10 referenced in function _dlabad_   C:\Users\Anton\Desktop\itpp-4.3.1\build\itpp\lapack.lib(dlabad.obj)
    Error   41  error LNK2019: unresolved external symbol _d_imag referenced in function _zlaqr2_   C:\Users\Anton\Desktop\itpp-4.3.1\build\itpp\lapack.lib(zlaqr2.obj)
    Error   7   error LNK2019: unresolved external symbol _d_cnjg referenced in function _ztrsv_    C:\Users\Anton\Desktop\itpp-4.3.1\build\itpp\blas.lib(ztrsv.obj)
    Error   117 error LNK2001: unresolved external symbol _z_sqrt   C:\Users\Anton\Desktop\itpp-4.3.1\build\itpp\lapack.lib(zlaqr0.obj)
    Error   118 error LNK2001: unresolved external symbol _z_sqrt   C:\Users\Anton\Desktop\itpp-4.3.1\build\itpp\lapack.lib(zlaqr4.obj)
    ...
    
     
    Last edit: Ulis 2014-04-08
  • Ulis

    Ulis - 2014-04-08

    I am add libf2c.lib to linker and everything build successful instead of INSTALL project, it is broke with strange error, but itpp.dll /.lib /.obj created. I add it to my project and those code compile and run fine.
    Thanks.

     
  • Bogdan Cristea

    Bogdan Cristea - 2014-04-08

    you need to change install path to a path where you have write access, otherwise you need to run VS with admin privileges

     

Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

JavaScript is required for this form.





No, thanks