Results 1 to 3 of 3

Thread: math.h include error

  1. #1
    Join Date
    Jan 2006
    Location
    Third rock from the sun
    Posts
    106
    Thanks
    17
    Thanked 6 Times in 6 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Question math.h include error

    I am compiling an application using gcc/g++ 3.4. When I #include <math.h> and try to compile, I get the following error:

    client# g++ -o -pipe -g -D_REENTRANT -Wall -I../include -I/usr/local/Trolltech/Qt-4.1.4/include/QtCore -I/usr/X11R6/include Data.o ../src/Data.cpp

    In file from /usr/include/math.h:93
    from ../src/Data.cpp:36
    /usr/include/bits/mathcalls.h:154:error: expected unqualified-id before 'float'
    /usr/include/bits/mathcalls.h:154:error: expected ')' before front

    I am not getting to the link step, but -lm is in the linker step. Is there something wrong with my makefile?

  2. #2
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    6,264
    Thanks
    36
    Thanked 1,519 Times in 1,389 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows Symbian S60 Maemo/MeeGo

    Default Re: math.h include error

    Try

    Qt Code:
    1. #include <cmath>
    To copy to clipboard, switch view to plain text mode 

    or

    Qt Code:
    1. extern "C" {
    2. #include <math.h>
    3. }
    To copy to clipboard, switch view to plain text mode 
    J-P Nurmi

  3. #3
    Join Date
    Jan 2006
    Location
    Third rock from the sun
    Posts
    106
    Thanks
    17
    Thanked 6 Times in 6 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Talking Re: math.h include error

    That worked, Thanks!

Similar Threads

  1. Problems
    By euthymos in forum Installation and Deployment
    Replies: 2
    Last Post: 13th June 2006, 19:11
  2. Fed up with M$ Window$ !!! Why is Tux leaving me alone???
    By fullmetalcoder in forum General Discussion
    Replies: 35
    Last Post: 18th March 2006, 12:57
  3. Problems with Q_OBJECT and subclassing
    By renaissanz in forum Qt Programming
    Replies: 4
    Last Post: 21st February 2006, 22:18
  4. Am I the only one with "make" error ?
    By probine in forum Installation and Deployment
    Replies: 1
    Last Post: 13th February 2006, 12:54
  5. qmake_image_collection.cpp gives me a compiling error
    By vfernandez in forum Qt Programming
    Replies: 2
    Last Post: 31st January 2006, 01:42

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.