Index: /branches/shared_lib/src/Makefile.am
===================================================================
--- /branches/shared_lib/src/Makefile.am	(revision 7173)
+++ /branches/shared_lib/src/Makefile.am	(revision 7174)
@@ -13,5 +13,5 @@
 
 orxonox_CPPFLAGS = -DIS_ORXONOX
-orxonox_LDFLAGS =
+orxonox_LDFLAGS = -ldl -rdynamic
 
 orxonox_DEPENDENCIES = \
Index: /branches/shared_lib/src/orxonox.cc
===================================================================
--- /branches/shared_lib/src/orxonox.cc	(revision 7173)
+++ /branches/shared_lib/src/orxonox.cc	(revision 7174)
@@ -333,13 +333,8 @@
   delete[] imageDir;
 
-//   void* handle;
-//   handle = dlopen("./src/world_entities/.libs/libORXground_turret.so", RTLD_NOW);
-//   if(handle == NULL)
-//   {
-//     PRINTF(1)("unable to load %s\n", dlerror());
-//
-//     return false;
-//   }
-  DynamicLoader::loadDyLib("src/world_entities/.libs/libORXground_turret.so");
+  DynamicLoader::addSearchDirRelative("./world_entities");
+  DynamicLoader::addSearchDirRelative("./src/world_entities");
+
+  DynamicLoader::loadDyLib("libORXground_turret");
 
   // start the collision detection engine
Index: /branches/shared_lib/src/util/Makefile.am
===================================================================
--- /branches/shared_lib/src/util/Makefile.am	(revision 7173)
+++ /branches/shared_lib/src/util/Makefile.am	(revision 7174)
@@ -3,4 +3,5 @@
 
 noinst_LIBRARIES = libORXutils.a
+
 
 libORXutils_a_SOURCES = fast_factory.cc \
@@ -26,4 +27,5 @@
 			track/track_node.cc
 
+
 noinst_HEADERS =        fast_factory.h \
 			object_manager.h \
Index: /branches/shared_lib/src/util/loading/dynamic_loader.cc
===================================================================
--- /branches/shared_lib/src/util/loading/dynamic_loader.cc	(revision 7173)
+++ /branches/shared_lib/src/util/loading/dynamic_loader.cc	(revision 7174)
@@ -17,8 +17,7 @@
 
 #include "dynamic_loader.h"
-
+#include "resource_manager.h"
 
 using namespace std;
-
 
 /**
@@ -36,4 +35,18 @@
 }
 
+/**
+ * @brief initializes the Dynamic Library loader
+ * @returns true on succes, false otherwise
+ */
+bool DynamicLoader::initialize()
+{
+  if (lt_dlinit () != 0)
+  {
+    PRINTF(1)("Initializing LT_DL_LIB: %s\n", lt_dlerror());
+    return false;
+  }
+  else
+    return true;
+}
 
 /**
@@ -50,25 +63,18 @@
 bool DynamicLoader::loadDynamicLib(const std::string& libName)
 {
-  if (lt_dlinit () != 0)
-  {
-    PRINTF(1)("Initializing LT_DL_LIB\n");
-  }
-  this->handle = lt_dlopen(&libName[0]);
+  DynamicLoader::initialize();
+
+  this->handle = lt_dlopenext(&libName[0]);
   if(this->handle == NULL)
   {
     return false;
   }
-  //void *mkr = dlsym( this->handle, "maker");
 }
 
 bool DynamicLoader::loadDyLib(const char* libName)
 {
-  if (lt_dlinit () != 0)
-  {
-    PRINTF(1)("Initializing LT_DL_LIB\n");
-  }
-
+  DynamicLoader::initialize();
   void* handle;
-  handle = lt_dlopen(libName);
+  handle = lt_dlopenext(libName);
   if(handle == NULL)
   {
@@ -77,10 +83,37 @@
     return false;
   }
-//  void *mkr = dlsym("maker");
 
 }
 
+void DynamicLoader::addSearchDir(const char* searchDir)
+{
+  DynamicLoader::initialize();
 
-BaseObject* DynamicLoader::fabricateObject(const TiXmlElement* root) const
+  lt_dladdsearchdir(searchDir);
+}
+
+/**
+ * @param relSearchDir: the Relative directory to add to searchPath of lt_dl
+ * @returns true if the Path was Valid, false otherwise
+ */
+bool DynamicLoader::addSearchDirRelative(const char* relSearchDir)
 {
+  char* absSearchDir = ResourceManager::getAbsDir(relSearchDir);
+  if (ResourceManager::isDir(absSearchDir))
+  {
+    DynamicLoader::addSearchDir(absSearchDir);
+    delete[] absSearchDir;
+    return true;
+  }
+  else
+  {
+    delete[] absSearchDir;
+    return false;
+  }
 }
+
+
+const char* DynamicLoader::getSearchDir()
+{
+  return lt_dlgetsearchpath();
+}
Index: /branches/shared_lib/src/util/loading/dynamic_loader.h
===================================================================
--- /branches/shared_lib/src/util/loading/dynamic_loader.h	(revision 7173)
+++ /branches/shared_lib/src/util/loading/dynamic_loader.h	(revision 7174)
@@ -23,8 +23,15 @@
 
   bool loadDynamicLib(const std::string& libName);
-  virtual BaseObject* fabricateObject(const TiXmlElement* root = NULL) const;
 
   static bool loadDyLib(const char* libName);
 
+  static void addSearchDir(const char* searchDir);
+  static bool addSearchDirRelative(const char* relSearchDir);
+  static const char* getSearchDir();
+
+  static void unload();
+private:
+  // will be done automatically when using the this Engine.
+  static bool initialize();
 
 private:
Index: /branches/shared_lib/src/util/loading/resource_manager.cc
===================================================================
--- /branches/shared_lib/src/util/loading/resource_manager.cc	(revision 7173)
+++ /branches/shared_lib/src/util/loading/resource_manager.cc	(revision 7174)
@@ -62,4 +62,6 @@
   strcpy(this->dataDir, "./");
   this->tryDataDir("./data");
+
+  this->_cwd = NULL;
 }
 
@@ -86,5 +88,6 @@
 
   delete[] this->dataDir;
-
+  if (this->_cwd)
+    delete[] this->_cwd;
   ResourceManager::singletonRef = NULL;
 }
@@ -984,4 +987,30 @@
 
 /**
+ * @param name the relative name of the File/Directory.
+ * @returns a new char* with the name in abs-dir-format
+ */
+char* ResourceManager::getAbsDir(const char* name)
+{
+  if (name == NULL)
+    return NULL;
+  char* retName;
+  if (strncmp(name, "/", 1))
+  {
+    if (*name == '.' && *(name+1) != '.')
+      name++;
+    const char* absDir = ResourceManager::cwd();
+    retName = new char[strlen(absDir)+strlen(name)+1];
+    sprintf(retName, "%s%s", absDir, name);
+  }
+  else
+  {
+    retName = new char[strlen(name)+1];
+    strcpy(retName, name);
+  }
+  return retName;
+}
+
+
+/**
  * @param fileName the Name of the File to check
  * @returns The full name of the file, including the DataDir, and NULL if the file does not exist
@@ -1003,4 +1032,29 @@
     return NULL;
   }
+}
+
+#ifdef __unix__
+  #include <unistd.h>
+#elif __WIN32__ || _MS_DOS_
+  #include <dir.h>
+#else
+  #include <direct.h> /* Visual C++ */
+#endif
+/**
+ * @returns the Current Woring Directory
+ */
+const char* ResourceManager::cwd()
+{
+  if (ResourceManager::getInstance()->_cwd == NULL)
+  {
+    char cwd[1024];
+    char* errno = getcwd(cwd, 1024);
+    if (errno == 0)
+      return NULL;
+
+    ResourceManager::getInstance()->_cwd = new char[strlen(cwd)+1];
+    strcpy(ResourceManager::getInstance()->_cwd, cwd);
+  }
+  return ResourceManager::getInstance()->_cwd;
 }
 
Index: /branches/shared_lib/src/util/loading/resource_manager.h
===================================================================
--- /branches/shared_lib/src/util/loading/resource_manager.h	(revision 7173)
+++ /branches/shared_lib/src/util/loading/resource_manager.h	(revision 7174)
@@ -137,4 +137,6 @@
   static char* getFullName(const char* fileName);
   static bool isInDataDir(const char* fileName);
+  static char* getAbsDir(const char* fileName);
+  static const char* cwd();
 
   static const char* ResourceTypeToChar(ResourceType type);
@@ -149,4 +151,5 @@
   static ResourceManager*  singletonRef;       //!< singleton Reference
 
+  char*                    _cwd;               //!< The currend Working directory.
   char*                    dataDir;            //!< The Data Directory, where all relevant Data is stored.
   std::vector<char*>       imageDirs;          //!< A list of directories in which images are stored.
Index: /branches/shared_lib/src/world_entities/Makefile.am
===================================================================
--- /branches/shared_lib/src/world_entities/Makefile.am	(revision 7173)
+++ /branches/shared_lib/src/world_entities/Makefile.am	(revision 7174)
@@ -1,9 +1,7 @@
 MAINSRCDIR=..
 include $(MAINSRCDIR)/defs/include_paths.am
-include WorldEntities.am
+# include WorldEntities.am
 
 noinst_LIBRARIES = libORXwe.a
-lib_LTLIBRARIES = libORXground_turret.la
-libORXground_turret_la_SOURCES = npcs/ground_turret.cc
 
 ## THESE ARE THE BASE CLASSES OF ALL WORLD_ENTITIES
Index: /branches/shared_lib/src/world_entities/WorldEntities.am
===================================================================
--- /branches/shared_lib/src/world_entities/WorldEntities.am	(revision 7173)
+++ /branches/shared_lib/src/world_entities/WorldEntities.am	(revision 7174)
@@ -1,3 +1,8 @@
 ## THE SUBCLASSES. THESE MUST BE DYNAMICALLY LINKED OR COMPILED IN DIRECTLY
+
+pkglib_LTLIBRARIES = libORXground_turret.la
+libORXground_turret_la_SOURCES = world_entities/npcs/ground_turret.cc
+
+
 WorldEntities_SOURCES_ = \
 		world_entities/npcs/npc_test1.cc \
