I finally got this to work under Windows, but because of the amount of time I spent trying to make this work, I am compelled to share my experiences and comments on doing so. I don't want others to waste nearly as much time as I did trying to make this work.
I was initially unsure whether to make this thread under Tutorials or here. I settled for here because I wanted to also make some comments on the build scripts and compatibility. Prior to simply asking in the QBMS Errors thread if there was a Windows specific build script, I could find no mention of there being one on aluigi.altervista.org nor in this forum. Nor could I find any mention of a user having attempted to compile under Windows.
I'll spare most the experience of wandering in the dark trying to build using the makefile prior, but much of the changes I had to make with the makefile were present in that batch script already. For future reference to curious individuals: Don't try to build under Windows with the Makefile. It's hell and you'll waste more time chasing dubious compilation errors than you may want to admit.
For convenience, I'll quote aluigi's build script here:
aluigi wrote:I use a .bat file for doing the whole compiling job on Windows using gcc 4:
http://aluigi.org/bms/compa.bat
I also made some minor edits to the script for convenience, readability, and a couple comments about compilation:
Some of the following might be common sense solutions for some readers, but I'd rather be thorough and complete than not.
Potential Pitfalls
1. Missing includes to library headers shipped with MinGW.
Code: Select all
src\quickbms.c:172:14: fatal error: openssl/crypto.h: No such file or directory
#include <openssl/crypto.h>
2. Missing includes for mcrypt and tomcrypt.
Add these include paths to the compilation script. (My modified script already has this addition.)
Code: Select all
-Isrc\libs\libmcrypt -Isrc\libs\libtomcrypt
3. Several "skipping incompatible" library errors while linking.
You're trying to use an x86_64 toolchain + libraries. Install the i686 toolchain and try with that.
4. Failure to link xcompress.lib
Code: Select all
ld.exe: xcompress.lib(obj/i386/lci.obj): warning: line number count (0x2) exceeds section size (0x1)
xcompress.lib(obj/i386/lci.obj): could not read symbols: Invalid operation
collect2.exe: error: ld returned 1 exit status
5. Undefined reference to `BCrypt_init`
It's possible that bcrypt.h has been included by another file (possibly wincrypt.h). I've observed this in both GCC 5 and GCC 6. So, unless you're Mr. Aluigi himself or you actually are attempting to build and test on a Win98 machine... It should be satisfactory enough to make these two changes and add -lbcrypt to the compilation script:
Code: Select all
// In file /src/myenc.c : Comment out the mybcrypt include and use MinGW's
//#include "extra/mybcrypt.h"
#include <bcrypt.h>
// [ ... About 110 lines below ... ]
//if(!BCrypt_init()) return -1; // The comment on this line in-file suggests only needed for Win98
Final Words
Could you put the batch script in an easy-to-find location... Like the page for quickbms on your site.