Creative Man
Creative Man

Reputation: 21

How to compile 7-zip with visual studio 2015 rc

I downloaded the latest source code of 7-zip in order to compile it locally using Visual Studio 2015 RC but i got this errors messages when i was compiling it:

C:\7zip\CPP\7zip\UI\GUI>nmake NEW_COMPILER=1 MY_STATIC_LINK=1

Microsoft (R) Program Maintenance Utility Version 14.00.22816.0
Copyright (C) Microsoft Corporation. Tous droits réservés.

        cl   -DLANG  -DEXTERNAL_CODECS -DWIN_LONG_PATH -DSUPPORT_DEVICE_FILE -D_
7ZIP_LARGE_PAGES -DUNICODE -D_UNICODE -Gr -nologo -c -FoO/ -W4 -WX -EHsc -Gy -GR
- -MT -GS- -Zc:forScope -MP2 -O1 -Yu"StdAfx.h" -FpO/a.pch ../../../Common\Lang.c
pp ../../../Common\Wildcard.cpp
Lang.cpp
Wildcard.cpp
../../../Common\Wildcard.cpp(3): error C2220: avertissement considéré comme une
erreur - aucun fichier 'object' généré
../../../Common\Lang.cpp(3): error C2220: avertissement considéré comme une erre
ur - aucun fichier 'object' généré
../../../Common\Wildcard.cpp(3): warning C4652: option du compilateur 'prise en
charge des vérifications de la sécurité (/GS)' non cohérente avec l'en-tête préc
ompilé ; l'option active de ligne de commande se substituera à celle définie dan
s l'en-tête précompilé
../../../Common\Lang.cpp(3): warning C4652: option du compilateur 'prise en char
ge des vérifications de la sécurité (/GS)' non cohérente avec l'en-tête précompi
lé ; l'option active de ligne de commande se substituera à celle définie dans l'
en-tête précompilé
../../../Common\Wildcard.cpp(3): warning C4651: '/D_DLL' spécifié pour l'en-tête
 précompilé mais non pour la compilation active
../../../Common\Lang.cpp(3): warning C4651: '/D_DLL' spécifié pour l'en-tête pré
compilé mais non pour la compilation active
../../../Common\Lang.cpp(144): warning C4456: la déclaration de 's' masque la dé
claration locale précédente
../../../Common\Lang.cpp(144): note: to simplify migration, consider the tempora
ry use of /Wv:18 flag with the version of the compiler with which you used to bu
ild without warnings
../../../Common\Lang.cpp(123): note: voir la déclaration de 's'
../../../Common\Wildcard.cpp(543): warning C4456: la déclaration de 'front' masq
ue la déclaration locale précédente
../../../Common\Wildcard.cpp(543): note: to simplify migration, consider the tem
porary use of /Wv:18 flag with the version of the compiler with which you used t
o build without warnings
../../../Common\Wildcard.cpp(482): note: voir la déclaration de 'front'
NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual Studio 14.0
\VC\BIN\cl.EXE"' : code retour '0x2'
Stop.

I followed this steps in order to compile it but with no luck: http://www.ski-epic.com/2012_compiling_7zip_on_windows_with_visual_studio_10/index.html

The main steps:

Set up the environment variables using "c:\Program Files (x86)\Microsoft Visual Studio 11.0\Common7\Tools\vsvars32.bat"
Edit C:\7zsrc\CPP\Build.mak to remove "-OPT:NOWIN98" from line 34
Run C:\7zsrc\CPP\7zip\nmake NEW_COMPILER=1 MY_STATIC_LINK=1

Where is the problem here please ?

Upvotes: 2

Views: 3369

Answers (1)

an odder guest
an odder guest

Reputation: 194

I followed the instructions on http://www.ski-epic.com/2012_compiling_7zip_on_windows_with_visual_studio_10/index.html, which you outlined in your "main steps" codebox, and was successful. I noticed that those instructions are a little out of date, as the source code is now distributed in a .7z file. So the "bunzip2" method is unnecessary for unpacking.

One thing I did slightly differently (than what you did) was to use a different path to the vsvars32.bat file. I have multiple versions of visual studio express installed on my system, the most recent being VS2015 express. I checked the possible paths and used the one that was most recent. In my case it was:

"C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\Tools\vsvars32.bat"

I noticed that the MS PMU version was slightly newer than yours:

Microsoft (R) Program Maintenance Utility Version 14.00.23918.0

You might try obtaining VS1015 express, (not the RC version). I understand that the latest version of Visual Studio is VS2017 (and is now available), I haven't tried that yet.

Regarding the error messages you posted, you seem to be having an issue with the pre-compiled headers (mismatching some declarations) and treating warnings as errors. Was this your first attempt at compilation? Perhaps previous attempts made some changes to the default settings that are causing problems now. I suggest you remove the source folder and any residue the previous compilation attempts produced, and unpack a clean copy of the source files.

Note: There is a related question here: Cannot compile 7zip under MSVC2012, but it doesn't seem to address your issue.

Upvotes: 1

Related Questions