BasicTutorial3: Assertion failure in OgreImage.cpp

Problems building or running the engine, queries about how to use features etc.
Post Reply
User avatar
only_a_ptr
Halfling
Posts: 62
Joined: Sun Apr 26, 2009 8:43 pm
x 2

BasicTutorial3: Assertion failure in OgreImage.cpp

Post by only_a_ptr »

Hello.

I've come back to C++ coding and Ogre after a while, and since I never worked with Ogre's terrain component, I decided to do the BasicTutorial 3. I had set up my environment and worked my way through the tutorial until the "Compile and Run - part 1" section. I copied the terrain.png + *.dds textures from the OgreSDK as advised in the tutorial, prepared plugins_d.cfg and resources_d.cfg and hit run.

Then, Ogre gave me the following error:

Code: Select all

Assertion failed: mDepth == 1, file ..\..\..\..\..\OgreMain\src\OgreImage.cpp, line 570
What went wrong here? Is it a problem with my resource setup, or something else? I searched the wiki and forum, but noone seems to have encountered this problem before. I'll try to dig a little deeper, but for now, I'll appreciate any help.

My working environment:
* Acer TravelMate 8481TG laptop; Intel Core i7 2637M; 4GB DDR3 RAM
* nVidia GeForce GT 520M
* Windows 7 64-bit
* Latest official MinGW (Installed today using Mingw-get installer v0.5-beta-20120426-1; but I don't know where to get MinGW version info :oops: )
* Code::Blocks 10.05
* OGRE 1.8.0 SDK for MinGW (the latest SDK 1.8.1 is broken, boost libs are missing)

Here's the console output (Ogre.log didn't show the assertion error):

Code: Select all

Creating resource group General
Creating resource group Internal
Creating resource group Autodetect
SceneManagerFactory for type 'DefaultSceneManager' registered.
Registering ResourceManager for type Material
Registering ResourceManager for type Mesh
Registering ResourceManager for type Skeleton
MovableObjectFactory for type 'ParticleSystem' registered.
OverlayElementFactory for type Panel registered.
OverlayElementFactory for type BorderPanel registered.
OverlayElementFactory for type TextArea registered.
Registering ResourceManager for type Font
ArchiveFactory for archive type FileSystem registered.
ArchiveFactory for archive type Zip registered.
ArchiveFactory for archive type EmbeddedZip registered.
DDS codec registering
FreeImage version: 3.15.3
This program uses FreeImage, a free, open source image library supporting all co
mmon bitmap formats. See http://freeimage.sourceforge.net for details
Supported formats: bmp,ico,jpg,jif,jpeg,jpe,jng,koa,iff,lbm,mng,pbm,pbm,pcd,pcx,
pgm,pgm,png,ppm,ppm,ras,tga,targa,tif,tiff,wap,wbmp,wbm,psd,cut,xbm,xpm,gif,hdr,
g3,sgi,exr,j2k,j2c,jp2,pfm,pct,pict,pic,3fr,arw,bay,bmq,cap,cine,cr2,crw,cs1,dc2
,dcr,drf,dsc,dng,erf,fff,ia,iiq,k25,kc2,kdc,mdc,mef,mos,mrw,nef,nrw,orf,pef,ptx,
pxn,qtk,raf,raw,rdc,rw2,rwl,rwz,sr2,srf,srw,sti
Registering ResourceManager for type HighLevelGpuProgram
Registering ResourceManager for type Compositor
MovableObjectFactory for type 'Entity' registered.
MovableObjectFactory for type 'Light' registered.
MovableObjectFactory for type 'BillboardSet' registered.
MovableObjectFactory for type 'ManualObject' registered.
MovableObjectFactory for type 'BillboardChain' registered.
MovableObjectFactory for type 'RibbonTrail' registered.
Loading library RenderSystem_Direct3D9_d
Installing plugin: D3D9 RenderSystem
D3D9 : Direct3D9 Rendering Subsystem created.
D3D9: Driver Detection Starts
D3D9: Driver Detection Ends
Plugin successfully installed
Loading library RenderSystem_GL_d
Installing plugin: GL RenderSystem
OpenGL Rendering Subsystem created.
Plugin successfully installed
Loading library Plugin_OctreeSceneManager_d
Installing plugin: Octree Scene Manager
Plugin successfully installed
*-*-* OGRE Initialising
*-*-* Version 1.8.0 (Byatis)
Creating resource group
Added resource location '.' of type 'FileSystem' to resource group ''
D3D9 : RenderSystem Option: Allow NVPerfHUD = No
D3D9 : RenderSystem Option: FSAA = 0
D3D9 : RenderSystem Option: Fixed Pipeline Enabled = Yes
D3D9 : RenderSystem Option: Floating-point mode = Fastest
D3D9 : RenderSystem Option: Full Screen = No
D3D9 : RenderSystem Option: Multi device memory hint = Use minimum system memory

D3D9 : RenderSystem Option: Rendering Device = Monitor-1-Intel(R) HD Graphics Fa
mily
D3D9 : RenderSystem Option: Resource Creation Policy = Create on all devices
D3D9 : RenderSystem Option: Use Multihead = Auto
D3D9 : RenderSystem Option: VSync = No
D3D9 : RenderSystem Option: VSync Interval = 1
D3D9 : RenderSystem Option: Video Mode = 1024 x 768 @ 32-bit colour
D3D9 : RenderSystem Option: sRGB Gamma Conversion = No
CPU Identifier & Features
-------------------------
 *   CPU ID: GenuineIntel: Intel(R) Core(TM) i7-2637M CPU @ 1.70GHz
 *      SSE: yes
 *     SSE2: yes
 *     SSE3: yes
 *      MMX: yes
 *   MMXEXT: yes
 *    3DNOW: no
 * 3DNOWEXT: no
 *     CMOV: yes
 *      TSC: yes
 *      FPU: yes
 *      PRO: yes
 *       HT: no
-------------------------
D3D9 : Subsystem Initialising
Registering ResourceManager for type Texture
Registering ResourceManager for type GpuProgram
D3D9RenderSystem::_createRenderWindow "TutorialApplication Render Window", 1024x
768 windowed  miscParams: FSAA=0 FSAAHint= colourDepth=32 gamma=false monitorInd
ex=0 useNVPerfHUD=false vsync=false vsyncInterval=1
D3D9 : Created D3D9 Rendering Window 'TutorialApplication Render Window' : 1024x
768, 32bpp
D3D9 : WARNING - disabling VSync in windowed mode can cause timing issues at low
er frame rates, turn VSync on if you observe this problem.
D3D9: Vertex texture format supported - PF_L8
D3D9: Vertex texture format supported - PF_L16
D3D9: Vertex texture format supported - PF_A8
D3D9: Vertex texture format supported - PF_A4L4
D3D9: Vertex texture format supported - PF_BYTE_LA
D3D9: Vertex texture format supported - PF_R5G6B5
D3D9: Vertex texture format supported - PF_B5G6R5
D3D9: Vertex texture format supported - PF_A4R4G4B4
D3D9: Vertex texture format supported - PF_A1R5G5B5
D3D9: Vertex texture format supported - PF_A8R8G8B8
D3D9: Vertex texture format supported - PF_B8G8R8A8
D3D9: Vertex texture format supported - PF_A2R10G10B10
D3D9: Vertex texture format supported - PF_A2B10G10R10
D3D9: Vertex texture format supported - PF_DXT1
D3D9: Vertex texture format supported - PF_DXT2
D3D9: Vertex texture format supported - PF_DXT3
D3D9: Vertex texture format supported - PF_DXT4
D3D9: Vertex texture format supported - PF_DXT5
D3D9: Vertex texture format supported - PF_FLOAT16_RGB
D3D9: Vertex texture format supported - PF_FLOAT16_RGBA
D3D9: Vertex texture format supported - PF_FLOAT32_RGB
D3D9: Vertex texture format supported - PF_FLOAT32_RGBA
D3D9: Vertex texture format supported - PF_X8R8G8B8
D3D9: Vertex texture format supported - PF_R8G8B8A8
D3D9: Vertex texture format supported - PF_DEPTH
D3D9: Vertex texture format supported - PF_SHORT_RGBA
D3D9: Vertex texture format supported - PF_FLOAT16_R
D3D9: Vertex texture format supported - PF_FLOAT32_R
D3D9: Vertex texture format supported - PF_SHORT_GR
D3D9: Vertex texture format supported - PF_FLOAT16_GR
D3D9: Vertex texture format supported - PF_FLOAT32_GR
D3D9: Vertex texture format supported - PF_SHORT_RGB
D3D9: Vertex texture format supported - PF_PVRTC_RGB2
D3D9: Vertex texture format supported - PF_PVRTC_RGBA2
D3D9: Vertex texture format supported - PF_PVRTC_RGB4
D3D9: Vertex texture format supported - PF_PVRTC_RGBA4
D3D9: Vertex texture format supported - PF_R8
D3D9: Vertex texture format supported - PF_RG8
RenderSystem capabilities
-------------------------
RenderSystem Name: Direct3D9 Rendering Subsystem
GPU Vendor: intel
Device Name: Monitor-1-Intel(R) HD Graphics Family
Driver Version: 9.18.13.623
 * Fixed function pipeline: yes
 * Hardware generation of mipmaps: yes
 * Texture blending: yes
 * Anisotropic texture filtering: yes
 * Dot product texture operation: yes
 * Cube mapping: yes
 * Hardware stencil buffer: yes
   - Stencil depth: 8
   - Two sided stencil support: yes
   - Wrap stencil values: yes
 * Hardware vertex / index buffers: yes
 * Vertex programs: yes
 * Number of floating-point constants for vertex programs: 256
 * Number of integer constants for vertex programs: 16
 * Number of boolean constants for vertex programs: 16
 * Fragment programs: yes
 * Number of floating-point constants for fragment programs: 224
 * Number of integer constants for fragment programs: 16
 * Number of boolean constants for fragment programs: 16
 * Geometry programs: no
 * Number of floating-point constants for geometry programs: 5336
 * Number of integer constants for geometry programs: 38604
 * Number of boolean constants for geometry programs: 5336
 * Supported Shader Profiles: hlsl ps_1_1 ps_1_2 ps_1_3 ps_1_4 ps_2_0 ps_2_a ps_
2_b ps_2_x ps_3_0 vs_1_1 vs_2_0 vs_2_a vs_2_x vs_3_0
 * Texture Compression: yes
   - DXT: yes
   - VTC: no
   - PVRTC: no
 * Scissor Rectangle: yes
 * Hardware Occlusion Query: yes
 * User clip planes: yes
 * VET_UBYTE4 vertex element type: yes
 * Infinite far plane projection: yes
 * Hardware render-to-texture: yes
 * Floating point textures: yes
 * Non-power-of-two textures: yes
 * Volume textures: yes
 * Multiple Render Targets: 4
   - With different bit depths: yes
 * Point Sprites: yes
 * Extended point parameters: yes
 * Max Point Size: 256
 * Vertex texture fetch: yes
 * Number of world matrices: 0
 * Number of texture units: 8
 * Stencil buffer depth: 8
 * Number of vertex blend matrices: 0
   - Max vertex textures: 4
   - Vertex textures shared: no
 * Render to Vertex Buffer : no
 * DirectX per stage constants: yes
***************************************
*** D3D9 : Subsystem Initialised OK ***
***************************************
DefaultWorkQueue('Root') initialising on thread 0x6f3968.
Particle Renderer Type 'billboard' registered
DefaultWorkQueue('Root')::WorkerFunc - thread 0x78a0d0 starting.
SceneManagerFactory for type 'OctreeSceneManager' registered.
DefaultWorkQueue('Root')::WorkerFunc - thread 0x78a040 starting.
DefaultWorkQueue('Root')::WorkerFunc - thread 0x78a0a0 starting.
DefaultWorkQueue('Root')::WorkerFunc - thread 0x78a070 starting.
Parsing scripts for resource group
Finished parsing scripts for resource group
Creating resources for group
All done
Parsing scripts for resource group Autodetect
Finished parsing scripts for resource group Autodetect
Creating resources for group Autodetect
All done
Parsing scripts for resource group General
Finished parsing scripts for resource group General
Creating resources for group General
All done
Parsing scripts for resource group Internal
Finished parsing scripts for resource group Internal
Creating resources for group Internal
All done
Terrain created; size=513 minBatch=33 maxBatch=65 treeDepth=4 lodLevels=5 leafLo
ds=2
Assertion failed: mDepth == 1, file ..\..\..\..\..\OgreMain\src\OgreImage.cpp, l
ine 570

This application has requested the Runtime to terminate it in an unusual way.
Please contact the application's support team for more information.

Process returned 3 (0x3)   execution time : 3.719 s
Press any key to continue.
Thanx.

EDIT: Fixed incorrect SDK version (I thought I was usint the latest, but I wasn't)
Last edited by only_a_ptr on Thu Oct 11, 2012 4:59 pm, edited 1 time in total.
Rigs of Rods is alive and kicking!
TheSHEEEP
OGRE Retired Team Member
OGRE Retired Team Member
Posts: 972
Joined: Mon Jun 02, 2008 6:52 pm
Location: Berlin
x 65

Re: BasicTutorial3: Assertion failure in OgreImage.cpp

Post by TheSHEEEP »

To see which MinGW gcc version you are using, go to C:\MinGW\lib\gcc\mingw32\ . There will be one folder in there which has the GCC version number.
There may be a faster way, but that's how I usually do it ;)

I doubt that it has something to do with it, though, as I think that incompatible MinGW versions would cause crashes earlier than in that file.
My site! - Have a look :)
Also on Twitter - extra fluffy
User avatar
only_a_ptr
Halfling
Posts: 62
Joined: Sun Apr 26, 2009 8:43 pm
x 2

Re: BasicTutorial3: Assertion failure in OgreImage.cpp

Post by only_a_ptr »

Thanx.

I found out just now that I've been using SDK 1.8.0 instead of 1.8.1 as I wrote :oops: :oops:

I donwloaded the latest SDK, updated OGRE_HOME env. var. and tried to re-compile. Now, I've bumped into another problem: The 1.8.1 SDK doesn't contain boost libraries at all! I re-downloaded and re-deployed the SDK to make sure there's no error on my side, but there's not. 1.8.0 did contain the boost libs allright. This does deserve admin's attention :roll:

Now I'm gonna try compiling my own boost libs and see if the assert() error persists.
Rigs of Rods is alive and kicking!
TheSHEEEP
OGRE Retired Team Member
OGRE Retired Team Member
Posts: 972
Joined: Mon Jun 02, 2008 6:52 pm
Location: Berlin
x 65

Re: BasicTutorial3: Assertion failure in OgreImage.cpp

Post by TheSHEEEP »

Whoops. My mistake. :oops:
Seems I've uploaded a wrong SDK version of mine, then. I'll fix that and post a link to the missing files here. Will take some time though, so you'll be faster building boost yourself.

When you are building from sources anyway, I'd suggest to follow this tutorial.

Additionally, even if we offer prebuilt SDKs, my suggestion is to always build Ogre from sources. At least when using MinGW. My experience is that when using GCC, different prebuilt libraries tend to become incompatible cause they used different GCC versions. Also, having source code access offers obvious advantages :)
It is also a hassle you have to do right only once ;)
My site! - Have a look :)
Also on Twitter - extra fluffy
TheSHEEEP
OGRE Retired Team Member
OGRE Retired Team Member
Posts: 972
Joined: Mon Jun 02, 2008 6:52 pm
Location: Berlin
x 65

Re: BasicTutorial3: Assertion failure in OgreImage.cpp

Post by TheSHEEEP »

New version is up. Should now be like the previous SDK (just with 1.8.1 of course ;) ).

But I still doubt it has to do with that special mDepth problem.
My site! - Have a look :)
Also on Twitter - extra fluffy
User avatar
only_a_ptr
Halfling
Posts: 62
Joined: Sun Apr 26, 2009 8:43 pm
x 2

Re: BasicTutorial3: Assertion failure in OgreImage.cpp

Post by only_a_ptr »

Bad luck, the SDK is still broken - boost_system is missing :roll:

Anyway I've compiled boost myself and now I'm struggling with OgreDeps: http://www.ogre3d.org/forums/viewtopic.php?f=2&t=73256 I'll try using official deps and compile OGRE anyway
Rigs of Rods is alive and kicking!
TheSHEEEP
OGRE Retired Team Member
OGRE Retired Team Member
Posts: 972
Joined: Mon Jun 02, 2008 6:52 pm
Location: Berlin
x 65

Re: BasicTutorial3: Assertion failure in OgreImage.cpp

Post by TheSHEEEP »

Actually, boost_system libraries are in the SDK.

libboost_system-mgw47-mt-d-1_51.a
and
libboost_system-mgw47-mt-1_51.a
My site! - Have a look :)
Also on Twitter - extra fluffy
User avatar
only_a_ptr
Halfling
Posts: 62
Joined: Sun Apr 26, 2009 8:43 pm
x 2

Re: BasicTutorial3: Assertion failure in OgreImage.cpp

Post by only_a_ptr »

TheSHEEEP wrote:Actually, boost_system libraries are in the SDK.
Opps, bad choice of terms. I meant to say the boost_system headers are missing. Sorry.

EDIT: I tried supplying the missing headers from an official Boost package. That way, I discovered all these needed headers are missing:
  • system
  • chrono
  • ratio
  • typeof
  • functional
However, linking failed with the following error:

Code: Select all

-------------- Build: Debug in OgreTutorial3 ---------------

Compiling: BasicTutorial3.cpp
Compiling: TutorialApplication.cpp
Compiling: main.cpp
Compiling: BaseApplication.cpp
Linking console executable: bin\Debug\OgreTutorial3.exe
obj\Debug\BasicTutorial3.o: In function `__static_initialization_and_destruction_0':
d:/lib/ogresdk_mingw_v1-8-1/boost/boost/system/error_code.hpp:214: undefined reference to `boost::system::generic_category()'
d:/lib/ogresdk_mingw_v1-8-1/boost/boost/system/error_code.hpp:215: undefined reference to `boost::system::generic_category()'
d:/lib/ogresdk_mingw_v1-8-1/boost/boost/system/error_code.hpp:216: undefined reference to `boost::system::system_category()'
obj\Debug\TutorialApplication.o: In function `__static_initialization_and_destruction_0':
d:/lib/ogresdk_mingw_v1-8-1/boost/boost/system/error_code.hpp:214: undefined reference to `boost::system::generic_category()'
d:/lib/ogresdk_mingw_v1-8-1/boost/boost/system/error_code.hpp:215: undefined reference to `boost::system::generic_category()'
d:/lib/ogresdk_mingw_v1-8-1/boost/boost/system/error_code.hpp:216: undefined reference to `boost::system::system_category()'
obj\Debug\main.o: In function `__static_initialization_and_destruction_0':
d:/lib/ogresdk_mingw_v1-8-1/boost/boost/system/error_code.hpp:214: undefined reference to `boost::system::generic_category()'
d:/lib/ogresdk_mingw_v1-8-1/boost/boost/system/error_code.hpp:215: undefined reference to `boost::system::generic_category()'
d:/lib/ogresdk_mingw_v1-8-1/boost/boost/system/error_code.hpp:216: undefined reference to `boost::system::system_category()'
obj\Debug\BaseApplication.o: In function `__static_initialization_and_destruction_0':
d:/lib/ogresdk_mingw_v1-8-1/boost/boost/system/error_code.hpp:214: undefined reference to `boost::system::generic_category()'
d:/lib/ogresdk_mingw_v1-8-1/boost/boost/system/error_code.hpp:215: undefined reference to `boost::system::generic_category()'
d:/lib/ogresdk_mingw_v1-8-1/boost/boost/system/error_code.hpp:216: undefined reference to `boost::system::system_category()'
collect2.exe: error: ld returned 1 exit status
Process terminated with status 1 (0 minutes, 23 seconds)
12 errors, 0 warnings
That shouldn't be happening, since both bundled Boost and my Boost are 1.51.0
Last edited by only_a_ptr on Mon Oct 15, 2012 9:31 am, edited 1 time in total.
Rigs of Rods is alive and kicking!
TheSHEEEP
OGRE Retired Team Member
OGRE Retired Team Member
Posts: 972
Joined: Mon Jun 02, 2008 6:52 pm
Location: Berlin
x 65

Re: BasicTutorial3: Assertion failure in OgreImage.cpp

Post by TheSHEEEP »

Indeed, no system headers. That means the CMake SDK build misses them.
It also seems like the chrono headers are also missing. So our SDK building script is at least partly broken. Good to know, I'll have to fix that as soon as I get the time (will likely take some days, as I can#t do any real work before the weekend).
My site! - Have a look :)
Also on Twitter - extra fluffy
Zachariasz
Gnoblar
Posts: 1
Joined: Sat Oct 20, 2012 6:47 pm

Re: BasicTutorial3: Assertion failure in OgreImage.cpp

Post by Zachariasz »

Hi,
when do You think you will manage to fix it? Its not like Im rushing You (well, maybe a little :P), its just I have to start working ASAP. And I so dont want to use vc++... :|
lomithrani
Gnoblar
Posts: 5
Joined: Mon Oct 29, 2012 4:40 pm

Re: BasicTutorial3: Assertion failure in OgreImage.cpp

Post by lomithrani »

Hello,
I wanted to discover ogre today but I'm struggling with the installation.
I happend to have the same issue as you do :

Code: Select all

obj\Debug\main.o||In function `_static_initialization_and_destruction_0':|
C:\OgreSDK\OgreSDK_MinGW_v1-8-1\boost\boost\system\error_code.hpp|214|undefined reference to `boost::system::generic_category()'|
C:\OgreSDK\OgreSDK_MinGW_v1-8-1\boost\boost\system\error_code.hpp|215|undefined reference to `boost::system::generic_category()'|
C:\OgreSDK\OgreSDK_MinGW_v1-8-1\boost\boost\system\error_code.hpp|216|undefined reference to `boost::system::system_category()'|
||=== Build finished: 3 errors, 0 warnings ===|
What should I do to solve this issue ? I can't wait to learn a 3d engine and ogre seemed the best choice :p
TheSHEEEP
OGRE Retired Team Member
OGRE Retired Team Member
Posts: 972
Joined: Mon Jun 02, 2008 6:52 pm
Location: Berlin
x 65

Re: BasicTutorial3: Assertion failure in OgreImage.cpp

Post by TheSHEEEP »

The 1.8.1 SDK is fixed since a week or so.

But you of course have to link against system and chrono in your application now :)
My site! - Have a look :)
Also on Twitter - extra fluffy
lomithrani
Gnoblar
Posts: 5
Joined: Mon Oct 29, 2012 4:40 pm

Re: BasicTutorial3: Assertion failure in OgreImage.cpp

Post by lomithrani »

I guess I failed something in the installation / linking then :( I guess I'll have to try again
lomithrani
Gnoblar
Posts: 5
Joined: Mon Oct 29, 2012 4:40 pm

Re: BasicTutorial3: Assertion failure in OgreImage.cpp

Post by lomithrani »

Well I've been on this for hours now , and no matters which tutorial I'm using it always come to the same error ... would you be kind enough to give me any lead on this ?


my resources_d.cfg looks like that it seems to me the only place where I could have done things wrong ...

Code: Select all

# Resources required by the sample browser and most samples.
[Essential]
Zip=C:/OgreSDK/OgreSDK_MinGW_v1-8-1/media/packs/SdkTrays.zip
Zip=C:/OgreSDK/OgreSDK_MinGW_v1-8-1/media/packs/profiler.zip
FileSystem=C:/OgreSDK/OgreSDK_MinGW_v1-8-1/media/thumbnails

# Common sample resources needed by many of the samples.
# Rarely used resources should be separately loaded by the
# samples which require them.
[Popular]
FileSystem=C:/OgreSDK/OgreSDK_MinGW_v1-8-1/media/fonts
FileSystem=C:/OgreSDK/OgreSDK_MinGW_v1-8-1/media/materials/programs
FileSystem=C:/OgreSDK/OgreSDK_MinGW_v1-8-1/media/materials/scripts
FileSystem=C:/OgreSDK/OgreSDK_MinGW_v1-8-1/media/materials/textures
FileSystem=C:/OgreSDK/OgreSDK_MinGW_v1-8-1/media/materials/textures/nvidia
FileSystem=C:/OgreSDK/OgreSDK_MinGW_v1-8-1/media/models
FileSystem=C:/OgreSDK/OgreSDK_MinGW_v1-8-1/media/particle
FileSystem=C:/OgreSDK/OgreSDK_MinGW_v1-8-1/media/DeferredShadingMedia
FileSystem=C:/OgreSDK/OgreSDK_MinGW_v1-8-1/media/PCZAppMedia
FileSystem=C:/OgreSDK/OgreSDK_MinGW_v1-8-1/media/RTShaderLib
FileSystem=C:/OgreSDK/OgreSDK_MinGW_v1-8-1/media/RTShaderLib/materials
FileSystem=C:/OgreSDK/OgreSDK_MinGW_v1-8-1/media/materials/scripts/SSAO
FileSystem=C:/OgreSDK/OgreSDK_MinGW_v1-8-1/media/materials/textures/SSAO
Zip=C:/OgreSDK/OgreSDK_MinGW_v1-8-1/media/packs/cubemap.zip
Zip=C:/OgreSDK/OgreSDK_MinGW_v1-8-1/media/packs/cubemapsJS.zip
Zip=C:/OgreSDK/OgreSDK_MinGW_v1-8-1/media/packs/dragon.zip
Zip=C:/OgreSDK/OgreSDK_MinGW_v1-8-1/media/packs/fresneldemo.zip
Zip=C:/OgreSDK/OgreSDK_MinGW_v1-8-1/media/packs/ogretestmap.zip
Zip=C:/OgreSDK/OgreSDK_MinGW_v1-8-1/media/packs/ogredance.zip
Zip=C:/OgreSDK/OgreSDK_MinGW_v1-8-1/media/packs/Sinbad.zip
Zip=C:/OgreSDK/OgreSDK_MinGW_v1-8-1/media/packs/skybox.zip

[General]
FileSystem=C:/OgreSDK/OgreSDK_MinGW_v1-8-1/media

# Materials for visual tests
[Tests]
FileSystem=C:/OgreSDK/OgreSDK_MinGW_v1-8-1/media/../../Tests/Media

I followed all the build options apart from the link libraries where I used the full path like that for example:

Code: Select all

C:\OgreSDK\OgreSDK_MinGW_v1-8-1\lib\debug\libOgreMain_d.dll.a
I've tried so many things I feel a bit desperate right now :(
TheSHEEEP
OGRE Retired Team Member
OGRE Retired Team Member
Posts: 972
Joined: Mon Jun 02, 2008 6:52 pm
Location: Berlin
x 65

Re: BasicTutorial3: Assertion failure in OgreImage.cpp

Post by TheSHEEEP »

Can you post your full build command line with all the -L and -l paths?
I still think you did not link against chrono and system :)

If you followed the tutorials, it is even rather likely as I doubt that they are already updated with newer boost versions.
Maybe you could also point me to the tutorials you followed so I can update them if neccessary.
My site! - Have a look :)
Also on Twitter - extra fluffy
lomithrani
Gnoblar
Posts: 5
Joined: Mon Oct 29, 2012 4:40 pm

Re: BasicTutorial3: Assertion failure in OgreImage.cpp

Post by lomithrani »

So the tutorial was this one
www ogre3d dot org /tikiwiki/tiki-index.php?page=Setting+Up+An+Application+-+CodeBlocks
I might not have link against chrono and system , it's highly possible because I see nowhere in the tutorial something that would make me do that ^^

and I don't really know how to post my fyll build command line sorry but I'm quite a noob in all of this I'm just used to programm ...

I followed all the steps


my search directories for all my project are:

Code: Select all

C:\OgreSDK\OgreSDK_MinGW_v1-8-1\include
C:\OgreSDK\OgreSDK_MinGW_v1-8-1\include\OGRE
C:\OgreSDK\OgreSDK_MinGW_v1-8-1\include\OIS
C:\OgreSDK\OgreSDK_MinGW_v1-8-1\boost
linkers in my search directories is :

Code: Select all

C:\OgreSDK\OgreSDK_MinGW_v1-8-1\bin\$(TARGET_NAME)
my other linkers option are

Code: Select all

-Wl,--enable-auto-image-base
-Wl,--add-stdcall-alias
-Wl,--enable-auto-import
on debug my link libraries are

Code: Select all

C:\OgreSDK\OgreSDK_MinGW_v1-8-1\lib\debug\libOgreMain_d.dll.a
C:\OgreSDK\OgreSDK_MinGW_v1-8-1\lib\debug\libOIS_d.dll.a
and on release they are

Code: Select all

C:\OgreSDK\OgreSDK_MinGW_v1-8-1\lib\debug\libOgreMain.dll.a
C:\OgreSDK\OgreSDK_MinGW_v1-8-1\lib\debug\libOIS.dll.a
my compiler has always been mingw32-g++.exe and I haven't got any problem with sdl allegro and gtk ... but I really can't manage to make it work with ogre :(

Thanks for your time !

Edit now that I have tried to link system chrono thread (in the linker settings i added linked librairies I'm not sure its the proper way to do it)

Code: Select all

C:\OgreSDK\OgreSDK_MinGW_v1-8-1\boost\lib\libboost_chrono-mgw47-mt-d-1_51.a
for the debug, I've done the same for date thread and system
and

Code: Select all

C:\OgreSDK\OgreSDK_MinGW_v1-8-1\boost\lib\libboost_chrono-mgw47-mt-1_51.a
for the release
and such I got :

Code: Select all

C:\OgreSDK\OgreSDK_MinGW_v1-8-1\boost\lib\libboost_system-mgw47-mt-1_51.a(error_code.o):error_code.cpp|| undefined reference to `_Unwind_Resume'|
C:\OgreSDK\OgreSDK_MinGW_v1-8-1\boost\lib\libboost_system-mgw47-mt-1_51.a(error_code.o):error_code.cpp|| undefined reference to `_Unwind_Resume'|
C:\OgreSDK\OgreSDK_MinGW_v1-8-1\boost\lib\libboost_system-mgw47-mt-1_51.a(error_code.o):error_code.cpp|| undefined reference to `_Unwind_Resume'|
C:\OgreSDK\OgreSDK_MinGW_v1-8-1\boost\lib\libboost_system-mgw47-mt-1_51.a(error_code.o):error_code.cpp:(.eh_frame+0xa3)||undefined reference to `__gxx_personality_v0'|
||=== Build finished: 4 errors, 0 warnings ===|
TheSHEEEP
OGRE Retired Team Member
OGRE Retired Team Member
Posts: 972
Joined: Mon Jun 02, 2008 6:52 pm
Location: Berlin
x 65

Re: BasicTutorial3: Assertion failure in OgreImage.cpp

Post by TheSHEEEP »

You have to link the boost libraries in the correct order.

Also, this is how a typical g++ compiler line looks like (in my current project at work, in debug mode):

Code: Select all

g++.exe -D__STDC_CONSTANT_MACROS -march=native -mfpmath=sse    -o bin/Debug_Win/bla_engine_2 build/Debug_Win/MinGW-Windows/src/util/blaXml/helper.o build/Debug_Win/MinGW-Windows/src/main.o build/Debug_Win/MinGW-Windows/src/graphics/resource/ResourceLoader.o build/Debug_Win/MinGW-Windows/src/util/blaXml/globals.o build/Debug_Win/MinGW-Windows/src/graphics/resource/VideoDecoder.o -L../../external_projects/built/win/dependencies/lib/Debug -L../../external_projects/built/win/ogre_sdk/lib/Debug -L../../external_projects/built/win/ogre_sdk/lib/Debug/opt -L../../../Coding/boost/lib -L../../../Coding/Microsoft\ SDKs/Windows/v6.1/Lib -lOgreMain_d -lPlugin_OctreeSceneManager_d -lRenderSystem_GL_d -lOgreMain_d -lFreeImage_d -lfreetype_d -lOIS_d.dll -lzlib_d -lzziplib_d -lboost_date_time-mgw46-mt-sd-1_50 -lboost_thread-mgw46-mt-sd-1_50 -lboost_system-mgw46-mt-sd-1_50 -lboost_chrono-mgw46-mt-sd-1_50 -lboost_program_options-mgw46-mt-sd-1_50 -lboost_filesystem-mgw46-mt-sd-1_50 -lGlU32 -lOpenGL32 -lWS2_32 -lGdi32 -lKernel32 -lUser32 -lOle32 -lshell32 -lWinSpool -lOleAut32 -lUuid -lAdvAPI32 -lComDlg32 -lPSAPI ../bla_ffmpeg/bin/Debug_Win/libbla_ffmpeg.dll
Yours will probably be smaller ;)
But it must be in some output window of CodeBlocks when building. At least all IDEs I know have that somewhere (no idea about CodeBlocks, I find it rather unintuitive).

At the end, you see all the -l commands, which are the libraries to link against, and the last one is a full path, which makes it link to that exact file (neccessary as it is a *.dll and not a *.a).
So the order of libraries for me is:

Code: Select all

-lOgreMain_d -lPlugin_OctreeSceneManager_d -lRenderSystem_GL_d -lOgreMain_d -lFreeImage_d -lfreetype_d -lOIS_d.dll -lzlib_d -lzziplib_d -lboost_date_time-mgw46-mt-sd-1_50 -lboost_thread-mgw46-mt-sd-1_50 -lboost_system-mgw46-mt-sd-1_50 -lboost_chrono-mgw46-mt-sd-1_50 -lboost_program_options-mgw46-mt-sd-1_50 -lboost_filesystem-mgw46-mt-sd-1_50 -lGlU32 -lOpenGL32 -lWS2_32 -lGdi32 -lKernel32 -lUser32 -lOle32 -lshell32 -lWinSpool -lOleAut32 -lUuid -lAdvAPI32 -lComDlg32 -lPSAPI
You probably don't need all of these or have different requirements, but you can see the order of linking against boost libraries.

Also, rather important, the prebuilt Ogre SDK and the prebuilt boost libraries it contains are built with MinGW GCC 4.7.0 so they probably only work with that version. Maybe you use a different MinGW version (the latest CodeBlocks version that has MinGW included has included an older version, 4.6.2, I think).
My site! - Have a look :)
Also on Twitter - extra fluffy
lomithrani
Gnoblar
Posts: 5
Joined: Mon Oct 29, 2012 4:40 pm

Re: BasicTutorial3: Assertion failure in OgreImage.cpp

Post by lomithrani »

Sorry , I was'nt able to work on this recently , so you're telling me that if I use the latest mingw it won't compile ? I feel so dumb that I can't even manage to install ogre3d ...
Edit: NVM it seems that I'm using mingw 4.7.0... at least I think
TheSHEEEP
OGRE Retired Team Member
OGRE Retired Team Member
Posts: 972
Joined: Mon Jun 02, 2008 6:52 pm
Location: Berlin
x 65

Re: BasicTutorial3: Assertion failure in OgreImage.cpp

Post by TheSHEEEP »

Look in the stickied thread. It seems to be the same problem. :)

I also added something to that tutorial for the MinGW version "confusion" and boost.
My site! - Have a look :)
Also on Twitter - extra fluffy
JeremyBOB
Gnoblar
Posts: 3
Joined: Fri Dec 07, 2012 4:52 pm

Re: BasicTutorial3: Assertion failure in OgreImage.cpp

Post by JeremyBOB »

Hi Guys

I'm having the same problem with mDepth==1 in Visual Studio 2010 using OgreSDK_v10_v1-8-1.exe
I'm on the same BasicTutorial3.

Was there ever an official resolution to this problem?
JeremyBOB
Gnoblar
Posts: 3
Joined: Fri Dec 07, 2012 4:52 pm

Re: BasicTutorial3: Assertion failure in OgreImage.cpp

Post by JeremyBOB »

Interesting, it seems if I copy all the source from here it works correctly.

But if I only have the source up the the first part where it says Compile an run - Part 1, then I get the error.
phlogios
Gnoblar
Posts: 1
Joined: Thu Jun 11, 2015 9:46 am

Solution

Post by phlogios »

JeremyBOB wrote:Interesting, it seems if I copy all the source from here it works correctly.

But if I only have the source up the the first part where it says Compile an run - Part 1, then I get the error.
I had the same problem but I solved it! (Sorry for reviving a 3 year old thread, but since this is a problem that many Ogre users run in to, I figured it is good if a solution is posted here for future reference.)

The problem lies in getTerrainImage function, the static function that the tutorial tells you to write over the defineTerrain function. The tutorial does not show you how to write the function arguments, and if you get them wrong, you will get the exact same assertion error that the original poster, and JeremyBOB got.

The function takes three arguments: flipX, flipY and img. The first two arguments are booleans, but the third argument HAS to be an Ogre::Image& (reference), not just an Ogre::Image object.

Code: Select all

void getTerrainImage(bool flipX, bool flipY, Ogre::Image& img)
{
	img.load("terrain.png", Ogre::ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME);

	if (flipX)
		img.flipAroundY();
	if (flipY)
		img.flipAroundX();
}
Post Reply