irrBP Not Linking Properly

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.
Zurzaza
Posts: 153
Joined: Fri Mar 26, 2010 9:41 pm
Location: Filo (FE), Italy
Contact:

Post by Zurzaza »

Maybe you need to reinclude whole files, because code::blocks is using my src path "E:\Documenti\Lavori Stefano\ProgettoFPS\Engine\Engine\IrrBP\src\", but you need another path (of course)
irrBP - an Irrlicht - Bullet Physics Wrapper.
The only irrlicht-physics wrapper that uses multithread technology.
Dark Dragon DX
Posts: 24
Joined: Fri Nov 05, 2010 11:46 pm

Post by Dark Dragon DX »

Zurzaza wrote:Maybe you need to reinclude whole files, because code::blocks is using my src path "E:\Documenti\Lavori Stefano\ProgettoFPS\Engine\Engine\IrrBP\src", but you need another path (of course)
I was unable to post over the weekend.

What do you mean by reincluding whole files? I had my include directories set to where they should be from the start of my dilemma. Are you reffering to redoing the #include directives or something?
Midnight
Posts: 1772
Joined: Fri Jul 02, 2004 2:37 pm
Location: Wonderland

Post by Midnight »

Dark Dragon DX wrote: Now I'm getting a totally different error that is from a program called "ld.exe"
ld.exe is codeblocks "linker device" or some crapola like that.

if you get errors with ld.exe one of two things is happing;
1. you effed up linking
2. you effed up linking because you linked twice.

On another note: I have never even heard of IrrBP, but from the name I assume that is an Irrlicht/bullet physics wrapper and you will not need to link your executable to both (most likely). essentially you'd include irrbp to your exe or dll, and bullet would be linked to irrbp.

And yet another think I will mention is that bullet is a pain in the ass to compile correctly on gcc. so for testing purposes (so you know if it's your code or the bullet dll/lib) get yourself a known and varified working copy of the library. Or if you want to you can remain in coding hell wondering if it's your code you continue mutilating or if it's bullets fault.

forgive me if I repeated anyone I haven't spent the time reading this entire thread.
Dark Dragon DX
Posts: 24
Joined: Fri Nov 05, 2010 11:46 pm

Post by Dark Dragon DX »

Midnight wrote:
Dark Dragon DX wrote: Now I'm getting a totally different error that is from a program called "ld.exe"
ld.exe is codeblocks "linker device" or some crapola like that.

if you get errors with ld.exe one of two things is happing;
1. you effed up linking
2. you effed up linking because you linked twice.

On another note: I have never even heard of IrrBP, but from the name I assume that is an Irrlicht/bullet physics wrapper and you will not need to link your executable to both (most likely). essentially you'd include irrbp to your exe or dll, and bullet would be linked to irrbp.

And yet another think I will mention is that bullet is a pain in the ass to compile correctly on gcc. so for testing purposes (so you know if it's your code or the bullet dll/lib) get yourself a known and varified working copy of the library. Or if you want to you can remain in coding hell wondering if it's your code you continue mutilating or if it's bullets fault.

forgive me if I repeated anyone I haven't spent the time reading this entire thread.
1. I was getting that "ld.exe" error because I was compiling on a x64 system (Windows 7 Ultimate) which apparently hates the GCC linker. That error went away when I went back to an x32 system (Windows XP).

2. I know it's not my own code because I looked at many different tutorials that are supposed to "work", and all they do is link to IrrBP and include the IrrBP includes, which in turn include the Bullet source files. But my issue is not to compile a project with IrrBP, my problem lies within the process of me attempting to compile IrrBP to produce .a or .lib files so I can actually link to IrrBP with a GCC compiler.

Perhaps I should just go back and use a different compiler instead of the GCC compiler. Do you know of any good C++ compilers that are compatible with Irrlicht 1.7.1?
Zurzaza
Posts: 153
Joined: Fri Mar 26, 2010 9:41 pm
Location: Filo (FE), Italy
Contact:

Post by Zurzaza »

@Dark dragon: I compiled irrBP successfully on code::blocks. To do this you need to do the following:

1) Start a new codeblocks project and set it to compile as static library (project>properties>build tagets)
2) Insert "irrbp\src" folder (and all its files) in the code::blocks editor
3) Se the include folder (project>build options>search directories) to "bullet\src" and "irrlicht\include" and "irrbp\include"
4) Compile. You now have your own .a lib

Remember that you need to compile YOUR OWN VERSION of bullet physics under gcc. You can do this by downloading cmake. Only after this step you can link irrBP in your project.
irrBP - an Irrlicht - Bullet Physics Wrapper.
The only irrlicht-physics wrapper that uses multithread technology.
Midnight
Posts: 1772
Joined: Fri Jul 02, 2004 2:37 pm
Location: Wonderland

Post by Midnight »

Dark Dragon DX wrote:Perhaps I should just go back and use a different compiler instead of the GCC compiler. Do you know of any good C++ compilers that are compatible with Irrlicht 1.7.1?
MSVC? on linux you'd want gcc.

I really wish people who don't know how to code very well would stop receiving help on how to compile game engines.

if you can't create irrlicht, then you can't create a game engine. and nobody wants a poorly coded application running on their machine, so your free games are really just dangerous garbage.

I'm speaking generally here... please everybody go learn c++ even if that means trying a bunch of smaller programs first. it will take several years of experience to make something worthwhile and to understand the more complex things like bullet physics.
Dark Dragon DX
Posts: 24
Joined: Fri Nov 05, 2010 11:46 pm

Post by Dark Dragon DX »

Midnight wrote:
Dark Dragon DX wrote:Perhaps I should just go back and use a different compiler instead of the GCC compiler. Do you know of any good C++ compilers that are compatible with Irrlicht 1.7.1?
MSVC? on linux you'd want gcc.

I really wish people who don't know how to code very well would stop receiving help on how to compile game engines.

if you can't create irrlicht, then you can't create a game engine. and nobody wants a poorly coded application running on their machine, so your free games are really just dangerous garbage.

I'm speaking generally here... please everybody go learn c++ even if that means trying a bunch of smaller programs first. it will take several years of experience to make something worthwhile and to understand the more complex things like bullet physics.
Ok, you know what, I'm the farthest from not knowing WTF I am doing. I have had six years in Torque script (Tribes 2 modification to be exact), a year in Dark Basic and some experience with LUA (from working with Garry's Mod). I am currently working with a soon-to-be Indie game development company under the name of "Phantom Games Development" (the homepage is currently under construction, therefore the pages my not work properly at all times), and their game engine of choice turns out to be Torque 3D (which uses the same exact coding language as Tribes 2 did). Yes, I have said I am new to C++, but that doesn't mean I don't know the basics (since Torque is a bit like C++). I am learning C++ as a side project while the company is on standby to purchase the game engine.

My Tribes 2 mod can be found here (has been dead for years now): http://www.moddb.com/mods/tribes-2-birth-of-legend-rpg1

Also, here's a TGE code snippet of little Tribes 2 -> .obj exporter I never really got to finish:

Code: Select all

//.obj File Exporter for Tribes 2 Construction Mods

//Function: exportStructure
//Variables--
//%client: The target client to save the structure for
//%center: The center of the structure
//%file: The file to save to
function exportStructure(%client,%center,%file)
{
 if (!IsObject(%client))
 return false;
 
 %count = Deployables.getCount();
 %file = new fileObject();
 %bufferV = "# Saved in Tribes 2 with .obj Exporter\n# Vertices Begin\n";
 %bufferF = "# Faces\n";
 %objcount = 0;
 %offsetX = getWord(%center,0);
 %offsetY = getWord(%center,1);
 %offsetZ = getWord(%center,2);
 for (%i = 0; %i < %count; %i++)
 {
  %obj = Deployables.getObject(%i);
  %scale = %obj.getScale();
  %shape = %obj.getDatablock().shapeName;
  %offset = $Exporter::Offset[%shape];
  if (%offset !$= "" && %obj.getOwner() == %client)
  {
   %objCount++; //Increment Object Count.
   //Start our huge vertex calculation array :D
   %vertex[%objCount,0] = 0 + %offsetX SPC 0 + %offsetY SPC 0 + %offsetZ;
   %vertex[%objCount,1] = 0 + %offsetX SPC 0 + %offsetY SPC (getWord(%scale,2) * getWord(%offset,2)) + %offsetZ;
   %vertex[%objCount,2] = (getWord(%scale,0) * getWord(%offset,0)) + %offsetX SPC 0 + %offsetY @ (getWord(%scale,2) * getWord(%offset,2)) + %offsetZ;
   %vertex[%objCount,3] = (getWord(%scale,0) * getWord(%offset,0)) + %offsetX SPC 0 + %offsetY SPC 0 + %offsetZ;
   %vertex[%objCount,4] = 0 + %offsetX SPC (getWord(%scale,1) * getWord(%offset,1)) + %offsetY SPC 0 + %offsetZ;
   %vertex[%objCount,5] = 0 + %offsetX SPC (getWord(%scale,1) * getWord(%offset,1)) + %offsetY SPC (getWord(%scale,2) * getWord(%scale,2)) + %offsetZ;
   %vertex[%objCount,6] = (getWord(%scale,0) * getWord(%offset,0)) + %offsetX SPC (getWord(%scale,1) * getWord(%offset,1)) + %offsetY SPC (getWord(%scale,2) * getWord(%offset,2)) + %offsetZ;
   %vertex[%objCount,7] = (getWord(%scale,0) * getWord(%offset,0)) + %offsetX SPC (getWord(%scale,1) * getWord(%offset,1)) + %offsetY SPC 0 + %offsetZ;

   %end = %objCount * 6;
   %start = %end - 5;

  }

  }
 }
 
 %file.writeLine(%bufferV);
 %file.writeLine(%bufferF);
 %file.detach();
}

function fileObject::detach(%this){ %this.close(); %this.delete(); }

//Vertex Offset Data
$Exporter::Shape["blah.dts"] = "cube";

//Base Vertex Array
$Exporter::Vertex["cube",0] = "0 0 0";
$Exporter::Vertex["cube",1] = "0 0 1.5";
$Exporter::Vertex["cube",2] = "1.5 0 0.5";
$Exporter::Vertex["cube",3] = "1.5 0 0";
$Exporter::Vertex["cube",4] = "0 1.5 0";
$Exporter::Vertex["cube",5] = "0 1.5 1.5";
$Exporter::Vertex["cube",6] = "1.5 1.5 1.5";
$Exporter::Vertex["cube",7] = "1.5 1.5 0";

//Base Facial Array
$Exporter::Face["cube",0] = "1 5 8 4"; //Bottom Face
$Exporter::Face["cube",1] = "1 2 5 6"; //Left Face
$Exporter::Face["cube",2] = "1 4 5 3"; //Right Face
$Exporter::Face["cube",3] = "0 0 0 0"; //Forward Face
$Exporter::Face["cube",4] = "0 0 0 0"; //Back Face
$Exporter::Face["cube",5] = "2 3 8 6"; //Top Face
Yes, I know that math up there is incorrect, but it is inconsistent with the changes I have at the bottom (the arrays of data). Basically, I changed the bottom but never really got to fixing the actual function to use this data.
Zurzaza wrote: @Dark dragon: I compiled irrBP successfully on code::blocks. To do this you need to do the following:

1) Start a new codeblocks project and set it to compile as static library (project>properties>build tagets)
2) Insert "irrbp\src" folder (and all its files) in the code::blocks editor
3) Se the include folder (project>build options>search directories) to "bullet\src" and "irrlicht\include" and "irrbp\include"
4) Compile. You now have your own .a lib

Remember that you need to compile YOUR OWN VERSION of bullet physics under gcc. You can do this by downloading cmake. Only after this step you can link irrBP in your project.
Thanks, I'll try that next time I get the chance.
Post Reply