LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 04-19-2003, 02:05 PM   #1
ecc6
LQ Newbie
 
Registered: Apr 2003
Posts: 2

Rep: Reputation: 0
math.h and other included header files


I was trying to write a program in c that used the exp() function in math.h. It wasn't working so I investigated and found a crippled version of math.h that didn't have that function (it was in /usr/include). Also other libraries weren't there (stlib.h, etc,). What's up with that? I did a complete install so basically it isn't included in slackware. Does anybody know how I can get those standard libraries (they're documented in any book on c). The lame math.h file was in the glibc package. Why aren't they included?
 
Old 04-19-2003, 02:15 PM   #2
ecc6
LQ Newbie
 
Registered: Apr 2003
Posts: 2

Original Poster
Rep: Reputation: 0
Nevermind, I'm an idiot. I'm somewhat new to C and I was trying to convert a matlab script to c. I found the following after doing some more searching.

You have to link with the math library.
(libm.so, libm.a, aka -lm)

E.g.

cc -o foo foo.c -lm
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
ISC 3.1 DHCP, CHROOT and Included Files carsten.engel Linux - Software 0 10-28-2005 09:45 AM
Including header files and source files for classes Feenix Programming 8 09-28-2005 10:53 AM
(GTK) included files in a program...Where? ooagentbender Programming 2 02-13-2005 02:00 PM
How to compile a C program in Glade which is included the <pcap.h> header file. swaviswa Programming 0 03-21-2004 07:47 AM
c header files in linux in place of header files in windows? harun_acs Programming 1 03-17-2004 02:24 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 05:35 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration