Can't compile Hello World example with C++ Builder

If you are a new Irrlicht Engine user, and have a newbie-question, this is the forum for you. You may also post general programming questions here.
Post Reply
Tj

Can't compile Hello World example with C++ Builder

Post by Tj »

Hi

I've tried to compile the Hello World example with Borland C++ Builder.
But I get the following compile errors:

Code: Select all

Build
  [C++ Error] array.h(170): E2211 Inline assembly not allowed in inline and template functions
  [C++ Error] array.h(183): E2211 Inline assembly not allowed in inline and template functions
  [C++ Error] array.h(310): E2211 Inline assembly not allowed in inline and template functions
  [C++ Error] array.h(328): E2211 Inline assembly not allowed in inline and template functions
  [C++ Error] irrString.h(178): E2211 Inline assembly not allowed in inline and template functions
  [C++ Error] irrlicht.h(226): E2108 Improper use of typedef 'video::EDriverType'
  [C++ Error] irrlicht.h(226): E2293 ) expected
  [C++ Error] main.cpp(96): E2314 Call of nonfunction
The 'Inline assembly not allowed in inline and template functions' errors are cause by the following code:

Code: Select all

#ifdef _DEBUG
 if (index>=used)
    _asm int 3 // bad index
#endif
I 'm a c-newbie (have more experience with java), but this looks like debug code to me, so I commented it out.

The 'Improper use of typedef 'video::EDriverType' error comes from this code:

Code: Select all

IRRLICHT_API IrrlichtDevice* createDevice(
     video::EDriverType deviceType = video::DT_SOFTWARE, 
     const core::dimension2d<s32>& windowSize  = core::dimension2d<s32>(640,480),
     u32 bits = 16,		
     bool fullscreen = false,
     bool stencilbuffer=false,
     IEventReceiver* receiver = 0);
The other 2 errors are direct related to this error.

Does someone get the same errors or can someone tell me how to compile the Hello World example with C++ Builder???

Some help would be much appreciated
narx

i hav some type of erors

Post by narx »

i resolve the asm problem in 2 steps


1.replacing all __asm bl bla lines with codeasm();



2. in main cpp add procedure

void codeasm()


{


_asm int 3;

}




but i still don known what to dooo whith


[C++ Error] irrlicht.h(226): E2108 Improper use of typedef 'video::EDriverType'
[C++ Error] irrlicht.h(226): E2293 ) expected




if you resolw this bug tel mee place how
old chap

Post by old chap »

To compile successfully with C++ Builder, try the following code in the header file irrlicht.h. (The problem is in the second parameter).

core::dimension2d<s32> ws = core::dimension2d<s32>(640,480);

IRRLICHT_API IrrlichtDevice* createDevice(
video::EDriverType deviceType = video::EDT_SOFTWARE,
const core::dimension2d<s32> &windowSize = ws,
u32 bits = 16,
bool fullscreen = false,
bool stencilbuffer = false,
IEventReceiver* receiver = 0,
const wchar_t* sdk_version_do_not_use = IRRLICHT_SDK_VERSION);

But it won't help you :cry: as there will be problems with the static library irrlicht.lib. Visual C++ and Borland C++ use different formats of *.obj files and *.lib files :( . And the utility IMPLIB of Borland does not help in this case. You have to rebuild irrlicht.dll using *.def files to get Borland C++ compatible library.
Post Reply