Jump to content

Basic Irrlicht Problems

- - - - -

  • Please log in to reply
7 replies to this topic

#1
hetra

hetra

    Programming Professional

  • Members
  • PipPipPipPipPip
  • 297 posts
  • Location:Australia
  • Programming Language:C, C++, PHP, Python, Delphi/Object Pascal, Assembly
  • Learning:Python, Assembly
Hello all,

I've decided to use the Irrlicht Engine for my indie game and have just started today.

However, while following the first tutorial, I ran into some linker issues. It can't find irrlicht.dll to run the application. It compiles completely and no errors or warnings.

I have linked to irrlicht.lib and irrlicht.h in Visual C++ 2010 Express.

For Library Dirrectories I have set it to C:\SDK's\irrlicht\1.7.2\irrlicht-1.7.2\lib\Win32-visualstudio (where irrlicht.lib is contained) and for Include Directories I have C:\SDK's\irrlicht\1.7.2\irrlicht-1.7.2\include (where irrlicht.h is and all of the other header files).

I hope I've been clear enough so inform me if I haven't in your opinion.

Thanks,
Jack
Creator, Owner, Webmaster
Brezerd.net

#2
Alexander

Alexander

    It's Science!

  • Moderators
  • 4,118 posts
  • Location:Vancouver, Eh! Cleverness: 200
I believe Microsoft uses .lib for static linking, not dynamic linking and your project probably is set to link dynamically. If you set that up correctly, for static linking it is said to place this before your inclusion of irrlicht.h:
#define _IRR_STATIC_LIB_

Be sure to read the updated FAQ! || Health is achieved through the same 10,000 steps.
If a suggested code/method fails, informing us is less important than telling us why or what errors occurred.

#3
hetra

hetra

    Programming Professional

  • Members
  • PipPipPipPipPip
  • 297 posts
  • Location:Australia
  • Programming Language:C, C++, PHP, Python, Delphi/Object Pascal, Assembly
  • Learning:Python, Assembly
I tried that, it still can't find it. Have I done it correctly?

#define _IRR_STATIC_LIB_

#include <irrlicht.h>

//#include <d3d9.h>

//Namespace for Irrlicht Engine.

using namespace irr;

using namespace core;

using namespace scene;

using namespace video;

using namespace io;

using namespace gui;

//Kill console window upon startup.

#ifdef _IRR_WINDOWS_

#pragma comment(lib, "Irrlicht.lib")

#pragma comment(lib, "d3d9.lib") 

#pragma comment(linker, "/subsystem:windows /ENTRY:mainCRTStartup")

#endif

Jack
Creator, Owner, Webmaster
Brezerd.net

#4
Alexander

Alexander

    It's Science!

  • Moderators
  • 4,118 posts
  • Location:Vancouver, Eh! Cleverness: 200
Ah, it claims that it required the DLL anyway, I am not so familiar with MSVC so I am not sure why it will not just compile statically.

You may have to follow the instructions to get the DLL, and place it in the current working directory or system32.
Be sure to read the updated FAQ! || Health is achieved through the same 10,000 steps.
If a suggested code/method fails, informing us is less important than telling us why or what errors occurred.

#5
hetra

hetra

    Programming Professional

  • Members
  • PipPipPipPipPip
  • 297 posts
  • Location:Australia
  • Programming Language:C, C++, PHP, Python, Delphi/Object Pascal, Assembly
  • Learning:Python, Assembly
It compiles and runs! Thank you for pointing that out. I just moved Irrlicht.dll into system32 directory.
Jack
Creator, Owner, Webmaster
Brezerd.net

#6
Flying Dutchman

Flying Dutchman

    Programming God

  • Members
  • PipPipPipPipPipPipPip
  • 889 posts
  • Location:::1
When redistributing your game you'll have to provide that dll for end user, keep that in mind.
A conclusion is where you got tired of thinking.
#define class struct    // All is public.

#7
hetra

hetra

    Programming Professional

  • Members
  • PipPipPipPipPip
  • 297 posts
  • Location:Australia
  • Programming Language:C, C++, PHP, Python, Delphi/Object Pascal, Assembly
  • Learning:Python, Assembly
Yes I realised that. But where would I put it on their computer? In the same place?
Jack
Creator, Owner, Webmaster
Brezerd.net

#8
Alexander

Alexander

    It's Science!

  • Moderators
  • 4,118 posts
  • Location:Vancouver, Eh! Cleverness: 200

Hunter100 said:

Yes I realised that. But where would I put it on their computer? In the same place?
It could be in the working directory as well, I am sure there are some simple ways to include it with your package, I've no experience with that game library though.
Be sure to read the updated FAQ! || Health is achieved through the same 10,000 steps.
If a suggested code/method fails, informing us is less important than telling us why or what errors occurred.




1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users