Srodne teme
Navigacija
Lista poslednjih: 16, 32, 64, 128 poruka.

Undefined reference to...

[es] :: C/C++ programiranje :: Undefined reference to...

[ Pregleda: 1473 | Odgovora: 2 ] > FB > Twit

Postavi temu Odgovori

Autor

Pretraga teme: Traži
Markiranje Štampanje RSS

4co_R

Član broj: 268314
Poruke: 74
*.mbb.telenor.rs.



+2 Profil

icon Undefined reference to...16.05.2012. u 03:53 - pre 144 meseci
Code:

#include <panel.h>

int main()
{    WINDOW *my_wins[3];
    PANEL  *my_panels[3];
    int lines = 10, cols = 40, y = 2, x = 4, i;

    initscr();
    cbreak();
    noecho();

    /* Create windows for the panels */
    my_wins[0] = newwin(lines, cols, y, x);
    my_wins[1] = newwin(lines, cols, y + 1, x + 5);
    my_wins[2] = newwin(lines, cols, y + 2, x + 10);

    /*
     * Create borders around the windows so that you can see the effect
     * of panels
     */
    for(i = 0; i < 3; ++i)
        box(my_wins[i], 0, 0);

    /* Attach a panel to each window */     /* Order is bottom up */
    my_panels[0] = new_panel(my_wins[0]);     /* Push 0, order: stdscr-0 */
    my_panels[1] = new_panel(my_wins[1]);     /* Push 1, order: stdscr-0-1 */
    my_panels[2] = new_panel(my_wins[2]);     /* Push 2, order: stdscr-0-1-2 */

    /* Update the stacking order. 2nd panel will be on top */
    update_panels();

    /* Show it on the screen */
    doupdate();

    getch();
    endwin();
}


Build messages:

undefined reference ro 'new_panel'
undefined reference to 'update_panels'


Sta ne valja?Koristim codeblocks i ubuntu.
 
Odgovor na temu

milanche
San Francisco

Član broj: 2447
Poruke: 1200
*.hsd1.ca.comcast.net.



+1001 Profil

icon Re: Undefined reference to...16.05.2012. u 04:40 - pre 144 meseci
Greska je nastala tokom linkovanja - u listi biblioteka sa kojom se linkuje tvoj
program nedostaje biblioteka koja sadrzi navedene simbole ('new panel' i 'update
panels').

Biblioteka koja nedostaje po svemu sudeci dolazi u istom paketu u kojem se nalazi
header fajl panel.h (koji vidim da si #include-ovao, i pritom vrlo verovatno dobro
podesio include path). Dakle - ostaje da slicnu stvar uradis i sa bibliotekom (.a ili
.so fajl iz istog tog paketa) - treba da je navedes na listi biblioteka sa kojima se linkujes,
a moguce je da ces morati i tu da specificiras path.

edit:
Malo konkretnije - prosvrljao sam na brzinu po web-u, (http://linux.die.net/man/3/replace_panel)
izgleda da je u pitanju staticka biblioteka libpanel.a.
 
Odgovor na temu

4co_R

Član broj: 268314
Poruke: 74
*.mbb.telenor.rs.



+2 Profil

icon Re: Undefined reference to...16.05.2012. u 15:47 - pre 144 meseci
Resen problem,nisam bio dobro podesio linker.
 
Odgovor na temu

[es] :: C/C++ programiranje :: Undefined reference to...

[ Pregleda: 1473 | Odgovora: 2 ] > FB > Twit

Postavi temu Odgovori

Navigacija
Lista poslednjih: 16, 32, 64, 128 poruka.