LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 04-14-2011, 11:46 AM   #1
micropanther
LQ Newbie
 
Registered: Oct 2007
Location: Charlotte, NC
Distribution: Ubuntu 10.04, Davinci (MacOS/X)
Posts: 20

Rep: Reputation: 0
How do I make g++ compile in floating point support even though I don't use it?


One of those odd things I learned the hard way is that if you are writing a shared object (library/.so) and any programs that will link to that library uses floating point numbers, the library must be compiled as if it uses floating point numbers.

What that really means is, you need to declare at least one float in the source for the library or when the caller connects and tries to run code in the library, the process aborts. So, I end up putting a float pi (3.1415); in the code and getting an unused variable warning all the time.

There has to be a simpler way, some flag to pass to g++ that says, "include floating point support even if you don't really need to." Anyone know how to do this?

Wes

p.s. Gosh I hope I remembered this correctly. I encountered this problem doing a multi-platform build for Windows and Linux. This COULD be a VC++ problem that I just carried into Linux by using the same source.
 
Old 04-14-2011, 11:23 PM   #2
lupusarcanus
Senior Member
 
Registered: Mar 2009
Location: USA
Distribution: Arch
Posts: 1,022
Blog Entries: 19

Rep: Reputation: 146Reputation: 146
What command are you using to compile?

Check out here. Maybe use 'Control + F' and look for 'float'.
 
  


Reply

Tags
g++



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
Floating point exception cccc Debian 0 11-28-2008 12:32 PM
Distro for a platform without floating point support estratos Debian 3 01-31-2008 11:24 AM
Floating point exception hemk76 Linux - Software 1 05-06-2005 11:49 PM
floating point multiplication irfanhab Programming 0 12-23-2004 10:13 PM
managing floating point vince_2x Linux - General 2 09-21-2004 09:05 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 12:55 AM.

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