General Category > General Anim8or Forum

liban8 issues

(1/2) > >>

omutomata:
Hello, i am trying to setup liban8 to load .an8 models in a c++ aplication but for some reason i can't pull it off. When i link liban8*.lib and compile i get this bunch of errors:


--- Code: ---Warning .drectve `/DEFAULTLIB:"libcpmtd" /include:?id@?$codecvt@DDH@std@@2V0locale@2@A /DEFAULTLIB:"LIBCMTD" /DEFAULTLIB:"OLDNAMES" ' unrecognized
Warning .drectve `/DEFAULTLIB:"libcpmtd" /include:?id@?$codecvt@DDH@std@@2V0locale@2@A /DEFAULTLIB:"LIBCMTD" /DEFAULTLIB:"OLDNAMES" ' unrecognized
liban8_MTd.lib(\Release\AN8XMath_Quaternion.obj) (.text+0x155): undefined reference to `__security_cookie'
--- End code ---

The undefined reference repeats many times. Liban8 came with 4 different .lib but i didn't know which one to use so i tried them all, one by one with the same results except for the warning which changes, the one above is for MT or MTd and the one below is for MD or MDd:


--- Code: ---Warning .drectve `/manifestdependency:"type='win32' name='Microsoft.VC90.DebugCRT' version='9.0.21022.8'
processorArchitecture='x86' publicKeyToken='1fc8b3b9a1e18e3b'" /DEFAULTLIB:"msvcprtd" /manifestdependency:"type='win32'
name='Microsoft.VC90.DebugCRT' version='9.0.21022.8' processorArchitecture='x86' publicKeyToken='1fc8b3b9a1e18e3b'" /DEFAULTLIB:"MSVCRTD" /DEFAULTLIB:"OLDNAMES" ' unrecognized

--- End code ---

I've also tried adding the source code to my project to avoid using the .lib but i guess i did it wrong because it doesn't compile, however no errors are showed. I wasn't sure what to add so i added them all. I've tried compiling on Dev-C++ v5.11 and on wxDev-C++ v7.4.2 and i am on WinXP SP2 32bits.

PS: also the linked libs are these:


--- Code: ---libSOIL.a
liban8_MDd.lib
-opengl32
-gdi32
-glu32
-mwindows
--- End code ---

SubDrag:
Are you using visual studio?  I think in my program I just used the .cpp/.h files directly and worked fine, never tried the .lib.  Not sure what version visual studio, but the lib should match your version, and make sure MD, etc, match your settings in project properties - C/C++ - Code Generation - Runtime Library.  You can see it successfully used in my tool ( http://goldeneyevault.com/viewfile.php?id=255 )...maybe will help.  It should be similar in whatever compiler you use, I imagine, just including the cpp/h.


Basically just:
#include "Liban8/An8Loader.h"

An8File an8File;

   if( an8File.LoadFile(string((LPCTSTR)(inputFile))) == false)
   {
      return false;
   }

Claude:
As SubDrag said,I think the best way is to include the source code into your project.That's what I do.I use Visual C++ 2010 express.

omutomata:
Thank you both for replying. I did what you suggested SubDrag even before i wrote this topic but figured was too stupid because i didn't linked the .lib and didn't bother to mention this. I've seen the code u posted in the Documentation folder that came with the source code however when i do this:


--- Code: ---#include "An8Loader.h"

An8File an8File;

   if( an8File.LoadFile(string((LPCTSTR)(inputFile))) == false)
   {
      return false;
   }
--- End code ---

i get this error:


--- Code: ---undefined reference to `An8File::An8File()'|
undefined reference to `An8File::LoadFile(std::string)'|

--- End code ---

Note that both An8Loader.h and AN8X.h are in the same directory as my project and i've managed to include other .h the same way in the same project.
I've moved my code from Dev-C++ (which gave me the above error) to Code:Blocks only to see the same error again... As for VC++ i hate it. Tried to get 2010 version but it can only be installed on Win XP SP3 or higher and i am running SP2 so i got 2008 version but i need to change the code so much to make it work...

Here is a sample of my code:


--- Code: ---#include <windows.h> // Header File For Windows
#include <gl\gl.h> // Header File For The OpenGL32 Library
#include <gl\glu.h> // Header File For The GLu32 Library
#include "NeHeGL.h" // Header File For NeHeGL
#include <math.h> // We'll Need Some Math
#include "SOIL.h"                                     // Header File For The SOIL Library
#include "An8Loader.h"                                          // Header File For Anim8tor Loader Library

............................................

void LoadModel()
{
An8File* an8File = new An8File(); // Don't forget delete at the end


if( an8File->LoadFile("test.an8") == false ) // Load file in memory
{
MessageBox(NULL,"Failed To Load Model.","ERROR",MB_OK|MB_ICONEXCLAMATION);
}
}

GLinit()
GLUpdate()
GLDraw()
................................

--- End code ---

Also i've tried changing my code to yours but same thing happens. Got any other tips for me?

SubDrag:
Do you also have the .cpps in the folder?  They are where the implementation is stored (if you don't use the lib).  In mine I kept it all in the liban8 folder, and #include it that way. 

I used VS2008 for Obj2An8.

Navigation

[0] Message Index

[#] Next page

Go to full version