From 3c2c6f7e034601e5bc32340664eec6fe56017fcd Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Zolt=C3=A1n=20Mizsei?= <zmizsei@extrowerk.com>
Date: Wed, 10 Aug 2016 21:11:00 +0200
Subject: [PATCH] Build fix

---
 Makefile | 8 ++++----
 main.cpp | 4 ++++
 2 files changed, 8 insertions(+), 4 deletions(-)

diff --git a/Makefile b/Makefile
index ecfb500..0a6bb43 100644
--- a/Makefile
+++ b/Makefile
@@ -1,8 +1,8 @@
 SyobonAction:main.o loadg.o DxLib.o
-	gcc main.o loadg.o DxLib.o -o SyobonAction `sdl-config --libs` -lSDL_gfx -lSDL_image -lSDL_mixer -lSDL_ttf
+	g++ main.o loadg.o DxLib.o -o SyobonAction `sdl-config --libs` -lSDL_gfx -lSDL_image -lSDL_mixer -lSDL_ttf -lnetwork
 main.o:main.cpp
-	gcc -c main.cpp
+	g++ -c main.cpp `sdl-config --cflags`
 loadg.o:loadg.cpp
-	gcc -c loadg.cpp
+	g++ -c loadg.cpp `sdl-config --cflags`
 DxLib.o:DxLib.cpp
-	gcc -c DxLib.cpp
+	g++ -c DxLib.cpp `sdl-config --cflags`
diff --git a/main.cpp b/main.cpp
index bb94393..5dbd2fd 100644
--- a/main.cpp
+++ b/main.cpp
@@ -1,9 +1,13 @@
 #include "main.h"
+#include <unistd.h>
+#include <string.h>
+#include <posix/libgen.h>
 
 // プログラムは WinMain から始まります
 //Changed to ansi c++ main()
 int main(int argc, char *argv[])
 {
+	chdir(dirname(argv[0]));
     parseArgs(argc, argv);
     if (DxLib_Init() == -1)
 	return 1;
-- 
2.7.0

