By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
426,179 Members | 2,192 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 426,179 IT Pros & Developers. It's quick & easy.

R6002 "floating point not loaded" in Managed C++ DLL that links with LIBCMTD.LIB

P: n/a
Hello everyone,

I'm developing a mixed-mode Managed C++ DLL using .NET 2003, and to
avoid the potential mixed-DLL-loading-deadlock issue discussed in MS
KB article 814472 (http://support.microsoft.com/?id=814472), I've
followed the steps in that article appropriately. However, our
application will have to support multiple versions of the Win OS, and
we don't want to run into possible DLL Hell problems with the C
Runtime DLLs. So, it's been decided that we need to link with the
static version of the CRT, LIBCMT(D).LIB, instead of MSVCRT(D).LIB.

Unfortunately, now that we're linking with LIBCMTD.LIB, I'm now
getting a Runtime Error, R6002, "floating point not loaded" when I try
to insert a float into a std::ostringstream inside my managed code.
My code is the following:

float fp = 1.23f;
std::ostringstream os;
os << fp; // CRASH here

Stepping into the std::ostringstream innards, the crash occurs at a
::sprintf() call inside the system file "xlocnum" inside a method
called num_put<>::do_put(). I've done some searching around and tried
playing with a _fltused variable, _fpreset(), _fpmath(), all to no
avail.

Could someone help me out with this? Thanks very much in advance!!

Whitney Kew
Software Engineer
Rain Bird Corporation
http://www.rainbird.com
Nov 17 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
I had a similar problem with a MS C++ (Ver 6) Win32 DLL which handles printout.
I realised that nowhere in the DLL is any floating point arith carried out, its all string handling but does use vsprintf
I forced it by making the dll entry point use floating point
eg:
BOOL APIENTRY DllMain(
HANDLE hMod,DWORD call_reason,LPVOID lpReserved)
{ double val;
val=17.5;
return TRUE;
}
Hope this helps
Roger Welby
---
Posted using Wimdows.net NntpNews Component -

Post Made from http://www.DotNetJunkies.com/newsgroups Our newsgroup engine supports Post Alerts, Ratings, and Searching.
Nov 17 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.