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
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
ps: There are many threads about this issue in the programming section, try to look for them before posting.
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
You should install gcc first. It is in your repositories:
# urpmi gcc
how exactly to do this urpmi ? can u help me with more detailed information
urpmi is a command line package manager of Mandriva. Check here.
Try Easy Urpmi too.