470,630 Members | 2,115 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 470,630 developers. It's quick & easy.

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

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

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

Whitney Kew
Software Engineer
Rain Bird Corporation
Nov 17 '05 #1
1 33292
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
HANDLE hMod,DWORD call_reason,LPVOID lpReserved)
{ double val;
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.

Similar topics

1 post views Thread by aerobar2 | last post: by
reply views Thread by RDI | last post: by
18 posts views Thread by woessner | last post: by
4 posts views Thread by John Friedland | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.