Problem with STLport

Jan Bender
Posts: 111
Joined: Fri Sep 08, 2006 1:26 pm
Location: Germany

Problem with STLport

Post by Jan Bender »

Hi,

I want to integrate the collision detection of Bullet in my simulator. The problem is that I use STLport. If I compile the CollisionInterfaceDemo of Bullet with STLport then I get the following errors while linking:

Code: Select all

5>Linking...
5>libbulletcollision_d.lib(btCollisionWorld.obj) : error LNK2019: unresolved external symbol "public: static struct stlp_std::priv::_Rb_tree_node_base * __cdecl stlp_std::priv::_Rb_global<bool>::_M_increment(struct stlp_std::priv::_Rb_tree_node_base *)" (?_M_increment@?$_Rb_global@_N@priv@stlp_std@@SAPAU_Rb_tree_node_base@23@PAU423@@Z) referenced in function "public: struct stlp_std::priv::_Rb_tree_iterator<struct stlp_std::pair<class stlp_std::basic_string<char,class stlp_std::char_traits<char>,class stlp_std::allocator<char> > const ,struct hidden::ProfileBlock *>,struct stlp_std::priv::_MapTraitsT<struct stlp_std::pair<class stlp_std::basic_string<char,class stlp_std::char_traits<char>,class stlp_std::allocator<char> > const ,struct hidden::ProfileBlock *> > > & __thiscall stlp_std::priv::_Rb_tree_iterator<struct stlp_std::pair<class stlp_std::basic_string<char,class stlp_std::char_traits<char>,class stlp_std::allocator<char> > const ,struct hidden::ProfileBlock *>,struct stlp_std::priv::_MapTraitsT<struct stlp_std::pair<class stlp_std::basic_string<char,class stlp_std::char_traits<char>,class stlp_std::allocator<char> > const ,struct hidden::ProfileBlock *> > >::operator++(void)" (??E?$_Rb_tree_iterator@U?$pair@$$CBV?$basic_string@DV?$char_traits@D@stlp_std@@V?$allocator@D@2@@stlp_std@@PAUProfileBlock@hidden@@@stlp_std@@U?$_MapTraitsT@U?$pair@$$CBV?$basic_string@DV?$char_traits@D@stlp_std@@V?$allocator@D@2@@stlp_std@@PAUProfileBlock@hidden@@@stlp_std@@@priv@2@@priv@stlp_std@@QAEAAU012@XZ)
5>libbulletcollision_d.lib(btOverlappingPairCache.obj) : error LNK2001: unresolved external symbol "public: static struct stlp_std::priv::_Rb_tree_node_base * __cdecl stlp_std::priv::_Rb_global<bool>::_M_increment(struct stlp_std::priv::_Rb_tree_node_base *)" (?_M_increment@?$_Rb_global@_N@priv@stlp_std@@SAPAU_Rb_tree_node_base@23@PAU423@@Z)
5>libbulletopenglsupport_d.lib(DemoApplication.obj) : error LNK2001: unresolved external symbol "public: static struct stlp_std::priv::_Rb_tree_node_base * __cdecl stlp_std::priv::_Rb_global<bool>::_M_increment(struct stlp_std::priv::_Rb_tree_node_base *)" (?_M_increment@?$_Rb_global@_N@priv@stlp_std@@SAPAU_Rb_tree_node_base@23@PAU423@@Z)
5>libbulletcollision_d.lib(btCollisionWorld.obj) : error LNK2019: unresolved external symbol "public: static struct stlp_std::priv::_Rb_tree_node_base * __cdecl stlp_std::priv::_Rb_global<bool>::_M_decrement(struct stlp_std::priv::_Rb_tree_node_base *)" (?_M_decrement@?$_Rb_global@_N@priv@stlp_std@@SAPAU_Rb_tree_node_base@23@PAU423@@Z) referenced in function "public: struct stlp_std::priv::_Rb_tree_iterator<struct stlp_std::pair<class stlp_std::basic_string<char,class stlp_std::char_traits<char>,class stlp_std::allocator<char> > const ,struct hidden::ProfileBlock *>,struct stlp_std::priv::_MapTraitsT<struct stlp_std::pair<class stlp_std::basic_string<char,class stlp_std::char_traits<char>,class stlp_std::allocator<char> > const ,struct hidden::ProfileBlock *> > > & __thiscall stlp_std::priv::_Rb_tree_iterator<struct stlp_std::pair<class stlp_std::basic_string<char,class stlp_std::char_traits<char>,class stlp_std::allocator<char> > const ,struct hidden::ProfileBlock *>,struct stlp_std::priv::_MapTraitsT<struct stlp_std::pair<class stlp_std::basic_string<char,class stlp_std::char_traits<char>,class stlp_std::allocator<char> > const ,struct hidden::ProfileBlock *> > >::operator--(void)" (??F?$_Rb_tree_iterator@U?$pair@$$CBV?$basic_string@DV?$char_traits@D@stlp_std@@V?$allocator@D@2@@stlp_std@@PAUProfileBlock@hidden@@@stlp_std@@U?$_MapTraitsT@U?$pair@$$CBV?$basic_string@DV?$char_traits@D@stlp_std@@V?$allocator@D@2@@stlp_std@@PAUProfileBlock@hidden@@@stlp_std@@@priv@2@@priv@stlp_std@@QAEAAU012@XZ)
5>libbulletcollision_d.lib(btOverlappingPairCache.obj) : error LNK2001: unresolved external symbol "public: static struct stlp_std::priv::_Rb_tree_node_base * __cdecl stlp_std::priv::_Rb_global<bool>::_M_decrement(struct stlp_std::priv::_Rb_tree_node_base *)" (?_M_decrement@?$_Rb_global@_N@priv@stlp_std@@SAPAU_Rb_tree_node_base@23@PAU423@@Z)
5>libbulletopenglsupport_d.lib(DemoApplication.obj) : error LNK2001: unresolved external symbol "public: static struct stlp_std::priv::_Rb_tree_node_base * __cdecl stlp_std::priv::_Rb_global<bool>::_M_decrement(struct stlp_std::priv::_Rb_tree_node_base *)" (?_M_decrement@?$_Rb_global@_N@priv@stlp_std@@SAPAU_Rb_tree_node_base@23@PAU423@@Z)
5>libbulletcollision_d.lib(btCollisionWorld.obj) : error LNK2019: unresolved external symbol "public: static void __cdecl stlp_std::priv::_Rb_global<bool>::_Rebalance(struct stlp_std::priv::_Rb_tree_node_base *,struct stlp_std::priv::_Rb_tree_node_base * &)" (?_Rebalance@?$_Rb_global@_N@priv@stlp_std@@SAXPAU_Rb_tree_node_base@23@AAPAU423@@Z) referenced in function "private: struct stlp_std::priv::_Rb_tree_iterator<struct stlp_std::pair<class stlp_std::basic_string<char,class stlp_std::char_traits<char>,class stlp_std::allocator<char> > const ,struct hidden::ProfileBlock *>,struct stlp_std::priv::_MapTraitsT<struct stlp_std::pair<class stlp_std::basic_string<char,class stlp_std::char_traits<char>,class stlp_std::allocator<char> > const ,struct hidden::ProfileBlock *> > > __thiscall stlp_std::priv::_Rb_tree<class stlp_std::basic_string<char,class stlp_std::char_traits<char>,class stlp_std::allocator<char> >,struct stlp_std::less<class stlp_std::basic_string<char,class stlp_std::char_traits<char>,class stlp_std::allocator<char> > >,struct stlp_std::pair<class stlp_std::basic_string<char,class stlp_std::char_traits<char>,class stlp_std::allocator<char> > const ,struct hidden::ProfileBlock *>,struct stlp_std::priv::_Select1st<struct stlp_std::pair<class stlp_std::basic_string<char,class stlp_std::char_traits<char>,class stlp_std::allocator<char> > const ,struct hidden::ProfileBlock *> >,struct stlp_std::priv::_MapTraitsT<struct stlp_std::pair<class stlp_std::basic_string<char,class stlp_std::char_traits<char>,class stlp_std::allocator<char> > const ,struct hidden::ProfileBlock *> >,class stlp_std::allocator<struct stlp_std::pair<class stlp_std::basic_string<char,class stlp_std::char_traits<char>,class stlp_std::allocator<char> > const ,struct hidden::ProfileBlock *> > >::_M_insert(struct stlp_std::priv::_Rb_tree_node_base *,struct stlp_std::pair<class stlp_std::basic_string<char,class stlp_std::char_traits<char>,class stlp_std::allocator<char> > const ,struct hidden::ProfileBlock *> const &,struct stlp_std::priv::_Rb_tree_node_base *,struct stlp_std::priv::_Rb_tree_node_base *)" (?_M_insert@?$_Rb_tree@V?$basic_string@DV?$char_traits@D@stlp_std@@V?$allocator@D@2@@stlp_std@@U?$less@V?$basic_string@DV?$char_traits@D@stlp_std@@V?$allocator@D@2@@stlp_std@@@2@U?$pair@$$CBV?$basic_string@DV?$char_traits@D@stlp_std@@V?$allocator@D@2@@stlp_std@@PAUProfileBlock@hidden@@@2@U?$_Select1st@U?$pair@$$CBV?$basic_string@DV?$char_traits@D@stlp_std@@V?$allocator@D@2@@stlp_std@@PAUProfileBlock@hidden@@@stlp_std@@@priv@2@U?$_MapTraitsT@U?$pair@$$CBV?$basic_string@DV?$char_traits@D@stlp_std@@V?$allocator@D@2@@stlp_std@@PAUProfileBlock@hidden@@@stlp_std@@@62@V?$allocator@U?$pair@$$CBV?$basic_string@DV?$char_traits@D@stlp_std@@V?$allocator@D@2@@stlp_std@@PAUProfileBlock@hidden@@@stlp_std@@@2@@priv@stlp_std@@AAE?AU?$_Rb_tree_iterator@U?$pair@$$CBV?$basic_string@DV?$char_traits@D@stlp_std@@V?$allocator@D@2@@stlp_std@@PAUProfileBlock@hidden@@@stlp_std@@U?$_MapTraitsT@U?$pair@$$CBV?$basic_string@DV?$char_traits@D@stlp_std@@V?$allocator@D@2@@stlp_std@@PAUProfileBlock@hidden@@@stlp_std@@@priv@2@@23@PAU_Rb_tree_node_base@23@ABU?$pair@$$CBV?$basic_string@DV?$char_traits@D@stlp_std@@V?$allocator@D@2@@stlp_std@@PAUProfileBlock@hidden@@@3@00@Z)
5>libbulletcollision_d.lib(btOverlappingPairCache.obj) : error LNK2001: unresolved external symbol "public: static void __cdecl stlp_std::priv::_Rb_global<bool>::_Rebalance(struct stlp_std::priv::_Rb_tree_node_base *,struct stlp_std::priv::_Rb_tree_node_base * &)" (?_Rebalance@?$_Rb_global@_N@priv@stlp_std@@SAXPAU_Rb_tree_node_base@23@AAPAU423@@Z)
5>libbulletopenglsupport_d.lib(DemoApplication.obj) : error LNK2001: unresolved external symbol "public: static void __cdecl stlp_std::priv::_Rb_global<bool>::_Rebalance(struct stlp_std::priv::_Rb_tree_node_base *,struct stlp_std::priv::_Rb_tree_node_base * &)" (?_Rebalance@?$_Rb_global@_N@priv@stlp_std@@SAXPAU_Rb_tree_node_base@23@AAPAU423@@Z)
5>libbulletcollision_d.lib(btOverlappingPairCache.obj) : error LNK2019: unresolved external symbol "public: static struct stlp_std::priv::_Rb_tree_node_base * __cdecl stlp_std::priv::_Rb_global<bool>::_Rebalance_for_erase(struct stlp_std::priv::_Rb_tree_node_base *,struct stlp_std::priv::_Rb_tree_node_base * &,struct stlp_std::priv::_Rb_tree_node_base * &,struct stlp_std::priv::_Rb_tree_node_base * &)" (?_Rebalance_for_erase@?$_Rb_global@_N@priv@stlp_std@@SAPAU_Rb_tree_node_base@23@PAU423@AAPAU423@11@Z) referenced in function "public: void __thiscall stlp_std::priv::_Rb_tree<struct btBroadphasePair,struct stlp_std::less<struct btBroadphasePair>,struct btBroadphasePair,struct stlp_std::priv::_Identity<struct btBroadphasePair>,struct stlp_std::priv::_SetTraitsT<struct btBroadphasePair>,class stlp_std::allocator<struct btBroadphasePair> >::erase(struct stlp_std::priv::_Rb_tree_iterator<struct btBroadphasePair,struct stlp_std::priv::_SetTraitsT<struct btBroadphasePair> >)" (?erase@?$_Rb_tree@UbtBroadphasePair@@U?$less@UbtBroadphasePair@@@stlp_std@@U1@U?$_Identity@UbtBroadphasePair@@@priv@3@U?$_SetTraitsT@UbtBroadphasePair@@@53@V?$allocator@UbtBroadphasePair@@@3@@priv@stlp_std@@QAEXU?$_Rb_tree_iterator@UbtBroadphasePair@@U?$_SetTraitsT@UbtBroadphasePair@@@priv@stlp_std@@@23@@Z)
5>..\..\DebugCollisionInterfaceDemo.exe : fatal error LNK1120: 4 unresolved externals
Can anybody help me with this?

Thanks,

Jan
User avatar
Erwin Coumans
Site Admin
Posts: 4221
Joined: Sun Jun 26, 2005 6:43 pm
Location: California, USA

Post by Erwin Coumans »

Hi,

There are 2 possible solutions:

1: Just wait a few days, because I'm removing all dependencies to STL. There is very little STL use in Bullet, and I'm about to remove this entirely as soon as possible. The overlapping pair array is a std::set, which can better be replaced by an array (btAlignedObjectArray, which has a similar API to std::vector).

2: Make sure the STL Port include path comes _before_ any other include path, also in the Bullet projectfiles, otherwise it includes the system STL includes instead of STL Port. And then do a complete clean/rebuild ;-)
Are you sure that you are using the STLport include files, instead of the standard Visual C++ include files? You must add the ...\include\stlport directory to your include path, before any of the system includes. From INSTALL.WINDOWS:

If you're using STLport, also add the include files for STLport. (Note that you must add the include\stlport directory, not just "include".)

You don't need to explicitly link any STLport libraries -- the STLport headers take care of this (provided that you use them :)).
Please let me know if this helps,
Erwin
Jan Bender
Posts: 111
Joined: Fri Sep 08, 2006 1:26 pm
Location: Germany

Post by Jan Bender »

Hi,
1: Just wait a few days, because I'm removing all dependencies to STL. There is very little STL use in Bullet, and I'm about to remove this entirely as soon as possible. The overlapping pair array is a std::set, which can better be replaced by an array (btAlignedObjectArray, which has a similar API to std::vector).
Okay, I will wait for this.
2: Make sure the STL Port include path comes _before_ any other include path, also in the Bullet projectfiles, otherwise it includes the system STL includes instead of STL Port. And then do a complete clean/rebuild
I use STLport for a long time and I know very well how to use it :wink:

Jan
User avatar
Erwin Coumans
Site Admin
Posts: 4221
Joined: Sun Jun 26, 2005 6:43 pm
Location: California, USA

Post by Erwin Coumans »

Fixed. Bullet 2.44 doesn't rely on STL anymore.

Hope this helps :)
Erwin
Jan Bender
Posts: 111
Joined: Fri Sep 08, 2006 1:26 pm
Location: Germany

Post by Jan Bender »

Fixed. Bullet 2.44 doesn't rely on STL anymore.

Hope this helps
Oh yes, that helped a lot. Now it works :D

Thank you very much for this,

Jan
DevO
Posts: 95
Joined: Fri Mar 31, 2006 7:13 pm

Post by DevO »

Bullet without STL that is great!!!
Thanks Erwin and other who work on it.

Bus some problem are still there with
btQuickprof.h
I am getting a lot of errors and warnings until I have add WIN32_LEAN_AND_MEAN, NOWINRES, NOMCX, NOIME before <windows.h>

Could please add this lines being added to solve this problems.

Code: Select all

...
#if defined(WIN32) || defined(_WIN32)
	#define USE_WINDOWS_TIMERS

	#define WIN32_LEAN_AND_MEAN
	#define NOWINRES
	#define NOMCX
	#define NOIME
	#include <windows.h>
	#include <time.h>
#else
...