suggestion for "windows tba"

Login to reply  Page: « < 1 of 1 > »
06 Feb 2010 - 20:252310
suggestion for "windows tba"
Compiling in windows I think can be a bit daunting for a newcomer, especially with the hundreds of silly warnings you get. Especially if (by mistake) there ever happens to be a single compiler *ERROR*, it tends to get obscured along with the million warnings, and someone who is new would probably just assume its messed and will not work. This little addendum to README.MSVC2008 is pretty hidden and easy to miss:

To eliminate warnings like these:
  warning C4996: 'strcpy': This function or variable may be unsafe.
  warning C4996: 'getch': The POSIX name for this item is deprecated.
Do this:
  In Solution Explorer
  Right click the 'project'
  Select 'Properties' which brings up the Property Pages dialog
  Expand 'Configuration Properties'
  Expand 'C/C++'
  Click on Preprocessor
  At the end of the 'Preprocessor Definitions' add:
  ;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE 

So why don't we just remove it, and then in conf.h.win just make the change automatically
#ifndef _CONF_H_
#define _CONF_H_

#define CIRCLE_WINDOWS

+/* Windows complains about standard functions like strcmp() */
+#define _CRT_SECURE_NO_DEPRECATE
+#define _CRT_NONSTDC_NO_DEPRECATE 

/* Define to empty if the keyword does not work.  */
#undef const

/* Define if you don't have vprintf but do have _doprnt.  */
#undef HAVE_DOPRNT

/* Define if you have <sys/wait.h> that is POSIX.1 compatible.  */
#undef HAVE_SYS_WAIT_H

Although disabling those warnings is technically "optional", I can't imagine anyone who could stand seeing all those warnings every time they compile; it really hides any actual errors/warnings that should NOT be ignored.


__________________
The Augmented Dimension
( A fantasy hack/slash Circle 3.1 derivative )
frostmud.com 8228
08 Feb 2010 - 00:452320
Added, I've heard others complain about this too. Thanks for the additions.


__________________
Rumble
The Builder Academy
tbamud.com 9091
15 Feb 2010 - 19:502343
One problem I just realized with my alternative when I was making a windows executable of ugradMUD for one of my builders is this:

if you put the defines in conf.h.win they only apply to the .c files that include it (most do)

to make things worse, it seems that doesn't even work for some files that do include the conf.h.win file

but if you do it the way the README file currently says to do it, it's universal and works

please ignore my suggestion, -sorry about that


__________________
The Augmented Dimension
( A fantasy hack/slash Circle 3.1 derivative )
frostmud.com 8228

Last edited by Kyle (15 Feb 2010 - 19:55)
15 Feb 2010 - 22:232346
Updated, thanks for the attempt, too bad it can't be easier.


__________________
Rumble
The Builder Academy
tbamud.com 9091
Login to reply  Page: « < 1 of 1 > »