Guide: Compiling ResidualVM on Windows
Moderator: ScummVM Team
- JohnnyWalker2001
- Posts: 405
- Joined: Mon Oct 16, 2006 1:27 pm
- Location: London, UK
Guide: Compiling ResidualVM on Windows
Ok, thanks to KuroShiro, here's a complete guide to compiling ResidualVM on Windows.
Install GIT
Git is a version control system and you can download it here:
http://git-scm.com/
When you install it, make sure you choose the option that adds to PATH. After that choose the recommended options for Windows.
Get ResidualVM's source code from GitHub
Once you have GIT installed with a PATH set up correctly, go to the command prompt, navigate to the PARENT directory you'd like your "ResidualVM" directory to be in and type:
git clone https://github.com/residualvm/residualvm.git
It should then download the latest source into the current directory.
In future, to update the sources to the latest version, you can type:
git pull
Install MingW
This is a necessary step. Download and install MingW from:
http://www.mingw.org/
(It's a bit confusing: Go to "Downloads" and then look for the .exe link near "Looking for the latest version?")
Choose:
C++
and
MingW Developer Tookit (including MSYS)
Next is probably the most confusing part... Open up the command prompt in Windows and type 'path'. Make sure that all the MinGW directories are there. It should contain (assuming you installed to C:\MinGW)
';C:\MinGW\bin;C:\MinGW\libexec\gcc\mingw32\4.5.2;C:\MinGW\msys\1.0\bin'
at the end. Those should have been added by the install program, but if not, you'll have to add them manually. To do this, go to Computer -> System properties -> Advanced System Settings (it's on the left). Then click on the Environment Variable button, and in the bottom dialog box scroll down until you see the PATH variable, and double click it. Then add the directories listed above, making sure to have a semi colon before all the directory names.
You now have the ResidualVM source and a compiler, but you need libraries before you can compile and make a ResidualVM.exe.
Install SDL Development Libraries
Download the SDL Libraries from here:
http://www.libsdl.org/release/SDL-devel ... w32.tar.gz
Extract the files to a directory on your computer, then move the contents of the following folders to their respective MingW folders:
include\ to c:\MingW\include\
lib\ to c:\MingW\lib\
bin\ to c:\MingW\bin\
Install zlib
Despite what the ResidualVM site says, you apparently need zlib installed, too. This is another fiddly step, but not too difficult.
Download zlib from:
http://www.zlib.net/
(You want the source code, not the DLL.)
Copy the contents of the zlib source archive to a temporary folder, e.g. "c:\zlib".
Now open up MSYS. This is done by going to MingW Shell in your START menu. A window should open that looks very much like the normal command prompt.
Type the following:
cd /c/zlib
make -f win32/makefile.gcc
After the code has compiled type:
cp -p libz.a /c/mingw/lib
cp -p zlib.h zconf.h /c/mingw/include
Done!
(Here's a guide to the basic commands of MSYS, if you're confused: https://users.cs.jmu.edu/bernstdh/Web/c ... /index.php)
Compile ResidualVM
You need to go into MingW Shell (aka MSYS) again.
Simply navigate to your ResidualVM directory in the MingW Shell (see the above guide if you need help on that) and type:
./configure && make
At the end of the process you should have a (rather large) ResidualVM.exe in your ResidualVM folder. You've just compiled ResidualVM!
To strip out all the unnecessary debug gubbins and make a smaller, more efficient executable, type:
strip residual.exe
And you're done!
Install GIT
Git is a version control system and you can download it here:
http://git-scm.com/
When you install it, make sure you choose the option that adds to PATH. After that choose the recommended options for Windows.
Get ResidualVM's source code from GitHub
Once you have GIT installed with a PATH set up correctly, go to the command prompt, navigate to the PARENT directory you'd like your "ResidualVM" directory to be in and type:
git clone https://github.com/residualvm/residualvm.git
It should then download the latest source into the current directory.
In future, to update the sources to the latest version, you can type:
git pull
Install MingW
This is a necessary step. Download and install MingW from:
http://www.mingw.org/
(It's a bit confusing: Go to "Downloads" and then look for the .exe link near "Looking for the latest version?")
Choose:
C++
and
MingW Developer Tookit (including MSYS)
Next is probably the most confusing part... Open up the command prompt in Windows and type 'path'. Make sure that all the MinGW directories are there. It should contain (assuming you installed to C:\MinGW)
';C:\MinGW\bin;C:\MinGW\libexec\gcc\mingw32\4.5.2;C:\MinGW\msys\1.0\bin'
at the end. Those should have been added by the install program, but if not, you'll have to add them manually. To do this, go to Computer -> System properties -> Advanced System Settings (it's on the left). Then click on the Environment Variable button, and in the bottom dialog box scroll down until you see the PATH variable, and double click it. Then add the directories listed above, making sure to have a semi colon before all the directory names.
You now have the ResidualVM source and a compiler, but you need libraries before you can compile and make a ResidualVM.exe.
Install SDL Development Libraries
Download the SDL Libraries from here:
http://www.libsdl.org/release/SDL-devel ... w32.tar.gz
Extract the files to a directory on your computer, then move the contents of the following folders to their respective MingW folders:
include\ to c:\MingW\include\
lib\ to c:\MingW\lib\
bin\ to c:\MingW\bin\
Install zlib
Despite what the ResidualVM site says, you apparently need zlib installed, too. This is another fiddly step, but not too difficult.
Download zlib from:
http://www.zlib.net/
(You want the source code, not the DLL.)
Copy the contents of the zlib source archive to a temporary folder, e.g. "c:\zlib".
Now open up MSYS. This is done by going to MingW Shell in your START menu. A window should open that looks very much like the normal command prompt.
Type the following:
cd /c/zlib
make -f win32/makefile.gcc
After the code has compiled type:
cp -p libz.a /c/mingw/lib
cp -p zlib.h zconf.h /c/mingw/include
Done!
(Here's a guide to the basic commands of MSYS, if you're confused: https://users.cs.jmu.edu/bernstdh/Web/c ... /index.php)
Compile ResidualVM
You need to go into MingW Shell (aka MSYS) again.
Simply navigate to your ResidualVM directory in the MingW Shell (see the above guide if you need help on that) and type:
./configure && make
At the end of the process you should have a (rather large) ResidualVM.exe in your ResidualVM folder. You've just compiled ResidualVM!
To strip out all the unnecessary debug gubbins and make a smaller, more efficient executable, type:
strip residual.exe
And you're done!
Last edited by nuphonic on Tue Aug 16, 2011 12:54 pm, edited 4 times in total.
Well, I can give you a simple guide to how I do it. First, get the source from the git repository. You can do this using the git program and a command line ('git clone https://github.com/residualvm/residualvm.git', or just 'git pull' if you've already cloned the repository), or some other repo checker.
Next, you'll need a compiler. I use MinGW with msys -- you can get it here. Make sure you choose to install the C++ compiler and the msys dtk. I suggest installing into C:\MinGW.
Next is probably the most confusing part... open up the command line in windows by typing cmd.exe in the run menu, and then type 'path'. Make sure that all the MinGW directories are there. It should contain (assuming you installed to C:\MinGW) ';C:\MinGW\bin;C:\MinGW\libexec\gcc\mingw32\4.5.2;C:\MinGW\msys\1.0\bin' at the end. Those should have been added by the install program, but if not, you'll have to add them manually. To do this, go to Computer->System properties->Advanced System Settings (it's to the left). Then click on the Environment Variable button, and in the bottom dialog box scroll down until you see the PATH variable, and double click it. Then add the directories listed above, making sure to have a semi colon before all the directory names.
Phew, ok, once it's installed, you will need to install the SDL development libraries. Copy the contents of the /bin and /include directories in the .tar.gz file (you can extract it with 7zip) into the corresponding directories wherever you installed MinGW. Other than that, there's a few more optional libraries you can install (such as ogg, flac, and mp3 support, zlib for compressing save games, etc). For info on that, you can check the guide on the ScummVM Wiki which talks about installing other optional libraries.
Once you're ready, just type './configure && make' and ResidualVM will compile. Afterwards you might want to also use 'strip ./residual.exe' to decrease the size of the .exe file.
Next, you'll need a compiler. I use MinGW with msys -- you can get it here. Make sure you choose to install the C++ compiler and the msys dtk. I suggest installing into C:\MinGW.
Next is probably the most confusing part... open up the command line in windows by typing cmd.exe in the run menu, and then type 'path'. Make sure that all the MinGW directories are there. It should contain (assuming you installed to C:\MinGW) ';C:\MinGW\bin;C:\MinGW\libexec\gcc\mingw32\4.5.2;C:\MinGW\msys\1.0\bin' at the end. Those should have been added by the install program, but if not, you'll have to add them manually. To do this, go to Computer->System properties->Advanced System Settings (it's to the left). Then click on the Environment Variable button, and in the bottom dialog box scroll down until you see the PATH variable, and double click it. Then add the directories listed above, making sure to have a semi colon before all the directory names.
Phew, ok, once it's installed, you will need to install the SDL development libraries. Copy the contents of the /bin and /include directories in the .tar.gz file (you can extract it with 7zip) into the corresponding directories wherever you installed MinGW. Other than that, there's a few more optional libraries you can install (such as ogg, flac, and mp3 support, zlib for compressing save games, etc). For info on that, you can check the guide on the ScummVM Wiki which talks about installing other optional libraries.
Once you're ready, just type './configure && make' and ResidualVM will compile. Afterwards you might want to also use 'strip ./residual.exe' to decrease the size of the .exe file.
- JohnnyWalker2001
- Posts: 405
- Joined: Mon Oct 16, 2006 1:27 pm
- Location: London, UK
- JohnnyWalker2001
- Posts: 405
- Joined: Mon Oct 16, 2006 1:27 pm
- Location: London, UK
Those are basically Linux commands. I guess I did sort of miss one step -- if you follow exactly what I said, after installing all the programs, you have to run the msys program (it is a command line shell, similar to Linux), navigate to the directory where you have the source code, and then type that. That scummvm wiki page I linked has a bunch of info about using msys. I have no idea about Netbeans.JohnnyWalker2001 wrote:Well even if I follow KuroShiro's instructions to the letter, where do I type "./configure && make"?
- JohnnyWalker2001
- Posts: 405
- Joined: Mon Oct 16, 2006 1:27 pm
- Location: London, UK
- JohnnyWalker2001
- Posts: 405
- Joined: Mon Oct 16, 2006 1:27 pm
- Location: London, UK
-
- Posts: 1
- Joined: Mon Jan 23, 2012 1:50 pm
Compiling error: zero-size array
Everything went swimmingly until I tried to compile ResidualVM. It hit a snag here:I'm installing on Win 7 Ultimate SP1 64bit.
Any suggestions?
Code: Select all
C++ audio/audiostream.o
audio/audiostream.cpp:64:1: error: zero-size array 'Audio::STREAM_FILEFORMATS'
make: *** [audio/audiostream.o] Error 1
Any suggestions?
A few notes, zlib isn't required, but you won't get videos without it, and it has to have the proper defines done for that (which configure does, and create_project SHOULD do). If this is not the case, do tell how it doesnt work, so we can try to fix it. (although, large parts of the game are videos, so you wouldn't really want to build without zlib anyhow.)
Currently we have a dependency on MAD, which might explain the above post, this dependency is only an error, as yes, mad is required for audio in EMI, but not for anything in GRIM, FLAC and OGG are not used for anything IIRC.
Currently we have a dependency on MAD, which might explain the above post, this dependency is only an error, as yes, mad is required for audio in EMI, but not for anything in GRIM, FLAC and OGG are not used for anything IIRC.
- JohnnyWalker2001
- Posts: 405
- Joined: Mon Oct 16, 2006 1:27 pm
- Location: London, UK
- JohnnyWalker2001
- Posts: 405
- Joined: Mon Oct 16, 2006 1:27 pm
- Location: London, UK
Re: Guide: Compiling ResidualVM on Windows
2015 update!
I am attempting to build in Windows and want to document my progress thus far.
Have run in to a ton of issues during first attempt. Here's what I did (definitely a lot of mistakes):
1. Started with this MinGW install: http://nuwen.net/mingw.html
That includes a few of the libs and so it looked like it would save time in the long run. Also appears to be up to date instead of http://www.mingw.org/
Extracted to C:\MinGW
2. I then also grabbed the MSYS package as well (http://nuwen.net/files/mingw/msys-10.4.7z)
Extracted to C:\MSYS then ran extract.bat
3. The above MinGW distro included SDL 2 but this project uses SDL 1.2, so I followed other steps to get this version and extract to MinGW dir:
https://www.libsdl.org/release/SDL-deve ... w32.tar.gz
4. WEIRD STUFF
-If you just run MSYS it won't know about MinGW paths, I followed the fstab hint here: http://www.mingw.org/wiki/Getting_Started
-Even then, ./configure wasn't finding libjpeg, zlib, etc. I realized that MSYS needs to have additional paths set, so first either do set_distro_paths.bat or run msys.bat from open_distro_window.bat.
-./configure was spitting out some sed errors on sdl-config (see http://www.cplusplus.com/forum/general/77110/). I followed the advice there and by deleting/renaming C:\MinGW\bin\sed.exe that issue went away (wtf).
-At this point compilation got started but I am now getting this:
...and calling it a night. Any ideas?
E: possible hints: http://www.enderboi.com/log.php?log=scu ... ormat=html
E2: aaand solution: --disable-taskbar option in configure!
5. This updated MinGW has 64 bit support, so I needed to copy bin/include/lib from http://sourceforge.net/projects/mingw-w ... z/download to C:\MinGW\x86_64-w64-mingw32
...and then at run-time you will also need to 64 bit dll: https://www.libsdl.org/release/SDL-1.2.15-win32-x64.zip
6. SUCCESS!!
I am attempting to build in Windows and want to document my progress thus far.
Have run in to a ton of issues during first attempt. Here's what I did (definitely a lot of mistakes):
1. Started with this MinGW install: http://nuwen.net/mingw.html
That includes a few of the libs and so it looked like it would save time in the long run. Also appears to be up to date instead of http://www.mingw.org/
Extracted to C:\MinGW
2. I then also grabbed the MSYS package as well (http://nuwen.net/files/mingw/msys-10.4.7z)
Extracted to C:\MSYS then ran extract.bat
3. The above MinGW distro included SDL 2 but this project uses SDL 1.2, so I followed other steps to get this version and extract to MinGW dir:
https://www.libsdl.org/release/SDL-deve ... w32.tar.gz
4. WEIRD STUFF
-If you just run MSYS it won't know about MinGW paths, I followed the fstab hint here: http://www.mingw.org/wiki/Getting_Started
-Even then, ./configure wasn't finding libjpeg, zlib, etc. I realized that MSYS needs to have additional paths set, so first either do set_distro_paths.bat or run msys.bat from open_distro_window.bat.
-./configure was spitting out some sed errors on sdl-config (see http://www.cplusplus.com/forum/general/77110/). I followed the advice there and by deleting/renaming C:\MinGW\bin\sed.exe that issue went away (wtf).
-At this point compilation got started but I am now getting this:
Code: Select all
C++ backends/taskbar/win32/win32-taskbar.o
backends/taskbar/win32/win32-taskbar.cpp: In member function 'virtual void Win32
TaskbarManager::addRecent(const Common::String&, const Common::String&)':
backends/taskbar/win32/win32-taskbar.cpp:312:21: error: 'SHARD_LINK' was not dec
lared in this scope
SHAddToRecentDocs(SHARD_LINK, link);
^
Makefile.common:105: recipe for target 'backends/taskbar/win32/win32-taskbar.o'
failed
make: *** [backends/taskbar/win32/win32-taskbar.o] Error 1
E: possible hints: http://www.enderboi.com/log.php?log=scu ... ormat=html
E2: aaand solution: --disable-taskbar option in configure!
5. This updated MinGW has 64 bit support, so I needed to copy bin/include/lib from http://sourceforge.net/projects/mingw-w ... z/download to C:\MinGW\x86_64-w64-mingw32
...and then at run-time you will also need to 64 bit dll: https://www.libsdl.org/release/SDL-1.2.15-win32-x64.zip
6. SUCCESS!!