[solved] Question about build settings

scriptkid

08-08-2011 12:46:51

Hi,

I'm using the prebuilt 1.7.1. release of Python Ogre and am trying to get a custom Ogre Archive (plugin dll) to work with it. But Ogre crashes after it calls it. I'm compiling and linking to the same ogre files (1.7.1. sdk).

(To cut a (very) long story short, building Python-Ogre myself isn't an option anymore.)

My latest try is to know the exact build setting for Python-Ogre because the crash looks like a new/delete incompatibility between the Ogre DLL and my own. Is a team member willing to share the build settings, with which the official releases are build. Especially these files:

-OgreMain.vcproj
-OgreBuildSettings.h

Thanks a lot!
Patrick

Mohican

08-08-2011 13:26:56

The problem might be that the DLLs are built with different versions of Visual Studio.
I noticed myself when rebuilding RakNet that it would work with P-O 1.7.2 only if I built with VS9.0

scriptkid

08-08-2011 15:13:30

Thanks!

Well, the P-O 1.7.1 release (which i use) comes with vc9 boost dll, so i guess that the compiler is the same?

The main problem (IMO) is that i have a custom build, which relies on a diffent DLL then the one which goes with the LIB. That's asking for problems, i know. But i have ran out of options in building the whole lib myself. I once managed it, but somehow my own ogre DLL won't even load because of missing DLL's. (I checked with DependencyWalker but didn't find anything odd, except from the VC8 dependency which i mentioned in another thread).

Mohican

08-08-2011 15:58:28

Have you tried to read the file instructions-windows.txt in the trunk?
it's a step-by-step guide I wrote couple of months ago.
It is much more detailed than the Wiki.

scriptkid

08-08-2011 18:39:39

Thanks, i just found it. It includes a couple of lines which i had not done yet. Rebuilding...

scriptkid

08-08-2011 20:44:45

I was able to compile a debug build, but i still have the issue where my binaries depend on VC8, which causes a crash. Do you have some more advice? This is the callstack after the crash:


> msvcr80d.dll!operator delete(void * pUserData=0x02583e18) Line 54 + 0x10 bytes C++
msvcp80d.dll!std::allocator<char>::deallocate(char * _Ptr=0x02583e18, unsigned int __formal=32) Line 147 + 0x9 bytes C++
msvcp80d.dll!std::basic_string<char,std::char_traits<char>,std::allocator<char> >::_Tidy(bool _Built=true, unsigned int _Newsize=0) Line 2086 C++
msvcp80d.dll!std::basic_string<char,std::char_traits<char>,std::allocator<char> >::~basic_string<char,std::char_traits<char>,std::allocator<char> >() Line 916 C++
_ogre_.pyd!std::basic_string<char,std::char_traits<char>,std::allocator<char> >::`scalar deleting destructor'() + 0x10 bytes C++
_ogre_.pyd!boost::python::detail::value_destroyer<0>::execute<std::basic_string<char,std::char_traits<char>,std::allocator<char> > >() + 0xd bytes C++
_ogre_.pyd!boost::python::detail::destroy_referent_impl<std::basic_string<char,std::char_traits<char>,std::allocator<char> > const volatile >() + 0xc bytes C++
_ogre_.pyd!boost::python::detail::destroy_referent<std::basic_string<char,std::char_traits<char>,std::allocator<char> > const volatile &>() + 0xe bytes C++
_ogre_.pyd!boost::python::converter::rvalue_from_python_data<std::basic_string<char,std::char_traits<char>,std::allocator<char> > >::~rvalue_from_python_data<std::basic_string<char,std::char_traits<char>,std::allocator<char> > >() + 0x22 bytes C++
_ogre_.pyd!boost::python::converter::extract_rvalue<std::basic_string<char,std::char_traits<char>,std::allocator<char> > >::~extract_rvalue<std::basic_string<char,std::char_traits<char>,std::allocator<char> > >() + 0x38 bytes C++
_ogre_.pyd!boost::python::extract<std::basic_string<char,std::char_traits<char>,std::allocator<char> > >::~extract<std::basic_string<char,std::char_traits<char>,std::allocator<char> > >() + 0xf bytes C++
_ogre_.pyd!boost::python::indexing::mapping::register_value_type<boost::python::class_<stdext::hash_map<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,stdext::hash_map<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,Ogre::SharedPtr<Ogre::Resource>,stdext::hash_compare<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,std::less<std::basic_string<char,std::char_traits<char>,std::allocator<char> > > >,std::allocator<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> > const ,Ogre::SharedPtr<Ogre::Resource> > > >,stdext::hash_compare<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,std::less<std::basic_string<char,std::char_traits<char>,std::allocator<char> > > >,std::allocator<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> > const ,stdext::hash_map<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,Ogre::SharedPtr<Ogre::Resource>,stdext::hash_compare<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,std::less<std::basic_string<char,std::char_traits<char>,std::allocator<char> > > >,std::allocator<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> > const ,Ogre::SharedPtr<Ogre::Resource> > > > > > >,boost::python::detail::not_specified,boost::python::detail::not_specified,boost::python::detail::not_specified>,std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> > const ,stdext::hash_map<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,Ogre::SharedPtr<Ogre::Resource>,stdext::hash_compare<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,std::less<std::basic_string<char,std::char_traits<char>,std::allocator<char> > > >,std::allocator<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> > const ,Ogre::SharedPtr<Ogre::Resource> > > > >,boost::python::return_value_policy<boost::python::return_by_value,boost::python::default_call_policies> >() + 0xb5 bytes C++
_ogre_.pyd! ?? :: ?? ::visit_container_class<boost::python::class_<stdext::hash_map<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,stdext::hash_map<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,Ogre::SharedPtr<Ogre::Resource>,stdext::hash_compare<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,std::less<std::basic_string<char,std::char_traits<char>,std::allocator<char> > > >,std::allocator<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> > const ,Ogre::SharedPtr<Ogre::Resource> > > >,stdext::hash_compare<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,std::less<std::basic_string<char,std::char_traits<char>,std::allocator<char> > > >,std::allocator<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> > const ,stdext::hash_map<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,Ogre::SharedPtr<Ogre::Resource>,stdext::hash_compare<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,std::less<std::basic_string<char,std::char_traits<char>,std::allocator<char> > > >,std::allocator<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> > const ,Ogre::SharedPtr<Ogre::Resource> > > > > > >,boost::python::detail::not_specified,boost::python::detail::not_specified,boost::python::detail::not_specified>,boost::python::return_value_policy<boost::python::return_by_value,boost::python::default_call_policies> >() + 0x31 bytes C++
_ogre_.pyd! ?? :: ?? ::visit<boost::python::class_<stdext::hash_map<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,stdext::hash_map<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,Ogre::SharedPtr<Ogre::Resource>,stdext::hash_compare<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,std::less<std::basic_string<char,std::char_traits<char>,std::allocator<char> > > >,std::allocator<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> > const ,Ogre::SharedPtr<Ogre::Resource> > > >,stdext::hash_compare<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,std::less<std::basic_string<char,std::char_traits<char>,std::allocator<char> > > >,std::allocator<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> > const ,stdext::hash_map<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,Ogre::SharedPtr<Ogre::Resource>,stdext::hash_compare<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,std::less<std::basic_string<char,std::char_traits<char>,std::allocator<char> > > >,std::allocator<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> > const ,Ogre::SharedPtr<Ogre::Resource> > > > > > >,boost::python::detail::not_specified,boost::python::detail::not_specified,boost::python::detail::not_specified> >() + 0x176 bytes C++
_ogre_.pyd!visit< ?? :: ?? >() + 0x16 bytes C++
_ogre_.pyd! ?? :: ?? ::visit<boost::python::class_<stdext::hash_map<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,stdext::hash_map<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,Ogre::SharedPtr<Ogre::Resource>,stdext::hash_compare<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,std::less<std::basic_string<char,std::char_traits<char>,std::allocator<char> > > >,std::allocator<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> > const ,Ogre::SharedPtr<Ogre::Resource> > > >,stdext::hash_compare<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,std::less<std::basic_string<char,std::char_traits<char>,std::allocator<char> > > >,std::allocator<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> > const ,stdext::hash_map<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,Ogre::SharedPtr<Ogre::Resource>,stdext::hash_compare<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,std::less<std::basic_string<char,std::char_traits<char>,std::allocator<char> > > >,std::allocator<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> > const ,Ogre::SharedPtr<Ogre::Resource> > > > > > >,boost::python::detail::not_specified,boost::python::detail::not_specified,boost::python::detail::not_specified> >() + 0x14 bytes C++
_ogre_.pyd!??$def@V?$visitor@V?$map_algorithms@V?$map_traits@V?$hash_map@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@V?$hash_map@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@V?$SharedPtr@VResource@Ogre@@@Ogre@@V?$hash_compare@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@U?$less@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@2@@stdext@@V?$allocator@U?$pair@$$CBV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@V?$SharedPtr@VResource@Ogre@@@Ogre@@@std@@@2@@stdext@@V?$hash_compare@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@U?$less@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@2@@4@V?$allocator@U?$pair@$$CBV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@V?$hash_map@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@V?$SharedPtr@VResource@Ogre@@@Ogre@@V?$hash_compare@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@U?$less@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@2@@stdext@@V?$allocator@U?$pair@$$CBV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@V?$SharedPtr@VResource@Ogre@@@Ogre@@@std@@@2@@stdext@@@std@@@2@@stdext@@@indexing@python@boost@@Uno_override@detail@234@@indexing@python@boost@@U?$return_value_policy@Ureturn_by_value@python@boost@@Udefault_call_policies@23@@34@$0PPPPPPPP@@indexing@python@boost@@@?$class_@V?$hash_map@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@V?$hash_map@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@V?$SharedPtr@VResource@Ogre@@@Ogre@@V?$hash_compare@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@U?$less@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@2@@stdext@@V?$allocator@U?$pair@$$CBV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@V?$SharedPtr@VResource@Ogre@@@Ogre@@@std@@@2@@stdext@@V?$hash_compare@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@U?$less@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@2@@4@V?() + 0x13 bytes C++
_ogre_.pyd!register_ResourceWithGroupMap_class() + 0x5c bytes C++
_ogre_.pyd!init_module__ogre_() + 0x37 bytes C++
boost_python-vc90-mt-gd-1_45.dll!boost::detail::function::void_function_ref_invoker0<void (__cdecl*)(void),void>::invoke(boost::detail::function::function_buffer & function_obj_ptr={...}) Line 189 C++
boost_python-vc90-mt-gd-1_45.dll!boost::function0<void>::operator()() Line 1013 + 0x14 bytes C++
boost_python-vc90-mt-gd-1_45.dll!boost::python::handle_exception_impl(boost::function0<void> f={...}) Line 26 C++
boost_python-vc90-mt-gd-1_45.dll!boost::python::handle_exception<void (__cdecl*)(void)>(void (void)* f=0x1223ed80) Line 29 + 0x2c bytes C++
boost_python-vc90-mt-gd-1_45.dll!boost::python::detail::init_module(const char * name=0x12d94a6c, void (void)* init_function=0x1223ed80) Line 53 + 0x9 bytes C++
_ogre_.pyd!_init_ogre_() + 0x13 bytes C++
python26.dll!1e028ed7()


As you can see, the code 'starts' with the boost VC9 dll, but tries to delete something in VC8...

Thanks again for any input!

scriptkid

09-08-2011 10:18:42

I have again checked _ogre_.pyd in DependencyWalker. The dependency for MSVCP80D.DLL and MSVCR80D.DLL does not com from python itself, that seems to be compiled with VC9 (it depends on MSVCR90.DLL).

dermont

09-08-2011 10:25:58

It looks like you have more than one version of Visual Studio installed and the build is mixing up the versions of Visual Studio 2005 and 2008 somewhere along the line.

Obvious things that you can check for are:

1) The correct version of mt.exe is being picked up when embedding the manifest, see the SContruct file for the mt.exe command.

2) Scons is picking up the correct versions of includes/libs/tools for Visual Studio 2008. Check your PATH to make sure VS 2008 is being picked up first; better to run python-ogre build commands from the VS2008 command prompt.

There are also commands here that show how to pass paths directly to scons (never tried this but could try as last resort)
http://code.google.com/p/v8/wiki/BuildingOnWindows

3) Check each of the base libs such as Ogre with dependency walker (I'm sure you have already done this).

Also you shouldn't be modifying the OgreBuildSettings.h defines after building Ogre; If you need to disable something such as the "Boost extensions" then do so via the cmake gui/advanced options or adding -DOGRE_USE_BOOST=FALSE to your cmake command line.

scriptkid

09-08-2011 16:06:38

Hi,

Yes i have multiple VS´s installed. The mt.exe is called after the actual manifest creation (so it seems). I think that the manifest is part of the linking stage. But indeed it contains the VC8 dependency!

So now i am again checking all my paths and so on. Thanks for the link about the scons environment. I added some stuff to the scons spawn command, but it doesn't give any visual feedback, so i have little idea whether the arguments are actually applied.

Right now i am reading some more about scons.

scriptkid

10-08-2011 14:11:16

Hi again!

It seems that i was on the right track yesterday, but only tried to recompile. Today i also regenerated the code (-g) and now the DLL / PYD only relies on VC9 which is good!

Thanks again for the manifest heads-up, that pointed me (a little more) into the right direction on my problem.

No onto the next step, getting those demos to run :)