OgreMain build failure

Problems building or running the engine, queries about how to use features etc.
Post Reply
User avatar
Kyasix
Halfling
Posts: 55
Joined: Sun Jul 11, 2010 12:49 am

OgreMain build failure

Post by Kyasix »

I'm trying to build from source, but having issues ( as usual! ). I'm using vc 2010. I built the dependencies (debug and release) with no problems. Building the ogre source everything built ok in debug, and all but OgreMain built in release. In OgreMain build (release) I get the following errors. Can someone point me in the right direction? The only thing i have found in searches was either not building the dependencies (which i double checked) or pertained to X64. (I'm x32 XP).



------ Build started: Project: OgreMain, Configuration: Release Win32 ------
Build started 7/25/2010 9:34:10 PM.
InitializeBuildStatus:
Touching "OgreMain.dir\Release\OgreMain.unsuccessfulbuild".
ClCompile:
All outputs are up-to-date.
All outputs are up-to-date.
ResourceCompile:
All outputs are up-to-date.
FreeImage.lib(libraw_cxx.obj) : warning LNK4075: ignoring '/EDITANDCONTINUE' due to '/OPT:ICF' specification
FreeImage.lib(IexBaseExc.obj) : error LNK2038: mismatch detected for '_ITERATOR_DEBUG_LEVEL': value '2' doesn't match value '0' in OgreAlignedAllocator.obj
FreeImage.lib(half.obj) : error LNK2038: mismatch detected for '_ITERATOR_DEBUG_LEVEL': value '2' doesn't match value '0' in OgreAlignedAllocator.obj
FreeImage.lib(ImfIO.obj) : error LNK2038: mismatch detected for '_ITERATOR_DEBUG_LEVEL': value '2' doesn't match value '0' in OgreAlignedAllocator.obj
FreeImage.lib(ImfRgbaFile.obj) : error LNK2038: mismatch detected for '_ITERATOR_DEBUG_LEVEL': value '2' doesn't match value '0' in OgreAlignedAllocator.obj
FreeImage.lib(IexThrowErrnoExc.obj) : error LNK2038: mismatch detected for '_ITERATOR_DEBUG_LEVEL': value '2' doesn't match value '0' in OgreAlignedAllocator.obj
FreeImage.lib(ImfOutputFile.obj) : error LNK2038: mismatch detected for '_ITERATOR_DEBUG_LEVEL': value '2' doesn't match value '0' in OgreAlignedAllocator.obj
FreeImage.lib(ImfFrameBuffer.obj) : error LNK2038: mismatch detected for '_ITERATOR_DEBUG_LEVEL': value '2' doesn't match value '0' in OgreAlignedAllocator.obj
FreeImage.lib(ImfChannelList.obj) : error LNK2038: mismatch detected for '_ITERATOR_DEBUG_LEVEL': value '2' doesn't match value '0' in OgreAlignedAllocator.obj
FreeImage.lib(ImfHeader.obj) : error LNK2038: mismatch detected for '_ITERATOR_DEBUG_LEVEL': value '2' doesn't match value '0' in OgreAlignedAllocator.obj
FreeImage.lib(ImfInputFile.obj) : error LNK2038: mismatch detected for '_ITERATOR_DEBUG_LEVEL': value '2' doesn't match value '0' in OgreAlignedAllocator.obj
FreeImage.lib(ImfRgbaYca.obj) : error LNK2038: mismatch detected for '_ITERATOR_DEBUG_LEVEL': value '2' doesn't match value '0' in OgreAlignedAllocator.obj
FreeImage.lib(ImfStandardAttributes.obj) : error LNK2038: mismatch detected for '_ITERATOR_DEBUG_LEVEL': value '2' doesn't match value '0' in OgreAlignedAllocator.obj
FreeImage.lib(ImfChromaticities.obj) : error LNK2038: mismatch detected for '_ITERATOR_DEBUG_LEVEL': value '2' doesn't match value '0' in OgreAlignedAllocator.obj
FreeImage.lib(IlmThreadPool.obj) : error LNK2038: mismatch detected for '_ITERATOR_DEBUG_LEVEL': value '2' doesn't match value '0' in OgreAlignedAllocator.obj
FreeImage.lib(ImfMisc.obj) : error LNK2038: mismatch detected for '_ITERATOR_DEBUG_LEVEL': value '2' doesn't match value '0' in OgreAlignedAllocator.obj
FreeImage.lib(ImfStdIO.obj) : error LNK2038: mismatch detected for '_ITERATOR_DEBUG_LEVEL': value '2' doesn't match value '0' in OgreAlignedAllocator.obj
FreeImage.lib(ImfCompressor.obj) : error LNK2038: mismatch detected for '_ITERATOR_DEBUG_LEVEL': value '2' doesn't match value '0' in OgreAlignedAllocator.obj
FreeImage.lib(ImfOpaqueAttribute.obj) : error LNK2038: mismatch detected for '_ITERATOR_DEBUG_LEVEL': value '2' doesn't match value '0' in OgreAlignedAllocator.obj
FreeImage.lib(ImfAttribute.obj) : error LNK2038: mismatch detected for '_ITERATOR_DEBUG_LEVEL': value '2' doesn't match value '0' in OgreAlignedAllocator.obj
FreeImage.lib(ImfBoxAttribute.obj) : error LNK2038: mismatch detected for '_ITERATOR_DEBUG_LEVEL': value '2' doesn't match value '0' in OgreAlignedAllocator.obj
FreeImage.lib(ImfChannelListAttribute.obj) : error LNK2038: mismatch detected for '_ITERATOR_DEBUG_LEVEL': value '2' doesn't match value '0' in OgreAlignedAllocator.obj
FreeImage.lib(ImfChromaticitiesAttribute.obj) : error LNK2038: mismatch detected for '_ITERATOR_DEBUG_LEVEL': value '2' doesn't match value '0' in OgreAlignedAllocator.obj
FreeImage.lib(ImfCompressionAttribute.obj) : error LNK2038: mismatch detected for '_ITERATOR_DEBUG_LEVEL': value '2' doesn't match value '0' in OgreAlignedAllocator.obj
FreeImage.lib(ImfDoubleAttribute.obj) : error LNK2038: mismatch detected for '_ITERATOR_DEBUG_LEVEL': value '2' doesn't match value '0' in OgreAlignedAllocator.obj
FreeImage.lib(ImfEnvmapAttribute.obj) : error LNK2038: mismatch detected for '_ITERATOR_DEBUG_LEVEL': value '2' doesn't match value '0' in OgreAlignedAllocator.obj
FreeImage.lib(ImfFloatAttribute.obj) : error LNK2038: mismatch detected for '_ITERATOR_DEBUG_LEVEL': value '2' doesn't match value '0' in OgreAlignedAllocator.obj
FreeImage.lib(ImfIntAttribute.obj) : error LNK2038: mismatch detected for '_ITERATOR_DEBUG_LEVEL': value '2' doesn't match value '0' in OgreAlignedAllocator.obj
FreeImage.lib(ImfKeyCodeAttribute.obj) : error LNK2038: mismatch detected for '_ITERATOR_DEBUG_LEVEL': value '2' doesn't match value '0' in OgreAlignedAllocator.obj
FreeImage.lib(ImfLineOrderAttribute.obj) : error LNK2038: mismatch detected for '_ITERATOR_DEBUG_LEVEL': value '2' doesn't match value '0' in OgreAlignedAllocator.obj
FreeImage.lib(ImfMatrixAttribute.obj) : error LNK2038: mismatch detected for '_ITERATOR_DEBUG_LEVEL': value '2' doesn't match value '0' in OgreAlignedAllocator.obj
FreeImage.lib(ImfPreviewImage.obj) : error LNK2038: mismatch detected for '_ITERATOR_DEBUG_LEVEL': value '2' doesn't match value '0' in OgreAlignedAllocator.obj
FreeImage.lib(ImfPreviewImageAttribute.obj) : error LNK2038: mismatch detected for '_ITERATOR_DEBUG_LEVEL': value '2' doesn't match value '0' in OgreAlignedAllocator.obj
FreeImage.lib(ImfRationalAttribute.obj) : error LNK2038: mismatch detected for '_ITERATOR_DEBUG_LEVEL': value '2' doesn't match value '0' in OgreAlignedAllocator.obj
FreeImage.lib(ImfStringAttribute.obj) : error LNK2038: mismatch detected for '_ITERATOR_DEBUG_LEVEL': value '2' doesn't match value '0' in OgreAlignedAllocator.obj
FreeImage.lib(ImfTileDescriptionAttribute.obj) : error LNK2038: mismatch detected for '_ITERATOR_DEBUG_LEVEL': value '2' doesn't match value '0' in OgreAlignedAllocator.obj
FreeImage.lib(ImfTimeCodeAttribute.obj) : error LNK2038: mismatch detected for '_ITERATOR_DEBUG_LEVEL': value '2' doesn't match value '0' in OgreAlignedAllocator.obj
FreeImage.lib(ImfVecAttribute.obj) : error LNK2038: mismatch detected for '_ITERATOR_DEBUG_LEVEL': value '2' doesn't match value '0' in OgreAlignedAllocator.obj
FreeImage.lib(ImfKeyCode.obj) : error LNK2038: mismatch detected for '_ITERATOR_DEBUG_LEVEL': value '2' doesn't match value '0' in OgreAlignedAllocator.obj
FreeImage.lib(ImfTimeCode.obj) : error LNK2038: mismatch detected for '_ITERATOR_DEBUG_LEVEL': value '2' doesn't match value '0' in OgreAlignedAllocator.obj
FreeImage.lib(ImfTiledInputFile.obj) : error LNK2038: mismatch detected for '_ITERATOR_DEBUG_LEVEL': value '2' doesn't match value '0' in OgreAlignedAllocator.obj
FreeImage.lib(ImfScanLineInputFile.obj) : error LNK2038: mismatch detected for '_ITERATOR_DEBUG_LEVEL': value '2' doesn't match value '0' in OgreAlignedAllocator.obj
FreeImage.lib(IlmThread.obj) : error LNK2038: mismatch detected for '_ITERATOR_DEBUG_LEVEL': value '2' doesn't match value '0' in OgreAlignedAllocator.obj
FreeImage.lib(ImfConvert.obj) : error LNK2038: mismatch detected for '_ITERATOR_DEBUG_LEVEL': value '2' doesn't match value '0' in OgreAlignedAllocator.obj
FreeImage.lib(ImfB44Compressor.obj) : error LNK2038: mismatch detected for '_ITERATOR_DEBUG_LEVEL': value '2' doesn't match value '0' in OgreAlignedAllocator.obj
FreeImage.lib(ImfPxr24Compressor.obj) : error LNK2038: mismatch detected for '_ITERATOR_DEBUG_LEVEL': value '2' doesn't match value '0' in OgreAlignedAllocator.obj
FreeImage.lib(ImfPizCompressor.obj) : error LNK2038: mismatch detected for '_ITERATOR_DEBUG_LEVEL': value '2' doesn't match value '0' in OgreAlignedAllocator.obj
FreeImage.lib(ImfZipCompressor.obj) : error LNK2038: mismatch detected for '_ITERATOR_DEBUG_LEVEL': value '2' doesn't match value '0' in OgreAlignedAllocator.obj
FreeImage.lib(ImfRleCompressor.obj) : error LNK2038: mismatch detected for '_ITERATOR_DEBUG_LEVEL': value '2' doesn't match value '0' in OgreAlignedAllocator.obj
FreeImage.lib(ImfTileOffsets.obj) : error LNK2038: mismatch detected for '_ITERATOR_DEBUG_LEVEL': value '2' doesn't match value '0' in OgreAlignedAllocator.obj
FreeImage.lib(ImfTiledMisc.obj) : error LNK2038: mismatch detected for '_ITERATOR_DEBUG_LEVEL': value '2' doesn't match value '0' in OgreAlignedAllocator.obj
FreeImage.lib(ImfHuf.obj) : error LNK2038: mismatch detected for '_ITERATOR_DEBUG_LEVEL': value '2' doesn't match value '0' in OgreAlignedAllocator.obj
Creating library C:/OgreSDK/OgreNew/lib/Release/OgreMain.lib and object C:/OgreSDK/OgreNew/lib/Release/OgreMain.exp
LINK : warning LNK4098: defaultlib 'MSVCRTD' conflicts with use of other libs; use /NODEFAULTLIB:library
C:\OgreSDK\OgreNew\bin\Release\OgreMain.dll : fatal error LNK1319: 51 mismatches detected

Build FAILED.

Time Elapsed 00:00:25.29
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
User avatar
Kyasix
Halfling
Posts: 55
Joined: Sun Jul 11, 2010 12:49 am

Re: OgreMain build failure

Post by Kyasix »

Arg. I cleaned the project (bad idea?) and rebuilt. Again it builds just fine as debug. release however gives me this now..


LINK : fatal error LNK1181: cannot open input file 'C:\OgreSDK\ogre_src_v1-7-1\Dependencies\lib\Release.obj'

I have no idea what that one is...
User avatar
Matheus Martino
Gremlin
Posts: 164
Joined: Mon Sep 07, 2009 10:44 pm
Location: Brazil
Contact:

Re: OgreMain build failure

Post by Matheus Martino »

I don't have that file "C:\OgreSDK\ogre_src_v1-7-1\Dependencies\lib\Release.obj", i don't know what it is, maybe you have changed something in the project configuration? If you is building the Ogre source, it is better to don't change anything (i was think you had alredy built the ogre library from source! :? )
For the dependencies i prefer to donwload then from here: http://www.ogre3d.org/forums/viewtopic.php?f=1&t=54533
Excuse me if my english fail!
User avatar
Kyasix
Halfling
Posts: 55
Joined: Sun Jul 11, 2010 12:49 am

Re: OgreMain build failure

Post by Kyasix »

Nope, I did not change anything. Too strange, maybe i'll wipe it all and start again. Embarrassingly enough, this is the farthest i have managed to get so far with building from source. First try i downloaded dependencies like walkthru said (shame on me, it didn't say i had to BUILD them after I downloaded them : ) )haha. I'm slowly figuring this out lol.
User avatar
Matheus Martino
Gremlin
Posts: 164
Joined: Mon Sep 07, 2009 10:44 pm
Location: Brazil
Contact:

Re: OgreMain build failure

Post by Matheus Martino »

You don't need to build the dependencies, the link i posted have the dependencies already built (they are some .lib files and some .h files).

Ok , now i understand. You was using the debug libraries to fallow the tutorials but the "Release" is still not working for you right?
Excuse me if my english fail!
User avatar
jacmoe
OGRE Retired Moderator
OGRE Retired Moderator
Posts: 20570
Joined: Thu Jan 22, 2004 10:13 am
Location: Denmark
x 179
Contact:

Re: OgreMain build failure

Post by jacmoe »

Matheus Martino wrote:You don't need to build the dependencies, the link i postend have the dependencies already built (they are some .lib files and some .h files).
Could you please stop that nonsense.

I told you before, and I am telling you again: there are no such thing as precompiled dependencies for Ogre 1.7.

None.
sinbad wrote:Rather than distributing 3+ precompiled archives this time, we're giving you a combined source archive which you can use to build all the dependencies quickly and simply from one solution file, with the compiler of your choice. We've tested this with MSVC 2003, 2005, 2008 and 2010 so far. You should also be able to compile with the 2005, 2008 and 2010 versions an x64 platform configuration.
So please don't confuse users with not-so-correct answers. Please.
/* Less noise. More signal. */
Ogitor Scenebuilder - powered by Ogre, presented by Qt, fueled by Passion.
OgreAddons - the Ogre code suppository.
User avatar
Matheus Martino
Gremlin
Posts: 164
Joined: Mon Sep 07, 2009 10:44 pm
Location: Brazil
Contact:

Re: OgreMain build failure

Post by Matheus Martino »

OMG! Sorry! Don't kill me! :oops: I have not paid atention to it! I use Code::Blocks and for me the donwload link have preconpiled libraries for mingw.

Then now i understand, he just don't managed to compile the release version of the depedencies.
Excuse me if my english fail!
User avatar
jacmoe
OGRE Retired Moderator
OGRE Retired Moderator
Posts: 20570
Joined: Thu Jan 22, 2004 10:13 am
Location: Denmark
x 179
Contact:

Re: OgreMain build failure

Post by jacmoe »

Looks like we're both right.
Sorry Matheus. :)
/* Less noise. More signal. */
Ogitor Scenebuilder - powered by Ogre, presented by Qt, fueled by Passion.
OgreAddons - the Ogre code suppository.
User avatar
Kyasix
Halfling
Posts: 55
Joined: Sun Jul 11, 2010 12:49 am

Re: OgreMain build failure

Post by Kyasix »

From what I can tell from the error above
(LINK : warning LNK4098: defaultlib 'MSVCRTD' conflicts with use of other libs; use /NODEFAULTLIB:library)

I am apparently trying to use debug and release libraries in a single compile, just haven't sorted out what or where yet. I didn't make any changes to the dependencies solution, and they all built in debug and release, so this should not be an issue. I guess after work today I will start over from scratch.
LollyThief
Gnoblar
Posts: 1
Joined: Mon Jul 26, 2010 5:40 pm

Re: OgreMain build failure

Post by LollyThief »

Hello.

In the OgreDependencies solution for VS2010 there is an error in the project settings for the FreeImageLib project.

This FreeImageLib project uses the Link Library Dependencies option (Project Settings > Librarian > General), but for some reason it is not working correctly here. Under the Release settings of the project go the the Libririan command line (Project Settings > Libriarian > Command Line) and note that it links to the debug build .lib files instead of the release build .lib files:

Code: Select all

/OUT:".\Release\FreeImage.lib" "C:\OGRE\ogre_build_v1-7-1\Dependencies\src\FreeImage-3.13.1\Source\LibJPEG\Debug\LibJPEG.lib" "C:\OGRE\ogre_build_v1-7-1\Dependencies\src\FreeImage-3.13.1\Source\LibMNG\Debug\LibMNG.lib" "C:\OGRE\ogre_build_v1-7-1\Dependencies\src\FreeImage-3.13.1\Source\LibOpenJPEG\Debug\LibOpenJPEG.lib" "C:\OGRE\ogre_build_v1-7-1\Dependencies\src\FreeImage-3.13.1\Source\LibPNG\Debug\LibPNG.lib" "C:\OGRE\ogre_build_v1-7-1\Dependencies\src\FreeImage-3.13.1\Source\LibRawLite\Debug\LibRawLite.lib" "C:\OGRE\ogre_build_v1-7-1\Dependencies\src\FreeImage-3.13.1\Source\LibTIFF\Debug\LibTIFF.lib" "C:\OGRE\ogre_build_v1-7-1\Dependencies\src\FreeImage-3.13.1\Source\OpenEXR\Debug\OpenEXR.lib" "C:\OGRE\ogre_build_v1-7-1\Dependencies\src\FreeImage-3.13.1\Source\ZLib\Debug\ZLib.lib" /NOLOGO 
I am not sure how to fix this while using the Link Library Dependencies as I am new to this, but you can manually specify the libraries as a workaround to the problem.
First disable Link Library Dependencies by setting it to false.
Then, under Additional Library Directories, add all the paths to the release builds of the .lib files:

Code: Select all

..\LibJPEG\Release\; ..\LibMNG\Release\; ..\LibOpenJPEG\Release\; ..\LibPNG\Release\; ..\LibRawLite\Release\; ..\LibTIFF\Release\; ..\OpenEXR\Release\; ..\ZLib\Release\;
And finally specify the .lib files in the Additional Dependencies field:

Code: Select all

LibJPEG.lib;LibMNG.lib;LibOpenJPEG.lib;LibPNG.lib;LibRawLite.lib;LibTIFF.lib;OpenEXR.lib;ZLib.lib;
Hope this was helpful. Good luck.
User avatar
jacmoe
OGRE Retired Moderator
OGRE Retired Moderator
Posts: 20570
Joined: Thu Jan 22, 2004 10:13 am
Location: Denmark
x 179
Contact:

Re: OgreMain build failure

Post by jacmoe »

You're right.
The project does indeed reference the debug libraries for release mode.
Highly odd.
But that doesn't mean it doesn't work.
It works.
But it should probably be fixed, as it could (maybe) affect performance.
/* Less noise. More signal. */
Ogitor Scenebuilder - powered by Ogre, presented by Qt, fueled by Passion.
OgreAddons - the Ogre code suppository.
LBDude
Gnome
Posts: 389
Joined: Mon Jul 26, 2010 10:53 pm
x 22

Re: OgreMain build failure

Post by LBDude »

I had the same errors awhile back. What I did was rebuild the dependencies using VS2010 (perhaps I also changed some settings) but after rebuilding in VS2010 the problems went away, for me.
My blog here.
Game twitter here
Gene
Gnoblar
Posts: 19
Joined: Sat Feb 07, 2009 11:52 pm

Re: OgreMain build failure

Post by Gene »

LBDude wrote:I had the same errors awhile back. What I did was rebuild the dependencies using VS2010 (perhaps I also changed some settings) but after rebuilding in VS2010 the problems went away, for me.
Same here. Rebuild help, but i didn't change any settings. (Doens't make any sense,)
mstoyke
Gnoblar
Posts: 3
Joined: Wed Jun 23, 2010 10:14 pm
x 1

Re: OgreMain build failure

Post by mstoyke »

There is a known bug in VS2010 (sorry, don't have the link to the KB article anymore) that sometimes causes this behavior. It only happens sometimes, not deterministic at all. The best way to solve the problem is to restart VS2010, open the project again and only recompile all projects for the debug version. Then restart VS2010 and open the project again, this time the release version.

Furtunately I only had this problem with compiling the dependencies. Once I had compiled dependencies I could always use them to recompile all versions of Ogre without running into this problem again.
User avatar
prosaic2000
Kobold
Posts: 30
Joined: Wed Jul 18, 2007 4:16 am
Location: MoTown

Re: OgreMain build failure

Post by prosaic2000 »

This happened to me.

I copied release libraries from:
ogre\Dependencies\lib\Release

to
ogre\Dependencies\lib\Debug

and added a "d" to the end:
FreeImaged.lib
freetype2311_d.lib
zlibd.lib
zziplibd.lib

It's a hack but better than not linking :)
Mawen
Halfling
Posts: 54
Joined: Wed Jun 04, 2003 7:34 pm
Location: Calgary, Canada
Contact:

Re: OgreMain build failure

Post by Mawen »

I came across and solved another build issue and thought I would share in case anyone comes across it. I get the error LNK2038: mismatch detected for '_ITERATOR_DEBUG_LEVEL': value '2' doesn't match value '0' bug for libboost_thread-vc100-mt-1_44.lib, when compiling in Debug mode. It should be using libboost_thread-vc100-mt-gd-1_44.lib.

I have CMake 2.8.3 and found out that the boost debug library detection in this version seems to be broken, according to this bug:

http://www.cmake.org/Bug/view.php?id=11363&nbn=3

The patch linked in the above URL shows the problem. A line is missing to detect -gd lib files for debug. So I opened up the FindBoost.cmake file in my CMake installation, manually applied the patch, deleted my CMake build output directory, did the CMake config/generation over again and the proper -gd library was detected for my VS2010 VC++ projects. According to the bug report, this issue should be fixed in CMake 2.8.4.

(Now I get a whole bunch of warnings: "warning LNK4099: PDB 'vc100.pdb' was not found with 'zziplibd.lib(zip.obj)' or at 'D:\Dev\Mogre\Main\OgreSrc\build\bin\Debug\vc100.pdb'; linking object as if no debug info", but since it's just a warning of missing debug info, I don't care.)
(aka Meharin) Mogre (1.7.1) .NET 4, GUI: WPF (see https://bitbucket.org/JaredThirsk/mogreinwpf), Net: Lidgren+custom RPC+MessagePack, Sound: MOgreFreeSL, Physics: BulletSharp, with MeshStrider and partially working DebugDraw [and soon Input: MOIS]
cebollo3
Gnoblar
Posts: 1
Joined: Mon Jul 18, 2011 3:10 am

Re: OgreMain build failure

Post by cebollo3 »

Mawen wrote:I came across and solved another build issue and thought I would share in case anyone comes across it. I get the error LNK2038: mismatch detected for '_ITERATOR_DEBUG_LEVEL': value '2' doesn't match value '0' bug for libboost_thread-vc100-mt-1_44.lib, when compiling in Debug mode. It should be using libboost_thread-vc100-mt-gd-1_44.lib.

I have CMake 2.8.3 and found out that the boost debug library detection in this version seems to be broken, according to this bug:

http://www.cmake.org/Bug/view.php?id=11363&nbn=3

The patch linked in the above URL shows the problem. A line is missing to detect -gd lib files for debug. So I opened up the FindBoost.cmake file in my CMake installation, manually applied the patch, deleted my CMake build output directory, did the CMake config/generation over again and the proper -gd library was detected for my VS2010 VC++ projects. According to the bug report, this issue should be fixed in CMake 2.8.4.

(Now I get a whole bunch of warnings: "warning LNK4099: PDB 'vc100.pdb' was not found with 'zziplibd.lib(zip.obj)' or at 'D:\Dev\Mogre\Main\OgreSrc\build\bin\Debug\vc100.pdb'; linking object as if no debug info", but since it's just a warning of missing debug info, I don't care.)
Today I downloaded the source code and used CMake to generate a Visual Studio 2010 solution and got a similar issue in the opposite direction. The DEBUG configuration completed just fine, but when I used RELEASE, I received a whole bunch of linker errors like the following.

Code: Select all

libboost_thread-vc100-mt-gd-1_44.lib(tss_pe.obj) : error LNK2038: mismatch detected for '_ITERATOR_DEBUG_LEVEL': value '2' doesn't match value '0' in OgreGrid2DPageStrategy.obj
It turned out to be that I failed to install correctly the release version of Boost. So, looking deeper into CMake, I noticed that a NOT FOUND message appeared in the following variables:

Code: Select all

Boost_DATE_TIME_LIBRARY_RELEASE
Boost_THREAD_LIBRARY_RELEASE
(tick the "advanced" checkbox in CMake GUI and search "boost")

I installed the missing libraries, erased and regenerated CMake's cache, and all libraries were detected correctly this time.
When I recompiled, everything went silky smooth in both DEBUG and RELEASE versions.

The moral, at least for me: Check for CMake error messages before changing dependencies by hand. I can only guess that, because CMake didn't find the release libraries, it included the debug libraries in the release version anyways.

Hope this helps
User avatar
jacmoe
OGRE Retired Moderator
OGRE Retired Moderator
Posts: 20570
Joined: Thu Jan 22, 2004 10:13 am
Location: Denmark
x 179
Contact:

Re: OgreMain build failure

Post by jacmoe »

+1. :wink:
/* Less noise. More signal. */
Ogitor Scenebuilder - powered by Ogre, presented by Qt, fueled by Passion.
OgreAddons - the Ogre code suppository.
FlorianGeorge
Halfling
Posts: 86
Joined: Tue Sep 01, 2009 7:15 pm
Location: Cologne, Germany
x 4

Re: OgreMain build failure

Post by FlorianGeorge »

mstoyke wrote:There is a known bug in VS2010 (sorry, don't have the link to the KB article anymore) that sometimes causes this behavior. It only happens sometimes, not deterministic at all. The best way to solve the problem is to restart VS2010, open the project again and only recompile all projects for the debug version. Then restart VS2010 and open the project again, this time the release version.

Furtunately I only had this problem with compiling the dependencies. Once I had compiled dependencies I could always use them to recompile all versions of Ogre without running into this problem again.
Thanks a lot. I had the _ITERATOR_DEBUG_LEVEL issue. I opened the OgreDependencies.VS2010.sln and switched the Solution Configuration from Debug to Release. Then I closed VS2010 and opened it again. Then I rebuilt (relinked would probably have been enough) the FreeImageLib Project for Release. No errors anymore.
JonKilborn
Gnoblar
Posts: 1
Joined: Tue Dec 29, 2015 2:04 pm

Re: OgreMain build failure

Post by JonKilborn »

Mawwen wrote:I came across and solved another build issue and thought I would share in case anyone comes across it. I get the error LNK2038: mismatch detected for '_ITERATOR_DEBUG_LEVEL': value '2' doesn't match value '0' bug for libboost_thread-vc100-mt-1_44.lib, when compiling in Debug mode. It should be using libboost_thread-vc100-mt-gd-1_44.lib.

I have CMake 2.8.3 and found out that the boost debug library detection in this version seems to be broken, according to this bug:

http://www.cmake.org/Bug/view.php?id=11363&nbn=3

The patch linked in the above URL shows the problem. A line is missing to detect -gd lib files for debug. So I opened up the FindBoost.cmake file in my CMake installation, manually applied the patch, deleted my CMake build output directory, did the CMake config/generation over again and the proper -gd library was detected for my VS2010 VC++ projects. According to the bug report, this issue should be fixed in CMake 2.8.4.

(Now I get a whole bunch of warnings: "warning LNK4099: PDB 'vc100.pdb' was not found with 'zziplibd.lib(zip.obj)' or at 'D:\Dev\Mogre\Main\OgreSrc\build\bin\Debug\vc100.pdb'; linking object as if no debug info", but since it's just a warning of missing debug info, I don't care.)
I'm having the same issue in VS2015. I've replaced all the missing library files but still doesn't work. If I try rebuilding does that mean I have to delete all the files and start again?
Last edited by JonKilborn on Fri Apr 15, 2016 4:10 pm, edited 1 time in total.
User avatar
c6burns
Beholder
Posts: 1512
Joined: Fri Feb 22, 2013 4:44 am
Location: Deep behind enemy lines
x 138

Re: OgreMain build failure

Post by c6burns »

You only get this error by mixing debug and release code. Are you building dependencies from source, and if so how?
Transporter
Minaton
Posts: 933
Joined: Mon Mar 05, 2012 11:37 am
Location: Germany
x 110

Re: OgreMain build failure

Post by Transporter »

There are some problems with older VS versions if you build FreeImage
Transporter wrote: 7. FreeImage: _ITERATOR_DEBUG_LEVEL bug
There are a few discussions about this VS bug. I like to share my quick & dirty solution here:
  1. Build the full FreeImage packet on Debug|Win32
  2. Build the full FreeImage packet on Debug|x64
  3. Switch actual configuration to Release|Win32
  4. Save the project map and close VS
  5. Delete all temporary folders of the project
  6. Start VS and load FreeImage project
  7. Build the full FreeImage packet on Release|Win32
  8. Build the full FreeImage packet on Release|x64
Also, the current source version of FreeImage has a bug in LibRawLite for static builds.
Post Reply