Menu

install itpp over eclipse

2013-07-25
2013-07-31
  • marco govoni

    marco govoni - 2013-07-25

    Hi,

    I'm very new in ubuntu, eclipse and itpp world.
    I'm trying to install itpp and debugs the cpp file in eclipse.

    In wikipedia there are two command line:
    sudo apt-get install libitpp-dev
    g++ itpp-config --cflags example.cc itpp-config --libs
    and everything works.

    But in eclipse there are many errors like:
    "/home/marco/workspace/example0/Debug/../src/example0.cpp:21: riferimento non definito a "itpp::linspace(double, double, int)""

    Debug doesn't work!!

    I tried also to use:
    % mkdir build
    % cd build
    % cmake ..
    % make
    % make install
    but also in this way i don't understand in which way I can link the library.

    Please help me!!!

     
  • Bogdan Cristea

    Bogdan Cristea - 2013-07-25

    There are two different questions in your message:

    • how to compile and run a program with Eclipse: I haven't used Eclipse recently, but you could use a project with Makefiles and then use itpp-config flags to compile a debug version. You need to use the debug flags. Then open the binary in eclipse and debug as usually

    • how to install IT++ from Eclipse: use cmake generator for Eclipse CDT, so the third step should be:
      cmake .. -G "Eclipse CDT4 - Unix Makefiles"

    The above described procedure can be used to compile and install IT++ from command line, once IT++ installed you could use Eclipse to compile your program using Makefiles for example

     
  • marco govoni

    marco govoni - 2013-07-30

    Sorry is several day that try to create a make file in eclipse.

    Can give me more detail about how to create the progect?

    I hace the main.cpp, bbb.h and comm.h (the file .h included in main).

    Sorry for the stupid question

     
  • Bogdan Cristea

    Bogdan Cristea - 2013-07-31

    Here is a possible way of compiling your code with IT++ from Eclipse:
    - create a 'Makefile Project with Existing Code'
    - select the folder where the sources reside
    - goto Project->Make Target->Create ...
    - use as 'Target Name' the name of your file without the '.cpp' prefix
    - in the left pannel switch the view to 'Make Target'. The previous target name should appear here
    - double click the target name. Your file should compile if in the source folder there is a Makefile with the following content:

    CXX           = g++
    
    % : %.cpp
        $(CXX) `itpp-config --cflags` $< `itpp-config --libs` -o $@
    
    %_d : %.cpp
        $(CXX) `itpp-config --debug --cflags` $< `itpp-config --debug --libs` -o $@
    

    If you need to compile your file in debug mode use as target name 'fileName_d'

    This is one possible approach, another one is to use cmake and to generate directly Eclipse project files.

     

    Last edit: Bogdan Cristea 2013-07-31

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.