After spending hours trying to get PAR-Packer installed using Visual Studio on Windows 7, here's the magic formula that finally worked for me. Hopefully this will help someone else with the same problem.
1) First you need to fix some source files. Open main.c from the "myldr" directory in the PAR-Packer directory you extracted from the tar.gz archive (
here).
Remove the declaration "int argno = 0" from line 116, and put it just after the "main" definition, like this:
int main ( int argc, char **argv, char **env )
{
int exitstatus;
int i;
int argno = 0;
...
Next, add the following block just after the first line in myldr/mktmpdir.c :
#ifdef _MSC_VER
#define snprintf _snprintf
#if _MSC_VER < 1500
#define vsnprintf _vsnprintf
#else
#define ssize_t SSIZE_T
#define uint32_t UINT32
#endif
#define strncasecmp _strnicmp
#define strcasecmp _stricmp
#else
#ifdef __MINGW32__
#define WINSOCK_VERSION MAKEWORD(2,0)
#else
#define strncasecmp strnicmp
#define strcasecmp stricmp
#endif /* __MINGW32__ */
#endif /* _MSC_VER */
Remember to save both files.
(thanks to
this for both of these tips)
2) Open up the command prompt from the Visual Studio directory, NOT the normal command prompt. There should be a link under Start-->All Programs-->Microsoft Visual Studio 2005-->Visual Studio Tools-->Visual Studio 2005 Command Prompt.
3) From this command prompt, navigate to the PAR-Packer directory.
4) Enter the following command: 'perl Makefile.pl'
5) Enter the following command: 'nmake'
This will result in an error.
6) Enter the following command: 'nmake test'
7) Enter the following command again: 'nmake'
8) Enter the following command: 'nmake install'
Once again, this worked for me while using Visual Studio 8, Windows 7, and Perl 5.10.0. It might work for other versions.