Microsoft Visual C++ 2005

Moderator: Graf Zahl

Locked
User avatar
MartinHowe
Posts: 154
Joined: Tue Aug 30, 2005 22:07
Location: East Suffolk (UK)

Microsoft Visual C++ 2005

Post by MartinHowe »

This applies to all editions of Microsoft Visual C++ 2005 and to any GZDoom-specific source files (I have already left an almost-identically worded request on the ZDoom forums about this).

Graf please would you consider upgrading the GZDoom source code to be compliant with MSVC 2005 as soon as possible? This is now the "official" current C compiler from Microsoft, the one that replaces the old 2003 and V6 compilers.

Those "people" (must use a polite word there) at Microsoft have decided to deprecate half the standard C library due to buffer overruns and POSIX names. This makes compiling ZDoom and GZDoom very difficult due to the blizzard of warnings. In an ideal world, the code would be rewritten to overcome the problems properly, but of course that would take a lot of time.

Therefore at the very least, could a set of macros be loaded by EVERY source file in ZDoom and its dependencies that needs them in order to remove the warnings? In particular we do not want to permanently change the source to use the new ISO names as it would then screw up compilation with MinGW and Linux.

Below please find below the list of macros that are potentially needed as if they were in some globally included file. Of course some files (such as zlib) already redefine, for example, fdopen to be _fdopen so it isn't quite as simple as that, but the following should be a useful starting point.

Code: Select all

#if defined(_MSC_VER) && (_MSC_VER >= 1400)
#define _CRT_SECURE_NO_DEPRECATE
#define access      _access
#define cabs        _cabs
#define cgets       _cgets
#define chdir       _chdir
#define chmod       _chmod
#define chsize      _chsize
#define close       _close
#define cprintf     _cprintf
#define cputs       _cputs
#define creat       _creat
#define cscanf      _cscanf
#define cwait       _cwait
#define dup         _dup
#define dup2        _dup2
#define ecvt        _ecvt
#define eof         _eof
#define execl       _execl
#define execle      _execle
#define execlp      _execlp
#define execlpe     _execlpe
#define execv       _execv
#define execve      _execve
#define execvp      _execvp
#define execvpe     _execvpe
#define fcloseall   _fcloseall
#define fcvt        _fcvt
#define fdopen      _fdopen
#define fgetchar    _fgetchar
#define filelength  _filelength
#define fileno      _fileno
#define flushall    _flushall
#define fputchar    _fputchar
#define gcvt        _gcvt
#define getch       _getch
#define getche      _getche
#define getcwd      _getcwd
#define getpid      _getpid
#define getw        _getw
#define hypot       _hypot
#define inp         _inp
#define inpw        _inpw
#define isascii     __isascii
#define isatty      _isatty
#define iscsym      __iscsym
#define iscsymf     __iscsymf
#define itoa        _itoa
#define j0          _j0
#define j1          _j1
#define jn          _jn
#define kbhit       _kbhit
#define lfind       _lfind
#define locking     _locking
#define lsearch     _lsearch
#define lseek       _lseek
#define ltoa        _ltoa
#define memccpy     _memccpy
#define memicmp     _memicmp
#define mkdir       _mkdir
#define mktemp      _mktemp
#define open        _open
#define outp        _outp
#define outpw       _outpw
#define putch       _putch
#define putenv      _putenv
#define putw        _putw
#define read        _read
#define rmdir       _rmdir
#define rmtmp       _rmtmp
#define setmode     _setmode
#define sopen       _sopen
#define spawnl      _spawnl
#define spawnle     _spawnle
#define spawnlp     _spawnlp
#define spawnlpe    _spawnlpe
#define spawnv      _spawnv
#define spawnve     _spawnve
#define spawnvp     _spawnvp
#define spawnvpe    _spawnvpe
#define strcmpi     _stricmp
#define strdup      _strdup
#define stricmp     _stricmp
#define strlwr      _strlwr
#define strnicmp    _strnicmp
#define strnset     _strnset
#define strrev      _strrev
#define strset      _strset
#define strupr      _strupr
#define swab        _swab
#define tell        _tell
#define tempnam     _tempnam
#define toascii     __toascii
#define tzset       _tzset
#define ultoa       _ultoa
#define umask       _umask
#define ungetch     _ungetch
#define unlink      _unlink
#define wcsdup      _wcsdup
#define wcsicmp     _wcsicmp
#define wcsicoll    _wcsicoll
#define wcslwr      _wcslwr
#define wcsnicmp    _wcsnicmp
#define wcsnset     _wcsnset
#define wcsrev      _wcsrev
#define wcsset      _wcsset
#define wcsupr      _wcsupr
#define write       _write
#define y0          _y0
#define y1          _y1
#define yn          _yn
#endif
Comments please?
User avatar
Graf Zahl
GZDoom Developer
GZDoom Developer
Posts: 7148
Joined: Wed Jul 20, 2005 9:48
Location: Germany
Contact:

Post by Graf Zahl »

You want a comment?

Ok, here it is:

MSVC 2005 is not an officially supported compiler for GZDoom.
User avatar
MartinHowe
Posts: 154
Joined: Tue Aug 30, 2005 22:07
Location: East Suffolk (UK)

Post by MartinHowe »

Blimey that's a bit steep, I didn't expect the... well you get the idea :)

OK, for those poor saps who are stuck with MSVC 2005, here's what I did to get GZDoom to compile and run with it. (This assumes that you already know how set up the necessary libraries, unix-command-line-tools and so forth, just as you would have had to for MSVC7).

1. Open the gzdoom.sln file. It shows as a sort-of text-file-like icon with the number "7.1" on it. The IDE will force you to convert the files to the new formats and by default offers to create backup copies. Do so. The warnings in the log file can be ignored for now.

2. For each of the three projects (zlip, gzdoom and FLAC) open the project property pages and navigate to Configuration Properties, C/C++, Advanced.

3. Under Configuration: select all configurations.

4. In the Disable Specific Warnings setting, enter 4995;4996.

5. In the entire source archive, delete all .pch and .idb files. Also delete the existing Release and Debug directories in the zlib subdirectory.

6. Select the gzdoom project property pages and navigate to the Linker, Input page. Modify the "Additional Dependencies" setting and add DevIL.lib to it. Unlike with the warnings, you must do this SEPARATELY for the Release and Debug configurations.

7. Select the gzdoom project property pages and navigate to the Manifest Tool, Input and Output page. Modify the "Embed Manifest" setting to "No".

8. Build it and go kill some zombies with it :)

EDIT: Only need to add DevIL.lib to dependencies; delete Release and Debug directories from zlib when starting; fixed manifest problem (thanks Grubber).
Last edited by MartinHowe on Fri Mar 24, 2006 1:04, edited 3 times in total.
User avatar
Graf Zahl
GZDoom Developer
GZDoom Developer
Posts: 7148
Joined: Wed Jul 20, 2005 9:48
Location: Germany
Contact:

Post by Graf Zahl »

4) is probably a better solution than altering the source. I simply won't change the code because I can't test it myself.

6) ILU.lib and ILUT.lib are not needed. I do not link to these DLLs
User avatar
MartinHowe
Posts: 154
Joined: Tue Aug 30, 2005 22:07
Location: East Suffolk (UK)

Post by MartinHowe »

Graf Zahl wrote:6) ILU.lib and ILUT.lib are not needed. I do not link to these DLLs
OK I'll try it without those.

I'm curious, though: why can't you test it? The download for MS VS 2005 Express is free until November 7 2006 and that is all that am using; it doesn't take more than a few minutes to set it up to use the MS Platform SDK and can be installed alongside MS VS 2003. Then again, I'm not sure I would trust the latter point where Microsoft is concerned.

Whatever, problem solved, for release build. I'm still looking into a manifest-related problem with a debug build, but that's not a priority right now. The reason for my concern is simply that new MS VC buyers will be getting the 2005 version and all the n00bz (and cheapskates, me included for the moment) will download the Express version because it is free. At least this way, old programs can still be compiled with it.
User avatar
TheDarkArchon
Posts: 1000
Joined: Wed Jul 06, 2005 11:58
Location: What's that fucking smell
Contact:

Post by TheDarkArchon »

Doesn't VS.NET 2005 have a project converter wizard? I remember reading about it.
User avatar
MartinHowe
Posts: 154
Joined: Tue Aug 30, 2005 22:07
Location: East Suffolk (UK)

Post by MartinHowe »

TheDarkArchon wrote:Doesn't VS.NET 2005 have a project converter wizard? I remember reading about it.
Do you mean the bit in my original posting about how the IDE will force you to convert the (.sln etc) files to the new formats and by default offers to create backup copies? I have not found it making any other changes so far.
User avatar
MartinHowe
Posts: 154
Joined: Tue Aug 30, 2005 22:07
Location: East Suffolk (UK)

Post by MartinHowe »

The HOW-TO guide in the third message in this thread has been updated. As far as I can see, this is now the definitive guide to building GZDoom with MSVC 2005. If anybody has any suggested improvements, please reply to this thread.
Locked

Return to “Closed Feature Suggestions”