LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 02-08-2005, 12:00 AM   #1
shinni
LQ Newbie
 
Registered: Jan 2005
Posts: 5

Rep: Reputation: 0
Problem while compiling


Hi all ,

I was trying to run one distribution, but came across some compilation problem. I'm using fedora core 2, and g++ (GCC) 3.3.3 20040412 (Red Hat Linux 3.3.3-7) compiler. When tried to "make" the exe files, the followwing error msg was seen. Plz suggest what I should do for the program to call the floor() function defined in math.h ? I tried adding including math.h, but it did not work. I am getting the same error again. Typecasting the arguements to double in the CPP program also did not work. Please give ur suggestions. I'm attaching the archived programs also.

/*
* This is the error mesage obtained from console
*


g++ -O3 -c RBFCFTree.cpp
RBFCFTree.cpp: In member function `void
RBFCFTree::extensionExplore(std::vector<long int, std::allocator<long int>
>&, std:stream&, const std::vector<RFreeTree*, std::allocator<RFreeTree*>
>&, const std::vector<Occurrence, std::allocator<Occurrence> >&, const
std::vector<std::vector<short int, std::allocator<short int> >,
std::allocator<std::vector<short int, std::allocator<short int> > > >&,
const std::vector<long int, std::allocator<long int> >&, const long int&)':
RBFCFTree.cpp:685: error: call of overloaded `floor(long int)' is ambiguous
/usr/include/bits/mathinline.h:499: error: candidates are: double floor(double)
/usr/include/c++/3.3.3/cmath:342: error: long double
std::floor(long double)
/usr/include/c++/3.3.3/cmath:334: error: float
std::floor(float)
make: *** [RBFCFTree.o] Error 1

*
*
*/

Regards

Ssk

( Can i attach the codes ? I cud not find option to attach .. )
 
Old 02-08-2005, 12:13 AM   #2
jtshaw
Senior Member
 
Registered: Nov 2000
Location: Seattle, WA USA
Distribution: Ubuntu @ Home, RHEL @ Work
Posts: 3,892
Blog Entries: 1

Rep: Reputation: 67
add -lm as a switch to the compiler (links the libm which is the math library).

To put up code just copy and paste it into a post. Please do us all a favor and use the <code > insert code here < /code> blocks (without the spaces) so it keeps decent formatting.
 
  


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
Problem compiling javakid Programming 8 12-16-2004 12:03 AM
Problem compiling Kami.JZ Linux - Newbie 6 10-26-2004 06:28 AM
Compiling Problem BACTRATE Mandriva 1 03-12-2004 04:36 AM
Compiling Problem... ThE_DeaD Linux - Newbie 10 12-14-2003 03:14 PM
compiling problem with RH 9 tucdual Linux - Distributions 4 08-26-2003 07:03 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 09:29 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