dgcor / DGEngine

An implementation of the Diablo 1 game engine
Other
243 stars 30 forks source link

How to Complile the project #13

Closed pengyz closed 5 years ago

pengyz commented 7 years ago

I try to compile the engine,but I failed. I think This project is difficulity to compile. I must download the dependents myself. Also ,the compile of sfeMovie is hard beacuse it based on ffmpeg. I don't know how to do. I installed MSYS2 on my windows10 and I use USE_SFML_MOVIE_STUB macro for fix,but the sfeMovie-d.lib always needed.

Is there anyone can help me? I have tried many times,but always got errors.

ghost commented 7 years ago

Hi there, You don't need MSYS2. On Linux it's easier as the dependencies come from the package managers.

I'm guessing you're using the provided Visual Studio solution. You must set the USE_SFML_MOVIE_STUB like you did, but because that project includes sfeMovie-d.lib and you don't have it, remove it from the linker dependencies and it should be OK.

You do this in:

Properties -> Linker -> Input -> Additional Dependencies

I'll update the project in the future and add a profile to compile without sfeMovie to make things simpler.

Another option is to generate a new visual studio solution using CMake, but I don't recommend this on Windows, as making SFML/PhysFS detectable by CMake isn't straightforward, unfortunately.

Edit: The latest commit (3edb6b4) adds a new VS profile to compile without movie support.

inukaze commented 7 years ago

i am trying to compile it under GNU/Linux

[DGEngine]$ mkdir build ; cd build ; cmake ..
-- The C compiler identification is GNU 5.3.0
-- The CXX compiler identification is GNU 5.3.0
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
CMake Error at /usr/share/cmake-3.7/Modules/FindPackageHandleStandardArgs.cmake:138 (message):
  Could NOT find PhysFS (missing: PHYSFS_LIBRARY PHYSFS_INCLUDE_DIR)
Call Stack (most recent call first):
  /usr/share/cmake-3.7/Modules/FindPackageHandleStandardArgs.cmake:378 (_FPHSA_FAILURE_MESSAGE)
  /usr/share/cmake-3.7/Modules/FindPhysFS.cmake:49 (FIND_PACKAGE_HANDLE_STANDARD_ARGS)
  CMakeLists.txt:307 (find_package)

-- Configuring incomplete, errors occurred!
See also "/media/Compartido/Software/Liñux/src/git/DGEngine/build/CMakeFiles/CMakeOutput.log".

================================================================================

On my Slackware64 14.2 :

Compile :

git clone https://github.com/dgengin/DGEngine
cd DGEngine
su -c "slpkg -s slonly physfs" root
su -c "slpkg -s slonly SFML" root
mkdir build ; cd build ; cmake ..
make

Try to run it

./DGEngine DIABDAT.MPQ 
std::exception

in the wiki you specify "gamefiles" file, but from where came this file, and this is a single text file with what type of content ??? this don't exist when i compile DGEngine, and the Diablo 1 Installation not have that file.

ghost commented 7 years ago

Hi There, Please refer to https://github.com/dgengin/DGEngine/blob/master/BUILD.txt

There, you'll see that you need to install PhysFS before.

sudo apt-get install libphysfs-dev sudo apt-get install libsfml-dev

Afterwards, you run it using

./DGEngine gamefiles

Where gamefiles is the folder provided in the repo with the game files.

See https://github.com/dgengin/DGEngine/wiki for more information.

Note that you won't be able to use DIABDAT.MPQ if you install PhysFS this way. I provide a version of PhysFS with MPQ support. Use that one or extract the files into a DIABDAT folder or use a DIABDAT.zip. See the wiki for instructions.

https://github.com/dgengin/physfs

inukaze commented 7 years ago

Ok thanks now i try to do the follow :

su -c "slpkg -r physfs" root
git clone https://github.com/dgengin/physfs
cd physfs/
mkdir build ; cd build ; cmake -DCMAKE_INSTALL_PREFIX:PATH=/usr .. ; make
su -c "make install" root
cd ../..
git clone https://github.com/dgengin/DGEngine
cd DGEngine
mkdir build ; cd build ; cmake .. ; make

Well your suggestions is i should extract all content from the MPQ file, an use extracted or commpressed in zip file? cannot be a 7z file?

Okey i had recompile the engine with your physfs from this git repo :

./DGEngine gamefiles DIABDAT.MPQ 
./DGEngine: error while loading shared libraries: libphysfs.so.1: cannot open shared object file: No such file or directory

mkdir libs64
cd libs64
cp /usr/lib/libphysfs.so.2.1.0 .
ln -s "libphysfs.so.2.1.0" "libphysfs.so.1"
ln -s "libphysfs.so.1" "libphysfs.so"
cd ..
export LD_LIBRARY_PATH="$PWD/libs64"
./DGEngine gamefiles DIABDAT.MPQ

Nothing Happen. i try to reinstall Diablo to extract again the MPQ file.

I Reinstall, i extract the content with the Util your say on the page, y make a Zip File i try one more time :

export LD_LIBRARY_PATH="$PWD/libs64"
./DGEngine gamefiles DIABDAT.ZIP

Nothing happend again.

Something weird happend, i run various times FreeAblo now i try to run again DGEnine and now is working ./DGEngine gamefiles

just with that for run it Here my Screenshot : DGEngine.png

:D FreeAblo and this proyects are awesomes, As a dream does not cost anything, I would like both projects to merge to make a 100% native open source engine that works with Diablo + Hellfire, and has a limiter to 1 CPU and an FPS limiter (15, 25, 30) Because sometimes they both go too fast.

Although they are work in progress, thank you for carrying them out, and I hope you do not abandon them as the developers of Q-Gears (Final Fantasy VII Engine)

mewmew commented 5 years ago

I think this issue can be closed. If other users get compilation errors after following the instructions in BUILD.txt then a new issue can be opened.