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.
- 03-02-2008 #1Just 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
- 03-02-2008 #2
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.
- 03-29-2008 #3Just 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
- 03-29-2008 #4
You should install gcc first. It is in your repositories:
# urpmi gccIf you need a CD/DVD catalogizer, give a try to my program:
http://www.kde-apps.org/content/show...content=100682
Linux Usert#430188
- 04-02-2008 #5Just Joined!
- Join Date
- Aug 2006
- Location
- india
- Posts
- 57
how exactly to do this urpmi ? can u help me with more detailed information
- 04-02-2008 #6
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


Reply With Quote
