Index: trunk/ab5.0/abdev/BasicCompiler_Common/BasicCompiler.cpp
===================================================================
--- trunk/ab5.0/abdev/BasicCompiler_Common/BasicCompiler.cpp	(revision 471)
+++ trunk/ab5.0/abdev/BasicCompiler_Common/BasicCompiler.cpp	(revision 472)
@@ -574,7 +574,4 @@
 }
 
-#include <fcntl.h>
-#include <io.h>
-
 int main()
 {
@@ -753,5 +750,7 @@
 			MainThread(0);
 
-			ExitProcess( 0 );
+			trace("Complete ActiveBasic Compiler!");
+
+			ExitProcess( program.GetExitCode() );
 			return 0;
 		}
@@ -798,5 +797,5 @@
 	trace("Complete ActiveBasic Compiler!");
 
-	ExitProcess( 0 );
+	ExitProcess( program.GetExitCode() );
 
 	return 0;
Index: trunk/ab5.0/abdev/BasicCompiler_Common/MakeExe.cpp
===================================================================
--- trunk/ab5.0/abdev/BasicCompiler_Common/MakeExe.cpp	(revision 471)
+++ trunk/ab5.0/abdev/BasicCompiler_Common/MakeExe.cpp	(revision 472)
@@ -181,5 +181,5 @@
 				else
 				{
-					compiler.messenger.Output( ((string)"\"" + path.GetFullPath() + "\" ファイルが壊れています。").c_str() );
+					compiler.errorMessenger.Output( 203, path.GetFullPath() );
 					isSuccessfulLoadStaticLinkLibrary = false;
 				}
@@ -187,5 +187,5 @@
 			else
 			{
-				compiler.messenger.Output( ((string)"\"" + path.GetFullPath() + "\" ファイルが存在しません。").c_str() );
+				compiler.errorMessenger.Output( 202, path.GetFullPath() );
 				isSuccessfulLoadStaticLinkLibrary = false;
 			}
@@ -204,5 +204,5 @@
 				else
 				{
-					compiler.messenger.Output( ((string)"\"" + path.GetFullPath() + "\" ファイルが壊れています。").c_str() );
+					compiler.errorMessenger.Output( 203, path.GetFullPath() );
 					isSuccessfulLoadStaticLinkLibrary = false;
 				}
@@ -210,5 +210,5 @@
 			else
 			{
-				compiler.messenger.Output( ((string)"\"" + path.GetFullPath() + "\" ファイルが存在しません。").c_str() );
+				compiler.errorMessenger.Output( 202, path.GetFullPath() );
 				isSuccessfulLoadStaticLinkLibrary = false;
 			}
@@ -280,4 +280,11 @@
 	SetDlgItemText(hMainDlg,IDOK,STRING_CLOSE);
 
+	// エラーがない場合はビルド成功とする
+	if( !compiler.errorMessenger.HasError() )
+	{
+		// ビルド成功
+		compiler.BuildSuccessful();
+	}
+
 #ifdef _DEBUG
 	// デバッグモードのときはダイアログが隠れている
Index: trunk/ab5.0/abdev/BasicCompiler_Common/include/Compiler.h
===================================================================
--- trunk/ab5.0/abdev/BasicCompiler_Common/include/Compiler.h	(revision 471)
+++ trunk/ab5.0/abdev/BasicCompiler_Common/include/Compiler.h	(revision 472)
@@ -25,4 +25,7 @@
 
 private:
+	// ビルド成功のフラグ
+	bool isBuildSuccessful;
+
 	// モジュール名
 	std::string moduleName;
@@ -47,5 +50,6 @@
 
 	Compiler()
-		: pObjectModule( new ObjectModule )
+		: isBuildSuccessful( false )
+		, pObjectModule( new ObjectModule )
 		, pNowObjectModule( pObjectModule )
 		, targetModuleType( Exe )
@@ -71,4 +75,14 @@
 	void StaticLink( ObjectModules &staticLibraries );
 
+	// ビルド成功のフラグ
+	bool IsBuildSuccessful() const
+	{
+		return isBuildSuccessful;
+	}
+	void BuildSuccessful()
+	{
+		isBuildSuccessful = true;
+	}
+
 	// モジュール名
 	void SetModuleName( const std::string &moduleName )
Index: trunk/ab5.0/abdev/BasicCompiler_Common/include/Messenger.h
===================================================================
--- trunk/ab5.0/abdev/BasicCompiler_Common/include/Messenger.h	(revision 471)
+++ trunk/ab5.0/abdev/BasicCompiler_Common/include/Messenger.h	(revision 472)
@@ -63,6 +63,6 @@
 public:
 	void Output( const ErrorInfo &errorInfo );
-	void Output( int errorCode, const std::string &keyword, int sourceIndex );
-	void Output( int errorCode, const char *keyword, int sourceIndex );
+	void Output( int errorCode, const std::string &keyword, int sourceIndex = -1 );
+	void Output( int errorCode, const char *keyword, int sourceIndex = -1 );
 	void OutputFatalError();
 
Index: trunk/ab5.0/abdev/BasicCompiler_Common/include/Program.h
===================================================================
--- trunk/ab5.0/abdev/BasicCompiler_Common/include/Program.h	(revision 471)
+++ trunk/ab5.0/abdev/BasicCompiler_Common/include/Program.h	(revision 472)
@@ -86,4 +86,6 @@
 		this->includeDir = includeDir;
 	}
+
+	int GetExitCode() const;
 };
 
Index: trunk/ab5.0/abdev/BasicCompiler_Common/src/Messenger.cpp
===================================================================
--- trunk/ab5.0/abdev/BasicCompiler_Common/src/Messenger.cpp	(revision 471)
+++ trunk/ab5.0/abdev/BasicCompiler_Common/src/Messenger.cpp	(revision 472)
@@ -256,4 +256,6 @@
 	if(errorCode==200) sprintf(msg,"\"%s\" 未解決です (リンク エラー)。",tempKeyWord);
 	if(errorCode==201) sprintf(msg,"\"%s\" の読み込みに失敗。",tempKeyWord);
+	if(errorCode==202) sprintf(msg,"\"%s\" は存在しません。",tempKeyWord);
+	if(errorCode==203) sprintf(msg,"\"%s\" は存在しますが、読み込めません（古いバージョンのコンパイラでビルドされた可能性があります）。",tempKeyWord);
 
 	//原因不明
Index: trunk/ab5.0/abdev/BasicCompiler_Common/src/Program.cpp
===================================================================
--- trunk/ab5.0/abdev/BasicCompiler_Common/src/Program.cpp	(revision 471)
+++ trunk/ab5.0/abdev/BasicCompiler_Common/src/Program.cpp	(revision 472)
@@ -26,5 +26,6 @@
 	{
 		// 先頭に無名コマンドがきた場合、ソースファイル名として認識する
-		Program::SetSourceFilePath( cmdLines[cmdLineIndex].GetParameter() );
+		std::string tempParam = cmdLines[cmdLineIndex].GetParameter();
+		Program::SetSourceFilePath( Jenga::Common::StringReplace( tempParam, "/", "\\" ) );
 
 		cmdLineIndex ++;
@@ -40,5 +41,6 @@
 		{
 			// 二番目にも無名コマンドがきた場合、ソースファイル名として認識する
-			SetOutputFilePath( cmdLines[cmdLineIndex].GetParameter() );
+			std::string tempParam = cmdLines[cmdLineIndex].GetParameter();
+			SetOutputFilePath( Jenga::Common::StringReplace( tempParam, "/", "\\" ) );
 
 			cmdLineIndex ++;
@@ -102,5 +104,8 @@
 		{
 			//インクルード ディレクトリ
-			includeDir = cmdLine.GetParameter();
+			includeDir = cmdLines[cmdLineIndex].GetParameter();
+
+			// '/' があった場合は '\\' に置換
+			Jenga::Common::StringReplace( includeDir, "/", "\\" );
 		}
 		else
@@ -119,2 +124,14 @@
 	return true;
 }
+
+int Program::GetExitCode() const
+{
+	if( !compiler.IsBuildSuccessful() )
+	{
+		// ビルドに失敗
+		return 1;
+	}
+
+	// ビルドに成功
+	return 0;
+}
