Index: trunk/ab5.0/abdev/ab_common/ab_common.vcproj
===================================================================
--- trunk/ab5.0/abdev/ab_common/ab_common.vcproj	(revision 636)
+++ trunk/ab5.0/abdev/ab_common/ab_common.vcproj	(revision 637)
@@ -530,4 +530,8 @@
 				</File>
 				<File
+					RelativePath=".\include\Lexical\RelationalObjectModuleItem.h"
+					>
+				</File>
+				<File
 					RelativePath=".\include\Lexical\Source.h"
 					>
Index: trunk/ab5.0/abdev/ab_common/include/Environment.h
===================================================================
--- trunk/ab5.0/abdev/ab_common/include/Environment.h	(revision 636)
+++ trunk/ab5.0/abdev/ab_common/include/Environment.h	(revision 637)
@@ -27,4 +27,5 @@
 {
 	static std::string rootPath;
+	static bool isRemoveExternal;
 public:
 	static void SetAbdevRootPath( const std::string &rootPath );
@@ -38,4 +39,13 @@
 
 	static const std::string GetCompilerExePath( Platform::EnumType platform );
+
+	static bool IsRemoveExternal()
+	{
+		return isRemoveExternal;
+	}
+	static void SetRemoveExternalMark( bool isRemoveExternalMark )
+	{
+		Environment::isRemoveExternal = isRemoveExternalMark;
+	}
 };
 
Index: trunk/ab5.0/abdev/ab_common/include/Lexical/Class.h
===================================================================
--- trunk/ab5.0/abdev/ab_common/include/Lexical/Class.h	(revision 636)
+++ trunk/ab5.0/abdev/ab_common/include/Lexical/Class.h	(revision 637)
@@ -18,6 +18,6 @@
 
 public:
-	ClassPrototype( const NamespaceScopes &namespaceScopes, const std::string &name )
-		: Prototype( namespaceScopes, name )
+	ClassPrototype( const Symbol &symbol )
+		: Prototype( symbol )
 		, DynamicMethodsPrototype()
 	{
@@ -92,4 +92,14 @@
 
 		ar & BOOST_SERIALIZATION_BASE_OBJECT_NVP( ClassPrototype );
+
+		if( ActiveBasic::Common::Environment::IsRemoveExternal() )
+		{
+			if( this->IsExternal() )
+			{
+				this->NeedResolve();
+				return;
+			}
+		}
+
 		ar & BOOST_SERIALIZATION_NVP( classType );
 		ar & BOOST_SERIALIZATION_NVP( importedNamespaces );
@@ -112,8 +122,8 @@
 public:
 
-	CClass( const NamespaceScopes &namespaceScopes, const NamespaceScopesCollection &importedNamespaces, const std::string &name );
-	CClass( const NamespaceScopes &namespaceScopes,
+	CClass( const Symbol &symbol, const NamespaceScopesCollection &importedNamespaces );
+	CClass( const Symbol &symbol,
 		const NamespaceScopesCollection &importedNamespaces,
-		const std::string &name, ClassType classType,
+		ClassType classType,
 		const GenericTypes &formalGenericTypes,
 		const Types &superClassActualTypeParameters,
@@ -455,4 +465,6 @@
 	std::string GetStaticDefiningStringAsMemberOffsets() const;
 	void GetReferenceOffsetsInitializeBuffer( std::string &referenceOffsetsBuffer, int &numOfReference, int baseOffset = 0 ) const;
+
+	virtual bool Resolve();
 };
 
Index: trunk/ab5.0/abdev/ab_common/include/Lexical/Const.h
===================================================================
--- trunk/ab5.0/abdev/ab_common/include/Lexical/Const.h	(revision 636)
+++ trunk/ab5.0/abdev/ab_common/include/Lexical/Const.h	(revision 637)
@@ -2,5 +2,7 @@
 
 //定数
-class CConst : public Symbol, public Jenga::Common::ObjectInHashmap<CConst>
+class CConst
+	: public RelationalObjectModuleItem
+	, public Jenga::Common::ObjectInHashmap<CConst>
 {
 	Type type;
@@ -14,5 +16,15 @@
 		trace_for_serialize( "serializing - CConst" );
 
-		ar & BOOST_SERIALIZATION_BASE_OBJECT_NVP( Symbol );
+		ar & BOOST_SERIALIZATION_BASE_OBJECT_NVP( RelationalObjectModuleItem );
+
+		if( ActiveBasic::Common::Environment::IsRemoveExternal() )
+		{
+			if( this->IsExternal() )
+			{
+				this->NeedResolve();
+				return;
+			}
+		}
+
 		ar & BOOST_SERIALIZATION_NVP( type );
 		ar & BOOST_SERIALIZATION_NVP( i64data );
@@ -20,12 +32,12 @@
 
 public:
-	CConst( const NamespaceScopes &namespaceScopes, const std::string &name, const Type &newType, _int64 i64data)
-		: Symbol( namespaceScopes, name )
+	CConst( const Symbol &symbol, const Type &newType, _int64 i64data)
+		: RelationalObjectModuleItem( symbol )
 		, type( newType )
 		, i64data( i64data )
 	{
 	}
-	CConst( const NamespaceScopes &namespaceScopes, const std::string &name, int value)
-		: Symbol( namespaceScopes, name )
+	CConst( const Symbol &symbol, int value)
+		: RelationalObjectModuleItem( symbol )
 		, type( Type(DEF_LONG) )
 		, i64data( value )
@@ -53,4 +65,6 @@
 	}
 	double GetDoubleData();
+
+	virtual bool Resolve();
 };
 class Consts : public Jenga::Common::Hashmap<CConst>
@@ -69,6 +83,6 @@
 public:
 
-	void Add( const NamespaceScopes &namespaceScopes, const std::string &name, _int64 i64data, const Type &type );
-	void Add( const NamespaceScopes &namespaceScopes, const std::string &name, int value);
+	void Add( const Symbol &symbol, _int64 i64data, const Type &type );
+	void Add( const Symbol &symbol, int value);
 
 private:
@@ -83,5 +97,7 @@
 
 //定数マクロ
-class ConstMacro : public Symbol, public Jenga::Common::ObjectInHashmap<ConstMacro>
+class ConstMacro
+	: public RelationalObjectModuleItem
+	, public Jenga::Common::ObjectInHashmap<ConstMacro>
 {
 	std::vector<std::string> parameters;
@@ -95,5 +111,15 @@
 		trace_for_serialize( "serializing - ConstMacro" );
 
-		ar & BOOST_SERIALIZATION_BASE_OBJECT_NVP( Symbol );
+		ar & BOOST_SERIALIZATION_BASE_OBJECT_NVP( RelationalObjectModuleItem );
+
+		if( ActiveBasic::Common::Environment::IsRemoveExternal() )
+		{
+			if( this->IsExternal() )
+			{
+				this->NeedResolve();
+				return;
+			}
+		}
+
 		ar & BOOST_SERIALIZATION_NVP( parameters );
 		ar & BOOST_SERIALIZATION_NVP( expression );
@@ -101,6 +127,6 @@
 
 public:
-	ConstMacro( const NamespaceScopes &namespaceScopes, const std::string &name, const std::vector<std::string> &parameters, const std::string &expression )
-		: Symbol( namespaceScopes, name )
+	ConstMacro( const Symbol &symbol, const std::vector<std::string> &parameters, const std::string &expression )
+		: RelationalObjectModuleItem( symbol )
 		, parameters( parameters )
 		, expression( expression )
@@ -127,6 +153,9 @@
 		return expression;
 	}
+
+	virtual bool Resolve();
 };
-class ConstMacros : public Jenga::Common::Hashmap<ConstMacro>
+class ConstMacros
+	: public Jenga::Common::Hashmap<ConstMacro>
 {
 	// XMLシリアライズ用
@@ -142,5 +171,5 @@
 
 public:
-	bool Add( const NamespaceScopes &namespaceScopes, const std::string &name, const char *parameterStr );
+	bool Add( const Symbol &symbol, const char *parameterStr );
 	ConstMacro *Find( const Symbol &name );
 };
Index: trunk/ab5.0/abdev/ab_common/include/Lexical/DataTable.h
===================================================================
--- trunk/ab5.0/abdev/ab_common/include/Lexical/DataTable.h	(revision 636)
+++ trunk/ab5.0/abdev/ab_common/include/Lexical/DataTable.h	(revision 637)
@@ -149,3 +149,5 @@
 
 	void ResetDataSectionBaseOffset( long dataSectionBaseOffset );
+
+	void Resolve();
 };
Index: trunk/ab5.0/abdev/ab_common/include/Lexical/Delegate.h
===================================================================
--- trunk/ab5.0/abdev/ab_common/include/Lexical/Delegate.h	(revision 636)
+++ trunk/ab5.0/abdev/ab_common/include/Lexical/Delegate.h	(revision 637)
@@ -22,4 +22,14 @@
 
 		ar & BOOST_SERIALIZATION_BASE_OBJECT_NVP( Procedure );
+
+		if( ActiveBasic::Common::Environment::IsRemoveExternal() )
+		{
+			if( this->IsExternal() )
+			{
+				this->NeedResolve();
+				return;
+			}
+		}
+
 		ar & BOOST_SERIALIZATION_NVP( importedNamespaces );
 		ar & BOOST_SERIALIZATION_NVP( dynamicParams );
@@ -27,6 +37,6 @@
 
 public:
-	Delegate( const NamespaceScopes &namespaceScopes, const NamespaceScopesCollection &importedNamespaces, const std::string &name, Procedure::Kind procKind, const char *paramStr, const std::string &returnTypeName, int sourceIndex )
-		: Procedure( namespaceScopes, name, procKind, false )
+	Delegate( const Symbol &symbol, const NamespaceScopesCollection &importedNamespaces, Procedure::Kind procKind, const char *paramStr, const std::string &returnTypeName, int sourceIndex )
+		: Procedure( symbol, procKind, false )
 		, importedNamespaces( importedNamespaces )
 		, paramStr( paramStr )
@@ -81,4 +91,6 @@
 	*/
 	bool IsSimilar( const Delegate &dgt ) const;
+
+	virtual bool Resolve();
 };
 typedef Jenga::Common::Hashmap<Delegate> Delegates;
Index: trunk/ab5.0/abdev/ab_common/include/Lexical/Meta.h
===================================================================
--- trunk/ab5.0/abdev/ab_common/include/Lexical/Meta.h	(revision 636)
+++ trunk/ab5.0/abdev/ab_common/include/Lexical/Meta.h	(revision 637)
@@ -157,3 +157,5 @@
 
 	const CClass *FindClassSupportedTypeDef( const Symbol &symbol );
+
+	void Resolve();
 };
Index: trunk/ab5.0/abdev/ab_common/include/Lexical/NativeCode.h
===================================================================
--- trunk/ab5.0/abdev/ab_common/include/Lexical/NativeCode.h	(revision 636)
+++ trunk/ab5.0/abdev/ab_common/include/Lexical/NativeCode.h	(revision 637)
@@ -123,9 +123,7 @@
 class SourceLine
 {
-	int lineNum;
 	long nativeCodePos;
-	int relationalObjectModuleIndex;
-	long sourceCodePos;
 	DWORD codeType;
+	SourceCodePosition sourceCodePosition;
 
 	// XMLシリアライズ用
@@ -136,18 +134,14 @@
 		trace_for_serialize( "serializing - SourceLine" );
 
-		ar & BOOST_SERIALIZATION_NVP( lineNum );
 		ar & BOOST_SERIALIZATION_NVP( nativeCodePos );
-		ar & BOOST_SERIALIZATION_NVP( relationalObjectModuleIndex );
-		ar & BOOST_SERIALIZATION_NVP( sourceCodePos );
 		ar & BOOST_SERIALIZATION_NVP( codeType );
-	}
-
-public:
-	SourceLine( int lineNum, int nativeCodePos, int relationalObjectModuleIndex, int sourceCodePos, DWORD codeType )
-		: lineNum( lineNum )
-		, nativeCodePos( nativeCodePos )
-		, relationalObjectModuleIndex( relationalObjectModuleIndex )
-		, sourceCodePos( sourceCodePos )
+		ar & BOOST_SERIALIZATION_NVP( sourceCodePosition );
+	}
+
+public:
+	SourceLine( int nativeCodePos, DWORD codeType, const SourceCodePosition &sourceCodePosition )
+		: nativeCodePos( nativeCodePos )
 		, codeType( codeType )
+		, sourceCodePosition( sourceCodePosition )
 	{
 	}
@@ -156,31 +150,23 @@
 	}
 
-	int GetLineNum() const
-	{
-		return lineNum;
-	}
 	long GetNativeCodePos() const
 	{
 		return nativeCodePos;
 	}
-	int GetRelationalObjectModuleIndex() const
-	{
-		return relationalObjectModuleIndex;
-	}
-	void SetRelationalObjectModuleIndex( int relationalObjectModuleIndex )
-	{
-		this->relationalObjectModuleIndex = relationalObjectModuleIndex;
-	}
-	long GetSourceCodePos() const
-	{
-		return sourceCodePos;
-	}
-	void SetSourceCodePos( int sourceCodePos )
-	{
-		this->sourceCodePos = sourceCodePos;
-	}
 	DWORD GetCodeType() const
 	{
 		return codeType;
+	}
+	const SourceCodePosition &GetSourceCodePosition() const
+	{
+		return sourceCodePosition;
+	}
+	SourceCodePosition &GetSourceCodePosition()
+	{
+		return sourceCodePosition;
+	}
+	void SetSourceCodePosition( const SourceCodePosition &sourceCodePosition )
+	{
+		this->sourceCodePosition = sourceCodePosition;
 	}
 	bool IsInSystemProc() const
@@ -256,7 +242,9 @@
 		return sourceLines;
 	}
-	void NextSourceLine( int currentSourceIndex, int nowLine );
+	void NextSourceLine( const SourceCodePosition &sourceCodePosition );
 
 	void ResetDataSectionBaseOffset( long dataSectionBaseOffset );
-	void ResetSourceIndexes( const std::vector<int> &relationTable );
+	void ResetRelationalObjectModuleIndex( const std::vector<int> &relationTable );
+
+	void Resolve();
 };
Index: trunk/ab5.0/abdev/ab_common/include/Lexical/ObjectModule.h
===================================================================
--- trunk/ab5.0/abdev/ab_common/include/Lexical/ObjectModule.h	(revision 636)
+++ trunk/ab5.0/abdev/ab_common/include/Lexical/ObjectModule.h	(revision 637)
@@ -43,5 +43,4 @@
 
 public:
-	void StaticLink( ObjectModule &objectModule );
 
 	const std::string &GetName() const
@@ -62,4 +61,10 @@
 	}
 
+	// 静的リンクを行う
+	void StaticLink( ObjectModule &objectModule, bool isSll );
+
+	// 依存関係の解決を行う
+	void Resolve();
+
 	// 下記の関連になるようなテーブルを取得する
 	// 要素 = 古いインデックス、値 = 新しいインデックス
Index: trunk/ab5.0/abdev/ab_common/include/Lexical/Procedure.h
===================================================================
--- trunk/ab5.0/abdev/ab_common/include/Lexical/Procedure.h	(revision 636)
+++ trunk/ab5.0/abdev/ab_common/include/Lexical/Procedure.h	(revision 637)
@@ -1,5 +1,6 @@
 #pragma once
 
-class Procedure : public Symbol
+class Procedure
+	: public RelationalObjectModuleItem
 {
 public:
@@ -35,5 +36,5 @@
 		trace_for_serialize( "serializing - Procedure" );
 
-		ar & BOOST_SERIALIZATION_BASE_OBJECT_NVP( Symbol );
+		ar & BOOST_SERIALIZATION_BASE_OBJECT_NVP( RelationalObjectModuleItem );
 		ar & BOOST_SERIALIZATION_NVP( kind );
 		ar & BOOST_SERIALIZATION_NVP( isCdecl );
@@ -45,6 +46,6 @@
 
 public:
-	Procedure( const NamespaceScopes &namespaceScopes, const std::string &name, Kind kind, bool isCdecl )
-		: Symbol( namespaceScopes, name )
+	Procedure( const Symbol &symbol, Kind kind, bool isCdecl )
+		: RelationalObjectModuleItem( symbol )
 		, kind( kind )
 		, isCdecl( isCdecl )
@@ -91,4 +92,5 @@
 		this->sourceCodePosition = sourceCodePosition;
 	}
+	virtual void ResetRelationalObjectModuleIndex( const std::vector<int> &relationTable );
 
 	const Parameters &Params() const
@@ -156,4 +158,14 @@
 
 		ar & BOOST_SERIALIZATION_BASE_OBJECT_NVP( Procedure );
+
+		if( ActiveBasic::Common::Environment::IsRemoveExternal() )
+		{
+			if( this->IsExternal() )
+			{
+				this->NeedResolve();
+				return;
+			}
+		}
+
 		ar & BOOST_SERIALIZATION_NVP( _paramStr );
 		ar & BOOST_SERIALIZATION_NVP( importedNamespaces );
@@ -178,5 +190,5 @@
 public:
 
-	UserProc( const NamespaceScopes &namespaceScopes, const NamespaceScopesCollection &importedNamespaces, const std::string &name, Kind kind, bool isMacro, bool isCdecl, bool isExport );
+	UserProc( const Symbol &symbol, const NamespaceScopesCollection &importedNamespaces, Kind kind, bool isMacro, bool isCdecl, bool isExport );
 	UserProc( const UserProc &userProc, const CClass *pParentClass );
 	UserProc();
@@ -206,4 +218,6 @@
 	}
 
+	virtual void ResetRelationalObjectModuleIndex( const std::vector<int> &relationTable );
+
 	/*!
 	@brief	オーバーライド用に関数同士が等しいかどうかをチェックする
@@ -360,4 +374,5 @@
 	const CMethod &GetMethod() const;
 
+	virtual bool Resolve();
 
 	static const UserProc *pGlobalProc;
@@ -389,5 +404,7 @@
 };
 
-class DllProc : public Procedure, public Jenga::Common::ObjectInHashmap<DllProc>
+class DllProc
+	: public Procedure
+	, public Jenga::Common::ObjectInHashmap<DllProc>
 {
 	std::string dllFileName;
@@ -403,4 +420,14 @@
 
 		ar & BOOST_SERIALIZATION_BASE_OBJECT_NVP( Procedure );
+
+		if( ActiveBasic::Common::Environment::IsRemoveExternal() )
+		{
+			if( this->IsExternal() )
+			{
+				this->NeedResolve();
+				return;
+			}
+		}
+
 		ar & BOOST_SERIALIZATION_NVP( dllFileName );
 		ar & BOOST_SERIALIZATION_NVP( alias );
@@ -409,6 +436,6 @@
 
 public:
-	DllProc( const NamespaceScopes &namespaceScopes, const std::string &name, Kind kind, bool isCdecl, const std::string &dllFileName, const std::string &alias )
-		: Procedure( namespaceScopes, name, kind, isCdecl )
+	DllProc( const Symbol &symbol, Kind kind, bool isCdecl, const std::string &dllFileName, const std::string &alias )
+		: Procedure( symbol, kind, isCdecl )
 		, dllFileName( dllFileName )
 		, alias( alias )
@@ -454,4 +481,6 @@
 		return lookupAddress;
 	}
+
+	virtual bool Resolve();
 };
 class DllProcs : public Jenga::Common::Hashmap<DllProc>
@@ -469,5 +498,6 @@
 };
 
-class ProcPointer : public Procedure
+class ProcPointer
+	: public Procedure
 {
 	// XMLシリアライズ用
@@ -483,5 +513,5 @@
 public:
 	ProcPointer( Kind kind )
-		: Procedure( NamespaceScopes(), std::string(), kind, false )
+		: Procedure( Symbol( NamespaceScopes(), std::string() ), kind, false )
 	{
 	}
@@ -489,5 +519,9 @@
 	{
 	}
-	~ProcPointer(){}
+	~ProcPointer()
+	{
+	}
+
+	virtual bool Resolve();
 };
 
Index: trunk/ab5.0/abdev/ab_common/include/Lexical/Prototype.h
===================================================================
--- trunk/ab5.0/abdev/ab_common/include/Lexical/Prototype.h	(revision 636)
+++ trunk/ab5.0/abdev/ab_common/include/Lexical/Prototype.h	(revision 637)
@@ -4,5 +4,6 @@
 
 
-class Prototype : public Symbol
+class Prototype
+	: public RelationalObjectModuleItem
 {
 public:
@@ -23,5 +24,5 @@
 	template<class Archive> void serialize(Archive& ar, const unsigned int version)
 	{
-		ar & BOOST_SERIALIZATION_BASE_OBJECT_NVP( Symbol );
+		ar & BOOST_SERIALIZATION_BASE_OBJECT_NVP( RelationalObjectModuleItem );
 		ar & BOOST_SERIALIZATION_NVP( isUsing );
 	}
@@ -30,11 +31,10 @@
 public:
 
-	Prototype( const NamespaceScopes &namespaceScopes, const std::string &name )
-		: Symbol( namespaceScopes, name )
+	Prototype( const Symbol &symbol )
+		: RelationalObjectModuleItem( symbol )
 		, isUsing( false )
 	{
 	}
 	Prototype()
-		: Symbol()
 	{
 	}
Index: trunk/ab5.0/abdev/ab_common/include/Lexical/RelationalObjectModuleItem.h
===================================================================
--- trunk/ab5.0/abdev/ab_common/include/Lexical/RelationalObjectModuleItem.h	(revision 637)
+++ trunk/ab5.0/abdev/ab_common/include/Lexical/RelationalObjectModuleItem.h	(revision 637)
@@ -0,0 +1,72 @@
+#pragma once
+
+namespace ActiveBasic{ namespace Common{ namespace Lexical{
+
+
+class RelationalObjectModuleItem
+	: public Symbol
+{
+	int relationalObjectModuleIndex;
+
+	// XMLシリアライズ用
+private:
+	friend class boost::serialization::access;
+	template<class Archive> void serialize(Archive& ar, const unsigned int version)
+	{
+		ar & BOOST_SERIALIZATION_BASE_OBJECT_NVP( Symbol );
+		ar & BOOST_SERIALIZATION_NVP( relationalObjectModuleIndex );
+	}
+
+public:
+	RelationalObjectModuleItem( const RelationalObjectModuleItem &relationalObjectModuleItem )
+		: Symbol( relationalObjectModuleItem )
+		, relationalObjectModuleIndex( relationalObjectModuleItem.relationalObjectModuleIndex )
+		, isNeedResolve( false )
+	{
+	}
+	RelationalObjectModuleItem( const Symbol &symbol )
+		: Symbol( symbol )
+		, relationalObjectModuleIndex( 0 )
+		, isNeedResolve( false )
+	{
+	}
+	RelationalObjectModuleItem()
+		: relationalObjectModuleIndex( -1 )
+		, isNeedResolve( false )
+	{
+	}
+
+	int GetRelationalObjectModuleIndex() const
+	{
+		return relationalObjectModuleIndex;
+	}
+	void SetRelationalObjectModuleIndex( int relationalObjectModuleIndex )
+	{
+		this->relationalObjectModuleIndex = relationalObjectModuleIndex;
+	}
+
+	virtual void ResetRelationalObjectModuleIndex( const std::vector<int> &relationTable )
+	{
+		this->relationalObjectModuleIndex = relationTable[this->relationalObjectModuleIndex];
+	}
+
+	bool IsExternal() const
+	{
+		return ( relationalObjectModuleIndex != 0 );
+	}
+
+	bool isNeedResolve;
+	bool IsNeedResolve() const
+	{
+		return isNeedResolve;
+	}
+	void NeedResolve()
+	{
+		isNeedResolve = true;
+	}
+
+	virtual bool Resolve() = 0;
+};
+
+
+}}}
Index: trunk/ab5.0/abdev/ab_common/include/Lexical/Source.h
===================================================================
--- trunk/ab5.0/abdev/ab_common/include/Lexical/Source.h	(revision 636)
+++ trunk/ab5.0/abdev/ab_common/include/Lexical/Source.h	(revision 637)
@@ -265,5 +265,5 @@
 class SourceCodePosition
 {
-	std::string objectModuleName;
+	int relationalObjectModuleIndex;
 	int pos;
 
@@ -273,24 +273,24 @@
 	template<class Archive> void serialize(Archive& ar, const unsigned int version)
 	{
-		trace_for_serialize( "serializing - IncludedFilesRelation" );
-
-		ar & BOOST_SERIALIZATION_NVP( objectModuleName );
+		ar & BOOST_SERIALIZATION_NVP( relationalObjectModuleIndex );
 		ar & BOOST_SERIALIZATION_NVP( pos );
 	}
 
 public:
-	SourceCodePosition( const std::string &objectModuleName, int pos )
-		: objectModuleName( objectModuleName )
+	SourceCodePosition( int relationalObjectModuleIndex, int pos )
+		: relationalObjectModuleIndex( relationalObjectModuleIndex )
 		, pos( pos )
 	{
 	}
 	SourceCodePosition()
-		: pos( -1 )
-	{
-	}
-
-	const std::string &GetObjectModuleName() const
-	{
-		return objectModuleName;
+		: relationalObjectModuleIndex( -1 )
+		, pos( -1 )
+	{
+	}
+
+	int GetRelationalObjectModuleIndex() const;
+	void SetRelationalObjectModuleIndex( int relationalObjectModuleIndex )
+	{
+		this->relationalObjectModuleIndex = relationalObjectModuleIndex;
 	}
 	int GetPos() const
@@ -298,3 +298,9 @@
 		return pos;
 	}
-};
+	void SetPos( int pos )
+	{
+		this->pos = pos;
+	}
+
+	bool IsNothing() const;
+};
Index: trunk/ab5.0/abdev/ab_common/include/Lexical/Symbol.h
===================================================================
--- trunk/ab5.0/abdev/ab_common/include/Lexical/Symbol.h	(revision 636)
+++ trunk/ab5.0/abdev/ab_common/include/Lexical/Symbol.h	(revision 637)
@@ -38,9 +38,7 @@
 
 public:
-	bool isTargetObjectModule;
 	Symbol( const NamespaceScopes &namespaceScopes, const std::string &name )
 		: namespaceScopes( namespaceScopes )
 		, name( name )
-		, isTargetObjectModule( true )
 	{
 	}
@@ -48,9 +46,7 @@
 		: namespaceScopes( symbol.namespaceScopes )
 		, name( symbol.name )
-		, isTargetObjectModule( true )
 	{
 	}
 	Symbol()
-		: isTargetObjectModule( true )
 	{
 	}
Index: trunk/ab5.0/abdev/ab_common/include/Lexical/Type.h
===================================================================
--- trunk/ab5.0/abdev/ab_common/include/Lexical/Type.h	(revision 636)
+++ trunk/ab5.0/abdev/ab_common/include/Lexical/Type.h	(revision 637)
@@ -318,13 +318,10 @@
 
 public:
-	bool isTargetObjectModule;
 	BlittableType( const Type &basicType, CClass *pClass )
 		: basicType( basicType )
 		, pClass( pClass )
-		, isTargetObjectModule( true )
 	{
 	}
 	BlittableType()
-		: isTargetObjectModule( true )
 	{
 	}
Index: trunk/ab5.0/abdev/ab_common/include/Lexical/TypeDef.h
===================================================================
--- trunk/ab5.0/abdev/ab_common/include/Lexical/TypeDef.h	(revision 636)
+++ trunk/ab5.0/abdev/ab_common/include/Lexical/TypeDef.h	(revision 637)
@@ -3,5 +3,6 @@
 class TypeDefCollection;
 
-class TypeDef : public Symbol
+class TypeDef
+	: public RelationalObjectModuleItem
 {
 	friend TypeDefCollection;
@@ -17,5 +18,15 @@
 		trace_for_serialize( "serializing - TypeDef" );
 
-		ar & BOOST_SERIALIZATION_BASE_OBJECT_NVP( Symbol );
+		ar & BOOST_SERIALIZATION_BASE_OBJECT_NVP( RelationalObjectModuleItem );
+
+		if( ActiveBasic::Common::Environment::IsRemoveExternal() )
+		{
+			if( this->IsExternal() )
+			{
+				this->NeedResolve();
+				return;
+			}
+		}
+
 		ar & BOOST_SERIALIZATION_NVP( baseName );
 		ar & BOOST_SERIALIZATION_NVP( baseType );
@@ -23,5 +34,5 @@
 
 public:
-	TypeDef( const NamespaceScopes &namespaceScopes, const std::string &name, const std::string &baseName, const Type &baseType );
+	TypeDef( const Symbol &symbol, const std::string &baseName, const Type &baseType );
 	TypeDef()
 	{
@@ -39,4 +50,6 @@
 		return baseType;
 	}
+
+	virtual bool Resolve();
 };
 
@@ -58,5 +71,5 @@
 	~TypeDefCollection();
 
-	void Add( const NamespaceScopes &namespaceScopes, const std::string &name, const std::string &baseName, int nowLine );
+	void Add( const Symbol &symbol, const std::string &baseName, int nowLine );
 	const TypeDef *Find( const Symbol &symbol ) const;
 };
Index: trunk/ab5.0/abdev/ab_common/include/Lexical/Variable.h
===================================================================
--- trunk/ab5.0/abdev/ab_common/include/Lexical/Variable.h	(revision 636)
+++ trunk/ab5.0/abdev/ab_common/include/Lexical/Variable.h	(revision 637)
@@ -1,5 +1,6 @@
 #pragma once
 
-class Variable : public Symbol
+class Variable
+	: public RelationalObjectModuleItem
 {
 	Type type;
@@ -36,5 +37,15 @@
 		trace_for_serialize( "serializing - Variable" );
 
-		ar & BOOST_SERIALIZATION_BASE_OBJECT_NVP( Symbol );
+		ar & BOOST_SERIALIZATION_BASE_OBJECT_NVP( RelationalObjectModuleItem );
+
+		if( ActiveBasic::Common::Environment::IsRemoveExternal() )
+		{
+			if( this->IsExternal() )
+			{
+				this->NeedResolve();
+				return;
+			}
+		}
+
 		ar & BOOST_SERIALIZATION_NVP( type );
 		ar & BOOST_SERIALIZATION_NVP( isConst );
@@ -53,5 +64,4 @@
 public:
 	Variable( const Symbol &symbol, const Type &type, bool isConst, bool isRef, const std::string &paramStrForConstructor, bool hasInitData );
-	Variable( const NamespaceScopes &namespaceScopes, const std::string &name, const Type &type, bool isConst, bool isRef, const std::string &paramStrForConstructor, bool hasInitData );
 	Variable( const Variable &var );
 	Variable();
@@ -165,4 +175,6 @@
 	}
 
+	virtual bool Resolve();
+
 
 	bool isLiving;
Index: trunk/ab5.0/abdev/ab_common/include/ab_common.h
===================================================================
--- trunk/ab5.0/abdev/ab_common/include/ab_common.h	(revision 636)
+++ trunk/ab5.0/abdev/ab_common/include/ab_common.h	(revision 637)
@@ -8,4 +8,5 @@
 #include "Lexical/NamespaceSupporter.h"
 #include "Lexical/Symbol.h"
+#include "Lexical/RelationalObjectModuleItem.h"
 #include "Lexical/Prototype.h"
 #include "Lexical/TypeMisc.h"
@@ -13,6 +14,6 @@
 using namespace ActiveBasic::Common::Lexical;
 
+#include "Lexical/Source.h"
 #include "Lexical/NativeCode.h"
-#include "Lexical/Source.h"
 #include "Lexical/Type.h"
 #include "Lexical/Method.h"
Index: trunk/ab5.0/abdev/ab_common/src/Environment.cpp
===================================================================
--- trunk/ab5.0/abdev/ab_common/src/Environment.cpp	(revision 636)
+++ trunk/ab5.0/abdev/ab_common/src/Environment.cpp	(revision 637)
@@ -2,4 +2,5 @@
 
 std::string ActiveBasic::Common::Environment::rootPath;
+bool ActiveBasic::Common::Environment::isRemoveExternal = false;
 
 using namespace ActiveBasic::Common;
Index: trunk/ab5.0/abdev/ab_common/src/Lexical/Class.cpp
===================================================================
--- trunk/ab5.0/abdev/ab_common/src/Lexical/Class.cpp	(revision 636)
+++ trunk/ab5.0/abdev/ab_common/src/Lexical/Class.cpp	(revision 637)
@@ -2,6 +2,6 @@
 
 
-CClass::CClass( const NamespaceScopes &namespaceScopes, const NamespaceScopesCollection &importedNamespaces, const std::string &name )
-	: ClassPrototype( namespaceScopes, name )
+CClass::CClass( const Symbol &symbol, const NamespaceScopesCollection &importedNamespaces )
+	: ClassPrototype( symbol )
 	, importedNamespaces( importedNamespaces )
 	, classType( Class )
@@ -21,7 +21,7 @@
 }
 
-CClass::CClass( const NamespaceScopes &namespaceScopes,
+CClass::CClass(
+	const Symbol &symbol,
 	const NamespaceScopesCollection &importedNamespaces,
-	const std::string &name,
 	ClassType classType,
 	const GenericTypes &formalGenericTypes,
@@ -31,5 +31,5 @@
 	int vtblNum,
 	int fixedAlignment )
-	: ClassPrototype( namespaceScopes, name )
+	: ClassPrototype( symbol )
 	, importedNamespaces( importedNamespaces )
 	, classType( classType )
@@ -868,2 +868,8 @@
 	}
 }
+
+bool CClass::Resolve()
+{
+	// TODO: Resolve
+	return true;
+}
Index: trunk/ab5.0/abdev/ab_common/src/Lexical/Const.cpp
===================================================================
--- trunk/ab5.0/abdev/ab_common/src/Lexical/Const.cpp	(revision 636)
+++ trunk/ab5.0/abdev/ab_common/src/Lexical/Const.cpp	(revision 637)
@@ -7,13 +7,19 @@
 }
 
-void Consts::Add( const NamespaceScopes &namespaceScopes, const std::string &name, _int64 i64data, const Type &type )
+bool CConst::Resolve()
 {
-	CConst *newconst = new CConst(namespaceScopes, name, type, i64data);
+	// TODO: Resolve
+	return true;
+}
+
+void Consts::Add( const Symbol &symbol, _int64 i64data, const Type &type )
+{
+	CConst *newconst = new CConst( symbol, type, i64data );
 
 	//ハッシュリストに追加
 	Put( newconst );
 }
-void Consts::Add(const NamespaceScopes &namespaceScopes, const std::string &name, int value){
-	CConst *newconst = new CConst( namespaceScopes, name, value);
+void Consts::Add(const Symbol &symbol, int value){
+	CConst *newconst = new CConst( symbol, value);
 
 	//ハッシュリストに追加
@@ -72,6 +78,12 @@
 }
 
+bool ConstMacro::Resolve()
+{
+	// TODO: Resolve
+	return true;
+}
+
 // マクロ定数を追加するための関数
-bool ConstMacros::Add( const NamespaceScopes &namespaceScopes, const std::string &name, const char *parameterStr )
+bool ConstMacros::Add( const Symbol &symbol, const char *parameterStr )
 {
 	std::vector<std::string> parameters;
@@ -113,5 +125,5 @@
 	lstrcpy(temporary,parameterStr+i+1);
 
-	this->Put( new ConstMacro( namespaceScopes, name, parameters, temporary ) );
+	this->Put( new ConstMacro( symbol, parameters, temporary ) );
 
 	return true;
Index: trunk/ab5.0/abdev/ab_common/src/Lexical/DataTable.cpp
===================================================================
--- trunk/ab5.0/abdev/ab_common/src/Lexical/DataTable.cpp	(revision 636)
+++ trunk/ab5.0/abdev/ab_common/src/Lexical/DataTable.cpp	(revision 637)
@@ -77,2 +77,7 @@
 	}
 }
+
+void DataTable::Resolve()
+{
+	// TODO: Resolve
+}
Index: trunk/ab5.0/abdev/ab_common/src/Lexical/Delegate.cpp
===================================================================
--- trunk/ab5.0/abdev/ab_common/src/Lexical/Delegate.cpp	(revision 636)
+++ trunk/ab5.0/abdev/ab_common/src/Lexical/Delegate.cpp	(revision 637)
@@ -18,2 +18,8 @@
 	return false;
 }
+
+bool Delegate::Resolve()
+{
+	// TODO: Resolve
+	return true;
+}
Index: trunk/ab5.0/abdev/ab_common/src/Lexical/Meta.cpp
===================================================================
--- trunk/ab5.0/abdev/ab_common/src/Lexical/Meta.cpp	(revision 636)
+++ trunk/ab5.0/abdev/ab_common/src/Lexical/Meta.cpp	(revision 637)
@@ -50,8 +50,13 @@
 	{
 		UserProc *pUserProc = meta.GetUserProcs().Iterator_GetNext();
-		pUserProc->isTargetObjectModule = false;
+		if( pUserProc->IsExternal() )
+		{
+			// 外部参照の場合は取り込まない
+			continue;
+		}
+
+		pUserProc->ResetRelationalObjectModuleIndex( relationTable );
 
 		pUserProc->GetNativeCode().ResetDataSectionBaseOffset( dataSectionBaseOffset );
-		pUserProc->GetNativeCode().ResetSourceIndexes( relationTable );
 
 		this->userProcs.Put( pUserProc );
@@ -64,5 +69,11 @@
 	{
 		DllProc *pDllProc = meta.GetDllProcs().Iterator_GetNext();
-		pDllProc->isTargetObjectModule = false;
+		if( pDllProc->IsExternal() )
+		{
+			// 外部参照の場合は取り込まない
+			continue;
+		}
+
+		pDllProc->ResetRelationalObjectModuleIndex( relationTable );
 		this->dllProcs.Put( pDllProc );
 	}
@@ -74,5 +85,11 @@
 	{
 		CClass *pClass = meta.GetClasses().Iterator_GetNext();
-		pClass->isTargetObjectModule = false;
+		if( pClass->IsExternal() )
+		{
+			// 外部参照の場合は取り込まない
+			continue;
+		}
+
+		pClass->ResetRelationalObjectModuleIndex( relationTable );
 		pClass->Readed();
 		this->GetClasses().Put( pClass );
@@ -84,4 +101,10 @@
 	BOOST_FOREACH( Variable *pVar, meta.globalVars )
 	{
+		if( pVar->IsExternal() )
+		{
+			// 外部参照の場合は取り込まない
+			continue;
+		}
+
 		// 基底スコープレベルのグローバル変数の生存値をオンにする
 		if( pVar->GetScopeLevel() == 0 )
@@ -99,5 +122,5 @@
 		}
 
-		pVar->isTargetObjectModule = false;
+		pVar->ResetRelationalObjectModuleIndex( relationTable );
 		this->globalVars.Add( pVar, isResetOffsetAddress );
 	}
@@ -113,5 +136,11 @@
 	{
 		CConst *pConst = meta.GetGlobalConsts().Iterator_GetNext();
-		pConst->isTargetObjectModule = false;
+		if( pConst->IsExternal() )
+		{
+			// 外部参照の場合は取り込まない
+			continue;
+		}
+
+		pConst->ResetRelationalObjectModuleIndex( relationTable );
 		this->GetGlobalConsts().Put( pConst );
 	}
@@ -123,5 +152,11 @@
 	{
 		ConstMacro *pConstMacro = meta.GetGlobalConstMacros().Iterator_GetNext();
-		pConstMacro->isTargetObjectModule = false;
+		if( pConstMacro->IsExternal() )
+		{
+			// 外部参照の場合は取り込まない
+			continue;
+		}
+
+		pConstMacro->ResetRelationalObjectModuleIndex( relationTable );
 		this->GetGlobalConstMacros().Put( pConstMacro );
 	}
@@ -131,5 +166,5 @@
 	BOOST_FOREACH( BlittableType &blittableType, meta.blittableTypes )
 	{
-		blittableType.isTargetObjectModule = false;
+		// TODO: coreモジュール以外でもBlittable型用のクラスモジュールを定義できるようにすべき
 		this->blittableTypes.push_back( blittableType );
 	}
@@ -139,5 +174,11 @@
 	BOOST_FOREACH( TypeDef &typeDef, meta.typeDefs )
 	{
-		typeDef.isTargetObjectModule = false;
+		if( typeDef.IsExternal() )
+		{
+			// 外部参照の場合は取り込まない
+			continue;
+		}
+
+		typeDef.ResetRelationalObjectModuleIndex( relationTable );
 		this->typeDefs.push_back( typeDef );
 	}
@@ -147,5 +188,11 @@
 	BOOST_FOREACH( ProcPointer *pProcPointer, meta.procPointers )
 	{
-		pProcPointer->isTargetObjectModule = false;
+		if( pProcPointer->IsExternal() )
+		{
+			// 外部参照の場合は取り込まない
+			continue;
+		}
+
+		pProcPointer->ResetRelationalObjectModuleIndex( relationTable );
 		this->procPointers.push_back( pProcPointer );
 	}
@@ -157,5 +204,11 @@
 	{
 		Delegate *pDelegate = meta.GetDelegates().Iterator_GetNext();
-		pDelegate->isTargetObjectModule = false;
+		if( pDelegate->IsExternal() )
+		{
+			// 外部参照の場合は取り込まない
+			continue;
+		}
+
+		pDelegate->ResetRelationalObjectModuleIndex( relationTable );
 		this->GetDelegates().Put( pDelegate );
 	}
@@ -199,2 +252,77 @@
 	return NULL;
 }
+
+void Meta::Resolve()
+{
+	// 関数・メソッド
+	this->GetUserProcs().Iterator_Init();
+	this->GetUserProcs().Iterator_Reset();
+	while( this->GetUserProcs().Iterator_HasNext() )
+	{
+		UserProc *pUserProc = this->GetUserProcs().Iterator_GetNext();
+		pUserProc->Resolve();
+	}
+
+	// DLL関数
+	this->GetDllProcs().Iterator_Init();
+	this->GetDllProcs().Iterator_Reset();
+	while( this->GetDllProcs().Iterator_HasNext() )
+	{
+		DllProc *pDllProc = this->GetDllProcs().Iterator_GetNext();
+		pDllProc->Resolve();
+	}
+
+	// クラス
+	this->GetClasses().Iterator_Init();
+	this->GetClasses().Iterator_Reset();
+	while( this->GetClasses().Iterator_HasNext() )
+	{
+		CClass *pClass = this->GetClasses().Iterator_GetNext();
+		pClass->Resolve();
+	}
+
+	// グローバル変数
+	BOOST_FOREACH( Variable *pVar, globalVars )
+	{
+		pVar->Resolve();
+	}
+
+	// グローバル定数
+	this->GetGlobalConsts().Iterator_Init();
+	this->GetGlobalConsts().Iterator_Reset();
+	while( this->GetGlobalConsts().Iterator_HasNext() )
+	{
+		CConst *pConst = this->GetGlobalConsts().Iterator_GetNext();
+		pConst->Resolve();
+	}
+
+	// グローバル定数マクロ
+	this->GetGlobalConstMacros().Iterator_Init();
+	this->GetGlobalConstMacros().Iterator_Reset();
+	while( this->GetGlobalConstMacros().Iterator_HasNext() )
+	{
+		ConstMacro *pConstMacro = this->GetGlobalConstMacros().Iterator_GetNext();
+		pConstMacro->Resolve();
+	}
+
+	// TypeDef
+	BOOST_FOREACH( TypeDef &typeDef, typeDefs )
+	{
+		typeDef.Resolve();
+	}
+
+	// 関数ポインタ
+	BOOST_FOREACH( ProcPointer *pProcPointer, procPointers )
+	{
+		pProcPointer->Resolve();
+	}
+
+	// デリゲート
+	this->GetDelegates().Iterator_Init();
+	this->GetDelegates().Iterator_Reset();
+	while( this->GetDelegates().Iterator_HasNext() )
+	{
+		Delegate *pDelegate = this->GetDelegates().Iterator_GetNext();
+		pDelegate->Resolve();
+	}
+}
Index: trunk/ab5.0/abdev/ab_common/src/Lexical/NativeCode.cpp
===================================================================
--- trunk/ab5.0/abdev/ab_common/src/Lexical/NativeCode.cpp	(revision 636)
+++ trunk/ab5.0/abdev/ab_common/src/Lexical/NativeCode.cpp	(revision 637)
@@ -43,9 +43,7 @@
 		this->sourceLines.push_back(
 			SourceLine(
-				sourceLine.GetLineNum(),
 				baseOffset + sourceLine.GetNativeCodePos(),
-				sourceLine.GetRelationalObjectModuleIndex(),	// TODO: 複数libの取り込みを想定できていない（ソースコード行番号とネイティブコード位置の対応情報の追加は静的リンクが完了した後に行うべき）
-				sourceLine.GetSourceCodePos(),
-				sourceLine.GetCodeType()
+				sourceLine.GetCodeType(),
+				sourceLine.GetSourceCodePosition()
 			)
 		);
@@ -106,5 +104,5 @@
 }
 
-void NativeCode::NextSourceLine( int currentSourceIndex, int nowLine )
+void NativeCode::NextSourceLine( const SourceCodePosition &sourceCodePosition )
 {
 	if( sourceLines.size() )
@@ -112,5 +110,5 @@
 		if( sourceLines.back().GetNativeCodePos() == GetSize() )
 		{
-			sourceLines.back().SetSourceCodePos( nowLine );
+			sourceLines.back().SetSourceCodePosition( sourceCodePosition );
 			return;
 		}
@@ -130,9 +128,7 @@
 	sourceLines.push_back(
 		SourceLine(
-			(long)sourceLines.size(),
 			GetSize(),
-			currentSourceIndex,
-			nowLine,
-			sourceLineType
+			sourceLineType,
+			sourceCodePosition
 		)
 	);
@@ -152,9 +148,16 @@
 	}
 }
-void NativeCode::ResetSourceIndexes( const std::vector<int> &relationTable )
+void NativeCode::ResetRelationalObjectModuleIndex( const std::vector<int> &relationTable )
 {
 	BOOST_FOREACH( SourceLine &sourceLine, sourceLines )
 	{
-		sourceLine.SetRelationalObjectModuleIndex( relationTable[sourceLine.GetRelationalObjectModuleIndex()] );
+		sourceLine.GetSourceCodePosition().SetRelationalObjectModuleIndex(
+			relationTable[sourceLine.GetSourceCodePosition().GetRelationalObjectModuleIndex()]
+		);
 	}
 }
+
+void NativeCode::Resolve()
+{
+	// TODO: Resolve
+}
Index: trunk/ab5.0/abdev/ab_common/src/Lexical/ObjectModule.cpp
===================================================================
--- trunk/ab5.0/abdev/ab_common/src/Lexical/ObjectModule.cpp	(revision 636)
+++ trunk/ab5.0/abdev/ab_common/src/Lexical/ObjectModule.cpp	(revision 637)
@@ -56,5 +56,5 @@
 
 
-void ObjectModule::StaticLink( ObjectModule &objectModule )
+void ObjectModule::StaticLink( ObjectModule &objectModule, bool isSll )
 {
 	const std::vector<int> relationTable = this->GetRelationTable( objectModule.relationalObjectModuleNames );
@@ -65,16 +65,33 @@
 	meta.StaticLink( objectModule.meta, dataSectionBaseOffset, relationTable );
 
-	// グローバル ネイティブコードを結合
-	objectModule.globalNativeCode.ResetDataSectionBaseOffset( dataSectionBaseOffset );
-	objectModule.globalNativeCode.ResetSourceIndexes( relationTable );
-	globalNativeCode.PutEx( objectModule.globalNativeCode );
-
-	// データテーブルを結合
-	objectModule.dataTable.ResetDataSectionBaseOffset( dataSectionBaseOffset );
-	dataTable.Add( objectModule.dataTable );
+	if( !isSll )
+	{
+		// グローバル ネイティブコードを結合
+		objectModule.globalNativeCode.ResetDataSectionBaseOffset( dataSectionBaseOffset );
+		objectModule.globalNativeCode.ResetRelationalObjectModuleIndex( relationTable );
+		globalNativeCode.PutEx( objectModule.globalNativeCode );
+
+		// データテーブルを結合
+		objectModule.dataTable.ResetDataSectionBaseOffset( dataSectionBaseOffset );
+		dataTable.Add( objectModule.dataTable );
+	}
+
+	// 依存関係を解決
+	this->Resolve();
 
 	// TODO: basbufがいらなくなったら消す
 	extern char *basbuf;
 	basbuf = this->source.GetBuffer();
+}
+
+void ObjectModule::Resolve()
+{
+	this->meta.Resolve();
+
+	// グローバルネイティブコードを解決（スケジュールを解決する）
+	this->globalNativeCode.Resolve();
+
+	// データテーブルを解決（スケジュールを解決する）
+	this->dataTable.Resolve();
 }
 
Index: trunk/ab5.0/abdev/ab_common/src/Lexical/Procedure.cpp
===================================================================
--- trunk/ab5.0/abdev/ab_common/src/Lexical/Procedure.cpp	(revision 636)
+++ trunk/ab5.0/abdev/ab_common/src/Lexical/Procedure.cpp	(revision 637)
@@ -1,8 +1,26 @@
 #include "stdafx.h"
 
+
+void Procedure::ResetRelationalObjectModuleIndex( const std::vector<int> &relationTable )
+{
+	RelationalObjectModuleItem::ResetRelationalObjectModuleIndex( relationTable );
+
+	if( !this->sourceCodePosition.IsNothing() )
+	{
+		this->sourceCodePosition.SetRelationalObjectModuleIndex( relationTable[this->sourceCodePosition.GetRelationalObjectModuleIndex()] );
+	}
+}
+
+void UserProc::ResetRelationalObjectModuleIndex( const std::vector<int> &relationTable )
+{
+	Procedure::ResetRelationalObjectModuleIndex( relationTable );
+
+	this->GetNativeCode().ResetRelationalObjectModuleIndex( relationTable );
+}
+
 int id_base = 0;
 
-UserProc::UserProc( const NamespaceScopes &namespaceScopes, const NamespaceScopesCollection &importedNamespaces, const std::string &name, Kind kind, bool isMacro, bool isCdecl, bool isExport )
-	: Procedure( namespaceScopes, name, kind, isCdecl )
+UserProc::UserProc( const Symbol &symbol, const NamespaceScopesCollection &importedNamespaces, Kind kind, bool isMacro, bool isCdecl, bool isExport )
+	: Procedure( symbol, kind, isCdecl )
 	, importedNamespaces( importedNamespaces )
 	, pParentClass( NULL )
@@ -139,4 +157,10 @@
 }
 
+bool UserProc::Resolve()
+{
+	// TODO: Resolve
+	return true;
+}
+
 const UserProc *UserProc::pGlobalProc = NULL;
 
@@ -161,4 +185,16 @@
 }
 
+bool DllProc::Resolve()
+{
+	// TODO: Resolve
+	return true;
+}
+
+bool ProcPointer::Resolve()
+{
+	// TODO: Resolve
+	return true;
+}
+
 void ProcPointers::Clear()
 {
Index: trunk/ab5.0/abdev/ab_common/src/Lexical/Source.cpp
===================================================================
--- trunk/ab5.0/abdev/ab_common/src/Lexical/Source.cpp	(revision 636)
+++ trunk/ab5.0/abdev/ab_common/src/Lexical/Source.cpp	(revision 637)
@@ -941,2 +941,28 @@
 	return 1;
 }
+
+int SourceCodePosition::GetRelationalObjectModuleIndex() const
+{
+	if( this->IsNothing() )
+	{
+		_ASSERTE( false );
+		throw;
+	}
+
+	return relationalObjectModuleIndex;
+}
+bool SourceCodePosition::IsNothing() const
+{
+	if( this->relationalObjectModuleIndex == -1 && this->pos == -1 )
+	{
+		return true;
+	}
+
+	if( this->relationalObjectModuleIndex == -1 || this->pos == -1 )
+	{
+		_ASSERTE( false );
+		throw;
+	}
+
+	return false;
+}
Index: trunk/ab5.0/abdev/ab_common/src/Lexical/TypeDef.cpp
===================================================================
--- trunk/ab5.0/abdev/ab_common/src/Lexical/TypeDef.cpp	(revision 636)
+++ trunk/ab5.0/abdev/ab_common/src/Lexical/TypeDef.cpp	(revision 637)
@@ -1,9 +1,15 @@
 #include "stdafx.h"
 
-TypeDef::TypeDef( const NamespaceScopes &namespaceScopes, const std::string &name, const std::string &baseName, const Type &baseType )
-	: Symbol( namespaceScopes, name )
+TypeDef::TypeDef( const Symbol &symbol, const std::string &baseName, const Type &baseType )
+	: RelationalObjectModuleItem( symbol )
 	, baseName( baseName )
 	, baseType( baseType )
 {
+}
+
+bool TypeDef::Resolve()
+{
+	// TODO: Resolve
+	return true;
 }
 
@@ -12,6 +18,6 @@
 TypeDefCollection::~TypeDefCollection(){
 }
-void TypeDefCollection::Add( const NamespaceScopes &namespaceScopes, const std::string &name, const std::string &baseName, int nowLine ){
-	TypeDef typeDef( namespaceScopes, name, baseName, nowLine );
+void TypeDefCollection::Add( const Symbol &symbol, const std::string &baseName, int nowLine ){
+	TypeDef typeDef( symbol, baseName, nowLine );
 	this->push_back( typeDef );
 }
Index: trunk/ab5.0/abdev/ab_common/src/Lexical/Variable.cpp
===================================================================
--- trunk/ab5.0/abdev/ab_common/src/Lexical/Variable.cpp	(revision 636)
+++ trunk/ab5.0/abdev/ab_common/src/Lexical/Variable.cpp	(revision 637)
@@ -2,16 +2,5 @@
 
 Variable::Variable( const Symbol &symbol, const Type &type, bool isConst, bool isRef, const std::string &paramStrForConstructor, bool hasInitData )
-	: Symbol( symbol )
-	, type( type )
-	, isConst( isConst )
-	, isRef( isRef )
-	, isArray( false )
-	, isParameter( false)
-	, paramStrForConstructor( paramStrForConstructor )
-	, hasInitData( hasInitData )
-{
-}
-Variable::Variable( const NamespaceScopes &namespaceScopes, const std::string &name, const Type &type, bool isConst, bool isRef, const std::string &paramStrForConstructor, bool hasInitData )
-	: Symbol( namespaceScopes, name )
+	: RelationalObjectModuleItem( symbol )
 	, type( type )
 	, isConst( isConst )
@@ -24,5 +13,5 @@
 }
 Variable::Variable( const Variable &var )
-	: Symbol( var )
+	: RelationalObjectModuleItem( var )
 	, type( var.type )
 	, isConst( var.isConst )
@@ -37,4 +26,10 @@
 Variable::Variable()
 {
+}
+
+bool Variable::Resolve()
+{
+	// TODO: Resolve
+	return true;
 }
 
