Fluorohydride / ygopro

A script engine for "yu-gi-oh!" and sample gui
GNU General Public License v2.0
1.83k stars 593 forks source link

Building on Ubuntu based distros #1399

Closed james-johns closed 9 years ago

james-johns commented 9 years ago

I'm currently attempting to build on an Ubuntu machine, and struggling with dependencies.

The compilation errors out at

==== Building ygopro (debug) ====
game.cpp
../gframe/game.cpp:11:16: fatal error: io.h: No such file or directory
 #include <io.h>
            ^
compilation terminated.
make[1]: *** [../obj/Debug/ygopro/game.o] Error 1
make: *** [ygopro] Error 2

A quick search turns up libowfat-dev package providing io.h, but after installing that package I get the following errors

==== Building ygopro (debug) ====
game.cpp
In file included from /usr/include/io.h:7:0,
                 from ../gframe/game.cpp:11:
/usr/include/uint64.h:11:18: error: conflicting declaration ‘typedef uint64_t uint64’
 typedef uint64_t uint64;
                  ^
In file included from ../gframe/../ocgcore/ocgapi.h:11:0,
                 from ../gframe/config.h:63,
                 from ../gframe/game.cpp:1:
../gframe/../ocgcore/common.h:16:28: error: ‘uint64’ has a previous declaration as ‘typedef long long unsigned int uint64’
 typedef unsigned long long uint64;
                            ^
In file included from /usr/include/io.h:7:0,
                 from ../gframe/game.cpp:11:
/usr/include/uint64.h:12:17: error: conflicting declaration ‘typedef int64_t int64’
 typedef int64_t int64;
                 ^
In file included from ../gframe/../ocgcore/ocgapi.h:11:0,
                 from ../gframe/config.h:63,
                 from ../gframe/game.cpp:1:
../gframe/../ocgcore/common.h:22:19: error: ‘int64’ has a previous declaration as ‘typedef long long int int64’
 typedef long long int64;
                   ^
../gframe/game.cpp: In member function ‘bool ygo::Game::Initialize()’:
../gframe/game.cpp:25:2: error: ‘_finddata_t’ was not declared in this scope
  _finddata_t fdata;
  ^
../gframe/game.cpp:25:14: error: expected ‘;’ before ‘fdata’
  _finddata_t fdata;
              ^
../gframe/game.cpp:63:45: error: ‘fdata’ was not declared in this scope
  fhandle = _findfirst("expansions\\*.cdb", &fdata);
                                             ^
../gframe/game.cpp:63:50: error: ‘_findfirst’ was not declared in this scope
  fhandle = _findfirst("expansions\\*.cdb", &fdata);
                                                  ^
../gframe/game.cpp:67:34: error: ‘_findnext’ was not declared in this scope
   while(_findnext(fhandle, &fdata) != -1) {
                                  ^
../gframe/game.cpp:72:21: error: ‘_findclose’ was not declared in this scope
   _findclose(fhandle);
                     ^
make[1]: *** [../obj/Debug/ygopro/game.o] Error 1
make: *** [ygopro] Error 2

So, I assume this is either the wrong package, bad environment setup or further dependencies that I can't work out. Any help would be appreciated.

salix5 commented 9 years ago

b9b16259e6b555b5bbce12dfa44dbac44a838e5c I added #include in this commit, in order to use _findfirst, _findnext It works on Windows and Visual Studio 2010, but I'm not sure whether it works on Linux or not. Maybe this part needs to be modified.

d9e1812d1074174b162f245716d48ede61785cf2 The path of expansions is fixed in this commit

james-johns commented 9 years ago

Okay, so a little digging from your comment turns up _findfirst, _findnext et. al. being Windows specific. Reverting that commit allows the build to continue. Maybe this needs to be rewritten to be cross-platform compatible? I would be happy to take this on if you think it is appropriate.

salix5 commented 9 years ago

Thank you :)