Building with Borland Turbo C++
Posted: Sun Apr 01, 2007 11:46 pm
Finally, I succeeded building Irrlicht.dll (latest 1.3 version) with Borland Turbo 2006.
I logged everything I did and will soon compile a step-by-step guide (see post below) for anyone interested.
All examples except number 15 (LoadIrrFile) worked at first build after adding these lines in main() and #included <float.h> (credits to etcaptor for this):
#if defined(__BORLANDC__) || defined(__BCPLUSPLUS__)
_control87(MCW_EM,MCW_EM);//float.h
#endif
The problem was never in irrString.h, but in CCSMLoader.cpp in the function void Surface::clear() and on this row:
textureName = 0;
I changed it to this:
textureName = "";
Voila! The problem is solved. All examples works as expected.
The 'compiler bug' seems to be that the compiler doesn't know how to treat a zero as parameter in the template function.
According to Stroustrup (section 5.1.1) a zero (0) is an int.
Now, the assignment operator function has const B* as parameter type, so I guess it tries to generate a function with a zero as the pointer adress, and I believe that is why I got the "Size of the type B is unknown or zero" error, because it don't know what type is on address 0.
I logged everything I did and will soon compile a step-by-step guide (see post below) for anyone interested.
All examples except number 15 (LoadIrrFile) worked at first build after adding these lines in main() and #included <float.h> (credits to etcaptor for this):
#if defined(__BORLANDC__) || defined(__BCPLUSPLUS__)
_control87(MCW_EM,MCW_EM);//float.h
#endif
The quoted problem has been solved.However, in each example I got question marks in the caption bar of the main window and in example 06.Meshviewer I got strange characters.
This is not a big mystery after all.
The thing is, I made an ugly work-around in irrString.h just to be able to compile it with Borland's compiler without doing too much modifications.
Before the modifications, I received this strange error inside the template <class B> operator= function:
Size of type B is unknown or zero
Anyone had this compiler error?
It seems there is some sort of compiler bug here, but I'm not sure.
The problem was never in irrString.h, but in CCSMLoader.cpp in the function void Surface::clear() and on this row:
textureName = 0;
I changed it to this:
textureName = "";
Voila! The problem is solved. All examples works as expected.
The 'compiler bug' seems to be that the compiler doesn't know how to treat a zero as parameter in the template function.
According to Stroustrup (section 5.1.1) a zero (0) is an int.
Now, the assignment operator function has const B* as parameter type, so I guess it tries to generate a function with a zero as the pointer adress, and I believe that is why I got the "Size of the type B is unknown or zero" error, because it don't know what type is on address 0.