Find the answer to your Linux question:
Results 1 to 6 of 6
While trying to compile a basic program in gcc i get the following output:- [wolverine@localhost progs]$ gcc fp.c -o fp.exe /home/wolverine/tmp/ccfmWDLd.o: In function `main': fp.c .text+0x12): undefined reference to `cbreak' ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Dec 2007
    Location
    india
    Posts
    47

    gcc


    While trying to compile a basic program in gcc i get the following output:-

    [wolverine@localhost progs]$ gcc fp.c -o fp.exe
    /home/wolverine/tmp/ccfmWDLd.o: In function `main':
    fp.c.text+0x12): undefined reference to `cbreak'
    fp.c.text+0x5e): undefined reference to `sqrt'
    fp.c.text+0x79): undefined reference to `stdscr'
    fp.c.text+0x81): undefined reference to `wgetch'
    collect2: ld returned 1 exit status

    one thing that i observed was that the headers i want are present in /usr/include but are not present in /usr/lib/gcc/i586-mandriva-linux-gnu/4.3/include nor in /usr/lib/gcc/i586-mandriva-linux-gnu/4.2.2/include

    i dont know much about how gcc works....so pls guide me

  2. #2
    Just Joined! Gustav's Avatar
    Join Date
    May 2007
    Posts
    13
    When including some libraries you must link them for compilation. To do so, you need to use this paramater: -lm
    Use this command: gcc fp.c -o -lm fp.exe

    Good Luck
    ps: There are many threads about this issue in the programming section, try to look for them before posting.

  3. #3
    Just Joined!
    Join Date
    Aug 2006
    Location
    india
    Posts
    57
    hi when i try to compile a sample c code in mandriva it says gcc not available .how to use gcc can you please help

  4. $spacer_open
    $spacer_close
  5. #4
    Linux Enthusiast minthaka's Avatar
    Join Date
    May 2006
    Location
    Mol, Vojvodina
    Posts
    557
    You should install gcc first. It is in your repositories:
    # urpmi gcc
    If you need a CD/DVD catalogizer, give a try to my program:
    http://www.kde-apps.org/content/show...content=100682
    Linux Usert#430188

  6. #5
    Just Joined!
    Join Date
    Aug 2006
    Location
    india
    Posts
    57
    how exactly to do this urpmi ? can u help me with more detailed information

  7. #6
    Super Moderator devils casper's Avatar
    Join Date
    Jun 2006
    Location
    Chandigarh, India
    Posts
    24,729
    urpmi is a command line package manager of Mandriva. Check here.
    Try Easy Urpmi too.
    It is amazing what you can accomplish if you do not care who gets the credit.
    New Users: Read This First

Posting Permissions

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