473,473 Members | 1,846 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Undefined reference to 'pow()' using <math.h>

21 New Member
Hi all
I m using the gcc compiler, and when i tried to use pow() function it gives error like this,

undefined reference to `pow'.........................

Then i used -lm option in right place again it gives the same error......

Plz Give me a soln........

Thanks allll.....................
Nov 1 '07 #1
7 15039
vijaya10
1 New Member
i have a doubt in ur question ,r u using -lm command after cc or gcc command ,while compilation ,if it is so ur code should work perfectly.try it out
Nov 1 '07 #2
sicarie
4,677 Recognized Expert Moderator Specialist
Well, let's see your code.

PS - 'leet speak, SMS abbreviations, etc... are not allowed on this site, please use full English words and grammar as best you can. Thanks!
Nov 1 '07 #3
ktg024
21 New Member
I used the command like this

msp430-gcc -lm -mmcu=msp430x149 -o2 -wall -g file.c -o file.elf

this doesn't work so please give me another way to work it out...........
Nov 3 '07 #4
Laharl
849 Recognized Expert Contributor
Can you post the code where you call pow()?
Nov 3 '07 #5
ktg024
21 New Member
Can you post the code where you call pow()?
int main(void){
float a,b,c;
c=pow(10,2);
}
Nov 5 '07 #6
sicarie
4,677 Recognized Expert Moderator Specialist
Interesting. That works for me using G++. The only things I can think of are either that you haven't properly included math.h, or that you're using warning levels high enough to get mad at you that you're putting in two ints and returning a float.
Nov 5 '07 #7
the filename for math.h is renamed to cmath in linux..
Why dont you try using
#include <cmath> ?
Oct 7 '10 #8

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: Donald Firesmith | last post by:
I am having trouble having Google Adsense code stored in XSL converted properly into HTML. The <> unfortunately become &lt; and &gt; and then no longer work. XSL code is: <script...
4
by: John B. | last post by:
I'm self teaching myself C on a Linux box but I can't get a simple program to recognize math functions. I start the program with: #include <stdio.h> #include <math.h> but when I...
2
by: ESPNSTI | last post by:
Hi, I'm trying to use a generics dictionary with a key class that implements and needs IComparable<>. However when I attempt to use the dictionary, it doesn't appear to use the IComparable<> to...
14
by: dananrg | last post by:
Been using the ODBC module for Python 2.1 (Win32) and had another question. When I return data from date columns, it's in a strange object form, e.g. <something or other> (don't have the output in...
1
by: mike | last post by:
I've got some code like this: gametype_id = Request.Form("gametype_id") response.write "<br>gametype_id from form>" & gametype_id & "<" response.write "<br>gametype_id from database>" &...
10
by: William Krick | last post by:
I am writing an XSL transform that converts XML data about vehicles into XML data that will fill printed forms. The default form can handle up to 5 vehicles which I handle using subscripts... ...
3
by: ajay2552 | last post by:
Hi, I have a query. All html tags start with < and end with >. Suppose i want to display either '<' or '>' or say some text like '<Company>' in html how do i do it? One method is to use &lt,...
14
by: Michael | last post by:
Since the include function is called from within a PHP script, why does the included file have to identify itself as a PHP again by enclosing its code in <?php... <?> One would assume that the...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
0
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.