Hi again,
because it seems like noone else on earth has this problem (I googled for some time already), I'll just post. Please forgive me if thats just too easy and the nerd over there just doesn't get it.
So how can I update my runtime in MSVC++ to handle float's?
When I just use them like float abc = 1.0f; it gives me the error:
Error 3 error LNK2001: unresolved external symbol __fltused Main.obj
(Try searching for this in google. You will only get a few 1000 posts about how some guy lost his windows runtime support. It made me crazy!)
floating point in msvc++
- piranha
- Member
- Posts: 1391
- Joined: Thu Dec 21, 2006 7:42 pm
- Location: Unknown. Momentum is pretty certain, however.
- Contact:
You went at great lengths to not get told to STFW, so I'm gonna tell you this:
You shouldn't say (more then once, or as something funny) that you can't find something on the web. If someone actually searches and doesn't find something then you're ok.
-JL
You shouldn't say (more then once, or as something funny) that you can't find something on the web. If someone actually searches and doesn't find something then you're ok.
-JL
SeaOS: Adding VT-x, networking, and ARM support
dbittman on IRC, @danielbittman on twitter
https://dbittman.github.io
dbittman on IRC, @danielbittman on twitter
https://dbittman.github.io
-
- Member
- Posts: 2566
- Joined: Sun Jan 14, 2007 9:15 pm
- Libera.chat IRC: miselin
- Location: Sydney, Australia (I come from a land down under!)
- Contact:
First entry on a Google search for "__fltused": http://www.codeguru.com/forum/showthread.php?t=346998.
Try reading the thread instead of the first post .
Try reading the thread instead of the first post .
I am sorry for getting too emotional in the first post. I do feel guilty about beeing the one who posts things like "how do I get floating points to work?" or "what's all this mov in my assembler code?". Maybe next time I'll post something I already know, just to look somewhat more professional.You went at great lengths to not get told to STFW, so I'm gonna tell you this:
You shouldn't say (more then once, or as something funny) that you can't find something on the web. If someone actually searches and doesn't find something then you're ok.
I have actually gone through this one before, but I returned after I saw this line:pcmattman wrote:First entry on a Google search for "__fltused": http://www.codeguru.com/forum/showthread.php?t=346998.
This quote stands in conflict with the line I readed at BrokenThorns tutorial about setting up MSVC++:That happens if you compile either managed applications along with unmanaged libraries or if you disable the normal Visual C Runtime Library (CRT)...
Right click your project in the Project Explorer > Settings > Linker > Input >
Ignore Default Libs: No
But anyway, I guess I'll try to turn /NODEFAULTLIB off. Maybe these default libraries are build-in libs which would be useable for my OS. Although I can't imagine that these libs, which 99% of the PE files use, are build in into all of them. They sound more like beeing implemented at runtime like kernel.dll or gdi32.dll.Required Setting: Set Ignore all Default Settings to Yes (/NODEFAULTLIB).
Remember that we have no runtime library.
However, the second link directs you to this exchange:wndproc wrote:I have actually gone through this one before, but I returned after I saw this line:
So perhaps you could define a variable called __fltused and set it to 0, and see what happens. Oh wait, this thread seems to imply it should be 1. Well, test them with both and see what happens.Diomedis wrote:It is used by the Microsoft languages to indicate that a floating pointmarlene wrote:In Interactive Systems 386/ix 2.0.2 there is a symbol used in many of the
routines in the C libraries called "__fltused". It is not in 386/ix 1.0.6.
When using the 'nm' command I see it being an external symbol of value 0
everywhere, but I never see where it is really defined. Can anybody tell me
its type and what it's used for?
library needs to be loaded. The symbol is declared as extern in all
code that uses floating point and is defined in the floating point
library. In this way it forces the library to be loaded when needed.
This is needed because of the way a comprocessor is emulated. A
program may be using floating point without having any external symbols
defined in a floating point library.
You could try, but it won't work. Many of these libraries will call Windows API calls, so unless you are planning on recreating ReactOS, you have to use the /NODEFAULTLIB switch.But anyway, I guess I'll try to turn /NODEFAULTLIB off.
JAL
Thanks for those links. I got some code using floats running now without default libs and with
I am really suprised seeing this threat on gamedev.
I guess I'll have to increase my googling skills
Code: Select all
extern "C" int _fltused = 1;
I guess I'll have to increase my googling skills