about undefined reference for 'sinf'

This is a discussion on about undefined reference for 'sinf' within the C Programming forums, part of the General Programming Boards category; I m writting code in c using another library(parapin) and making Makefile .but there is a error like undefined reference ...

  1. #1
    Registered User
    Join Date
    May 2006
    Posts
    1

    about undefined reference for 'sinf'

    I m writting code in c using another library(parapin) and making Makefile .but there is a error like
    undefined reference to `sinf'
    undefined reference to `ceilf'
    although i have added math.h library in my code
    . I tried to run simple programme using math.h
    and it run.but in making Makefile it is giving me error

  2. #2
    ... kermit's Avatar
    Join Date
    Jan 2003
    Posts
    1,528
    Are you linking the math library?

    Code:
    all: foo
    
    CC = gcc
    
    CFLAGS = -Wall
    
    foo: foo.o
    	$(CC) -o foo foo.o -lm
    foo.o: foo.c
    	$(CC) $(CFLAGS) -c foo.c
    Last edited by kermit; 05-12-2006 at 07:53 PM.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Getting an error with OpenGL: collect2: ld returned 1 exit status
    By Lorgon Jortle in forum C++ Programming
    Replies: 6
    Last Post: 05-08-2009, 09:18 PM
  2. Undefined Reference Compiling Error
    By AlakaAlaki in forum C++ Programming
    Replies: 1
    Last Post: 06-27-2008, 12:45 PM
  3. Screwy Linker Error - VC2005
    By Tonto in forum C++ Programming
    Replies: 5
    Last Post: 06-19-2007, 03:39 PM
  4. C OpenGL Compiler Error?
    By Matt3000 in forum C Programming
    Replies: 12
    Last Post: 07-07-2006, 05:42 PM
  5. c++ linking problem for x11
    By kron in forum Linux Programming
    Replies: 1
    Last Post: 11-19-2004, 10:18 AM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21