IrrNewt wont compile.

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
pontus.johansson
Posts: 2
Joined: Sun Jun 08, 2008 9:31 am

IrrNewt wont compile.

Post by pontus.johansson »

hey there.
Ive been looking through options for collision detection in my game.
I wanted something pretty high-level, so that narrowed me down to a wrapper.
then i looked through a couple of wrappers and saw that only IrrNewt had joints. so i choosed that.
i got the last version from svn and tried to compile the hello world project with visual studio 2005 express.
and got a couple of warnings and errors

Code: Select all

------ Build started: Project: hello world, Configuration: Debug Win32 ------
Compiling...
hello world.cpp
f:\c++\irrnewt\include\hidden.hpp(194) : warning C4244: 'argument' : conversion from 'irr::f64' to 'irr::f32', possible loss of data
f:\c++\irrnewt\include\hidden.hpp(194) : warning C4244: 'argument' : conversion from 'irr::f64' to 'irr::f32', possible loss of data
f:\c++\irrnewt\include\hidden.hpp(194) : warning C4244: 'argument' : conversion from 'irr::f64' to 'irr::f32', possible loss of data
f:\c++\irrnewt\include\utils.hpp(93) : warning C4244: 'argument' : conversion from 'irr::s32' to 'irr::f32', possible loss of data
f:\c++\irrnewt\include\utils.hpp(93) : warning C4244: 'argument' : conversion from 'irr::s32' to 'irr::f32', possible loss of data
f:\c++\irrnewt\include\utils.hpp(93) : warning C4244: 'argument' : conversion from 'irr::s32' to 'irr::f32', possible loss of data
f:\c++\irrnewt\include\utils.hpp(195) : error C2668: 'pow' : ambiguous call to overloaded function
        e:\program files\microsoft visual studio 8\vc\include\math.h(575): could be 'long double pow(long double,int)'
        e:\program files\microsoft visual studio 8\vc\include\math.h(573): or 'long double pow(long double,long double)'
        e:\program files\microsoft visual studio 8\vc\include\math.h(527): or 'float pow(float,int)'
        e:\program files\microsoft visual studio 8\vc\include\math.h(525): or 'float pow(float,float)'
        e:\program files\microsoft visual studio 8\vc\include\math.h(489): or 'double pow(double,int)'
        e:\program files\microsoft visual studio 8\vc\include\math.h(123): or 'double pow(double,double)'
        while trying to match the argument list '(int, irr::u32)'
f:\c++\irrnewt\include\world.hpp(284) : warning C4244: '=' : conversion from 'irr::u32' to 'irr::f32', possible loss of data
f:\c++\irrnewt\examples\hello world\hello world.cpp(58) : error C2259: 'MyeventReceiver' : cannot instantiate abstract class
        due to following members:
        'bool irr::IEventReceiver::OnEvent(const irr::SEvent &)' : is abstract
        f:\c++\irrlicht-1.4.1\include\ieventreceiver.h(262) : see declaration of 'irr::IEventReceiver::OnEvent'
Build log was saved at "file://f:\c++\IrrNewt\examples\IDE\visual studio\Debug\BuildLog.htm"
hello world - 2 error(s), 7 warning(s)
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
if anyone could help me i would be glad.
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Post by hybrid »

The OnEvent thing is explained in the FAQ a little above this post. The ambiguous overload is propably a lack of proper casting (pow usually expects a double, use powf for floats, and let integers become one of the two first). And the warnings are just warnings, but might introduce trouble or slowdown if they shouldn't be integers at some point...
pontus.johansson
Posts: 2
Joined: Sun Jun 08, 2008 9:31 am

Post by pontus.johansson »

i dont get it, it looks like the event thingie is as it should be.
maby i should just give up and use something else
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Post by hybrid »

Well, compare this line
'bool irr::IEventReceiver::OnEvent(const irr::SEvent &)' : is abstract
with the OnEvent in your code. You should see the difference in the parameter (it needs to be const in Irrlicht 1.4 and later, before it was copied).
baiqian
Posts: 43
Joined: Sun Apr 06, 2008 2:29 pm

Post by baiqian »

Besides above two errors, when i compile, I got another error

Code: Select all

error C2039: "Textures": is not a member of "irr::video::SMaterial" 
I use VS2008 team suite+ Irrlicht 1.4.2 + Newton 1.53
aungsithu
Posts: 39
Joined: Thu Sep 04, 2008 2:14 am
Location: Singapore
Contact:

Post by aungsithu »

for pow function, update to something like

Code: Select all

irr::f32 save=(irr::f32)pow((double)10,(double)decimal);
for event, update like

Code: Select all

virtual bool OnEvent(const SEvent& event)
for textures error, update like

Code: Select all

material.TextureLayer[0].Texture
Aung Sithu
*** Check out my latest book, Beginner's guide to Irrlicht 3D engine: http://bit.ly/rSnm4O
Company: http://rivaledge.sg
baiqian
Posts: 43
Joined: Sun Apr 06, 2008 2:29 pm

Post by baiqian »

Thanks! Compiling the Lib done! But when I use this LIB to compile the irrnewt example "Demo",
I revise the Demo's OnEvent() as below

Code: Select all

class MyEventReceiver:public IEventReceiver {
public:
	virtual bool OnEvent(const SEvent &event) {
But it shows error

Code: Select all

Error	17	error LNK2001: unresolved external symbol "__declspec(dllimport) class irr::IrrlichtDevice * __cdecl irr::createDeviceEx(struct irr::SIrrlichtCreationParameters const &)" (__imp_?createDeviceEx@irr@@YAPAVIrrlichtDevice@1@ABUSIrrlichtCreationParameters@1@@Z)	demo.obj	Demo

33 unresolved external symbol
Total 33 errors for compling with"unresolved external symbol", I doubt whether my complied LIB has any problems due to OnEvent() ? However, all OnEvent() has been updated, including irrnewt source and example , but seems still can not run.....
baiqian
Posts: 43
Joined: Sun Apr 06, 2008 2:29 pm

Post by baiqian »

Problem solved by myself , thanks~!
xtayxkjy
Posts: 13
Joined: Sun Nov 16, 2008 8:41 am
Location: China

Post by xtayxkjy »

[/Problem solved by myself , thanks~!]

I have the same trouble.Can you tell me how to solve the problem? Thank you
zillion42
Posts: 324
Joined: Wed Aug 29, 2007 12:32 am
Location: Hamburg, Germany

Post by zillion42 »

me too !
solved... by following instructions in this thread....
Post Reply