Results 1 to 2 of 2

Thread: eclipse c++ add a lib ? how do I ?

  1. #1
    Join Date
    Dec 2010
    Location
    Earth
    Beans
    151
    Distro
    Ubuntu 14.04 Trusty Tahr

    eclipse c++ add a lib ? how do I ?

    how do add libs to the complier for eclipse?
    and what is process correctly called because I have NO luck searching it.

    if I was using the command line it would just be adding -lncurese
    Code:
    g++ GAME.cpp -o game -lncurses
    Eclipses
    Code:
    **** Build of configuration Debug for project GAME ****
    make all 
    Building target: GAME
    Invoking: GCC C++ Linker
    g++  -o"GAME"  ./src/GAME.o   
    ./src/GAME.o: In function `main':
    /home/keegan/cpp/GAME/Debug/../src/GAME.cpp:17: undefined reference to `initscr'
    /home/keegan/cpp/GAME/Debug/../src/GAME.cpp:18: undefined reference to `printw'
    /home/keegan/cpp/GAME/Debug/../src/GAME.cpp:19: undefined reference to `refresh'
    /home/keegan/cpp/GAME/Debug/../src/GAME.cpp:20: undefined reference to `stdscr'
    /home/keegan/cpp/GAME/Debug/../src/GAME.cpp:20: undefined reference to `wgetch'
    /home/keegan/cpp/GAME/Debug/../src/GAME.cpp:21: undefined reference to `endwin'
    collect2: ld returned 1 exit status
    make: *** [GAME] Error 1
    In a perfect world my college professors would allow assignment as .odt openoffice.org files! And code as Eclipse projects.

  2. #2
    Join Date
    Dec 2010
    Location
    Earth
    Beans
    151
    Distro
    Ubuntu 14.04 Trusty Tahr

    Re: eclipse c++ add a lib ? how do I ?

    found it finally

    right click the project file -> select properties
    settings->GCC C++ Linker->libraries->add new
    ncurses

    which is now the same as -lncures
    i guess the -l stands for library
    In a perfect world my college professors would allow assignment as .odt openoffice.org files! And code as Eclipse projects.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •