27 Sep, 2008, Igabod wrote in the 1st comment:
Votes: 0
i just downloaded afkmud just to check it out and i'm currently compiling it but i'm seeing something that just doesn't reflect what i expect from samson and the smaug team. i'm seeing TONS of warnings… so many in fact that the compile is taking several minutes and it's still not done yet. i just now got to chess.o after 3 or so minutes of compiling. is this because i didn't uncomment something in the makefile or is it just because it's an abandoned project? i'm totally shocked to see something with samsons name on it have this many warnings considering everything else i've downloaded that he worked on compiled completely clean (once i figured out i needed to uncomment the cygwin stuff). hopefully this is just some sort of error on my part, i would hate to think samson would leave it in this state…

[edit]
ok 4 minutes after i posted this the compile finished with a bunch of errors at the end. this is very disappointing.
27 Sep, 2008, kiasyn wrote in the 2nd comment:
Votes: 0
what warnings, what errors, what version of compiler
27 Sep, 2008, Chris Bailey wrote in the 3rd comment:
Votes: 0
Yeah, you should really give some more detailed information if you would like to get any help. Continually suggesting that the author's work is poor is also a bad way of getting started.
27 Sep, 2008, Igabod wrote in the 4th comment:
Votes: 0
i never once suggested that samsons work is poor, i said i am shocked to see so many warnings in something samson did. that right there implies that i believe samson is a wonderful coder, and that i've never seen something done by him with ANY warnings, let alone a couple thousand. to answer the question of what warnings, and what compiler. i'm using the latest cygwin and there were just WAY too many warnings to even begin listing them, it took me about 9 or 10 minutes just to compile the thing. i was merely posting this to find out if anybody else has encountered this, i'm not looking to fix anything unless its a simple matter of uncommenting something in the makefile but i already have the cygwin bit uncommented.
27 Sep, 2008, Chris Bailey wrote in the 5th comment:
Votes: 0
Igabod: Sorry about my first post, I had just woken up to an angry wife. As far as providing more information goes, we still need a bit more. I will detail the things that we need to know.

Afkmud version:
Compier Version:
Errors:

We can work on figuring out the warnings later, for now we need the errors. Can you stick a copy of the compile up on pastebin? That will make it easier. I'm leaving right now and won't be back until this evening but with that information I'm sure somebody will be able to help you.
27 Sep, 2008, Remcon wrote in the 6th comment:
Votes: 0
On first compile ended up with alot of warnings and these errors
Compiling o/overland.o….
overland.cpp:31:16: gd.h: No such file or directory
overland.cpp:1419: error: `gdImagePtr' was not declared in this scope
overland.cpp:1419: error: expected primary-expression before "int"
overland.cpp:1419: error: expected primary-expression before "short"
overland.cpp:1419: error: expected primary-expression before "short"
overland.cpp:1419: error: expected primary-expression before "short"
overland.cpp:1420: error: initializer expression list treated as compound expres
sion
overland.cpp:1420: error: expected `,' or `;' before '{' token
overland.cpp:1426: error: `gdImagePtr' was not declared in this scope
overland.cpp:1426: error: expected primary-expression before "int"
overland.cpp:1427: error: initializer expression list treated as compound expres
sion
overland.cpp:1427: error: expected `,' or `;' before '{' token
overland.cpp: In function `void load_map_png(const char*, short int)':
overland.cpp:1484: error: `gdImagePtr' undeclared (first use this function)
overland.cpp:1484: error: (Each undeclared identifier is reported only once for
each function it appears in.)
overland.cpp:1484: error: expected `;' before "im"
overland.cpp:1505: error: `im' undeclared (first use this function)
overland.cpp:1505: error: `gdImageCreateFromPng' undeclared (first use this func
tion)
overland.cpp:1507: error: `gdImageSY' undeclared (first use this function)
overland.cpp:1509: error: `gdImageSX' undeclared (first use this function)
overland.cpp:1511: error: `gdImageGetPixel' undeclared (first use this function)

overland.cpp:1512: error: `get_sector_colour' cannot be used as a function
overland.cpp:1517: error: `gdImageDestroy' undeclared (first use this function)
overland.cpp: In function `void save_map_png(const char*, short int)':
overland.cpp:2823: error: `gdImagePtr' undeclared (first use this function)
overland.cpp:2823: error: expected `;' before "im"
overland.cpp:2829: error: `im' undeclared (first use this function)
overland.cpp:2829: error: `gdImageCreate' undeclared (first use this function)
overland.cpp:2832: error: `gdImageColorAllocate' undeclared (first use this func
tion)
overland.cpp:2842: error: `gdImageLine' undeclared (first use this function)
overland.cpp:2858: error: `gdImagePng' undeclared (first use this function)
overland.cpp:2868: error: `gdImageDestroy' undeclared (first use this function)
make[2]: *** [o/overland.o] Error 1

Looks like need to install the gd stuff in cygwin to continue (gd, libgd-devel, libgd2)

After that heres what it gives
Compiling o/imc.o….
/usr/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/bits/stl_list.h: In function `void
imcban(char_data*, std::string)':
/usr/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/bits/stl_list.h:435: warning: '__p
' might be used uninitialized in this function
/usr/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/bits/stl_list.h: In function `void
imcignore(char_data*, std::string)':
/usr/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/bits/stl_list.h:435: warning: '__p
' might be used uninitialized in this function
/usr/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/bits/stl_list.h: In function `void
imc_readbans()':
/usr/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/bits/stl_list.h:435: warning: '__p
' might be used uninitialized in this function
/usr/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/bits/stl_list.h: In function `bool
imc_load_commands()':
/usr/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/bits/stl_list.h:435: warning: '__p
' might be used uninitialized in this function
/usr/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/bits/stl_vector.h: In member funct
ion `std::vector<_Tp, _Alloc>& std::vector<_Tp, _Alloc>::operator=(const std::ve
ctor<_Tp, _Alloc>&) [with _Tp = std::string, _Alloc = std::allocator<std::string
>]':
/usr/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/bits/stl_vector.h:715: warning: '_
_result' might be used uninitialized in this function
/usr/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/bits/stl_uninitialized.h:82: warni
ng: '__cur' might be used uninitialized in this function
/usr/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/bits/stl_uninitialized.h:82: warni
ng: '__cur' might be used uninitialized in this function
/usr/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/bits/stl_list.h: In function `void
imccedit(char_data*, std::string)':
/usr/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/bits/stl_list.h:435: warning: '__p
' might be used uninitialized in this function
/usr/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/bits/stl_list.h: In function `void
imc_loadchar(char_data*, FILE*, const char*)':
/usr/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/bits/stl_list.h:435: warning: '__p
' might be used uninitialized in this function
Compiling o/act_comm.o….
act_comm.cpp: In function `std::string act_string(const std::string&, char_data*
, char_data*, const void*, const void*, int)':
act_comm.cpp:1203: warning: cast from `const void*' to `char_data*' discards qua
lifiers from pointer target type
act_comm.cpp:1204: warning: cast from `const void*' to `obj_data*' discards qual
ifiers from pointer target type
act_comm.cpp:1205: warning: cast from `const void*' to `obj_data*' discards qual
ifiers from pointer target type
act_comm.cpp:1252: warning: cast from `const void*' to `char*' discards qualifie
rs from pointer target type
act_comm.cpp:1262: warning: cast from `const void*' to `char*' discards qualifie
rs from pointer target type
act_comm.cpp:1357: warning: cast from `const void*' to `char*' discards qualifie
rs from pointer target type
act_comm.cpp:1363: warning: cast from `const void*' to `char*' discards qualifie
rs from pointer target type
act_comm.cpp: In function `void act(short int, const std::string&, char_data*, c
onst void*, const void*, int)':
act_comm.cpp:1405: warning: cast from `const void*' to `char_data*' discards qua
lifiers from pointer target type
act_comm.cpp:1406: warning: cast from `const void*' to `char_data*' discards qua
lifiers from pointer target type
act_comm.cpp:1407: warning: cast from `const void*' to `obj_data*' discards qual
ifiers from pointer target type
act_comm.cpp:1408: warning: cast from `const void*' to `obj_data*' discards qual
ifiers from pointer target type
Compiling o/act_info.o….
/usr/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/bits/stl_list.h: In function `void
do_ignore(char_data*, std::string)':
/usr/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/bits/stl_list.h:435: warning: '__p
' might be used uninitialized in this function
/usr/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/bits/stl_list.h: In member functio
n `void pc_data::load_ignores(FILE*)':
/usr/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/bits/stl_list.h:435: warning: '__p
' might be used uninitialized in this function
Compiling o/act_move.o….
Compiling o/act_obj.o….
Compiling o/act_wiz.o….
act_wiz.cpp: In function `void do_bodybag(char_data*, std::string)':
act_wiz.cpp:1753: warning: 'owner' might be used uninitialized in this function
Compiling o/archery.o….
Compiling o/area.o….
Compiling o/areaconvert.o….
Compiling o/auction.o….
Compiling o/ban.o….
Compiling o/bits.o….
/usr/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/bits/stl_tree.h: In member functio
n `typename std::_Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::_Link_type
std::_Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::_M_copy(const std::_R
b_tree_node<_Val>*, std::_Rb_tree_node<_Val>*) [with _Key = int, _Val = std::pai
r<const int, std::string>, _KeyOfValue = std::_Select1st<std::pair<const int, st
d::string> >, _Compare = std::less<int>, _Alloc = std::allocator<std::pair<const
int, std::string> >]':
/usr/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/bits/stl_tree.h:1029: warning: '__
top' might be used uninitialized in this function
/usr/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/bits/stl_tree.h:365: warning: '__t
mp' might be used uninitialized in this function
Compiling o/boards.o….
Compiling o/build.o….
Compiling o/calendar.o….
Compiling o/channels.o….
Compiling o/character.o….
Compiling o/chess.o….
Compiling o/clans.o….
Compiling o/color.o….
Compiling o/comm.o….
Compiling o/commands.o….
/usr/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/bits/stl_uninitialized.h: In membe
r function `void std::vector<_Tp, _Alloc>::_M_fill_insert(__gnu_cxx::__normal_it
erator<typename _Alloc::pointer, std::vector<_Tp, _Alloc> >, size_t, const _Tp&)
[with _Tp = std::vector<cmd_type*, std::allocator<cmd_type*> >, _Alloc = std::a
llocator<std::vector<cmd_type*, std::allocator<cmd_type*> > >]':
/usr/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/bits/stl_uninitialized.h:82: warni
ng: '__cur' might be used uninitialized in this function
/usr/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/bits/stl_uninitialized.h:82: warni
ng: '__cur' might be used uninitialized in this function
Compiling o/comments.o….
Compiling o/connhist.o….
Compiling o/const.o….
Compiling o/db.o….
Compiling o/deity.o….
Compiling o/descriptor.o….
descriptor.cpp: In member function `bool descriptor_data::write(const char*)':
descriptor.cpp:332: warning: cast from `const char*' to `unsigned char*' discard
s qualifiers from pointer target type
Compiling o/editor.o….
Compiling o/environment.o….
Compiling o/event.o….
Compiling o/event_handler.o….
Compiling o/features.o….
Compiling o/fight.o….
Compiling o/finger.o….
Compiling o/handler.o….
Compiling o/hashstr.o….
Compiling o/help.o….
Compiling o/hotboot.o….
Compiling o/imm_host.o….
Compiling o/liquids.o….
Compiling o/magic.o….
magic.cpp: In function `ch_ret spell_animate_dead(int, int, char_data*, void*)':

magic.cpp:3870: warning: 'corpse' might be used uninitialized in this function
Compiling o/mapout.o….
Compiling o/mapper.o….
Compiling o/md5.o….
Compiling o/misc.o….
Compiling o/mobindex.o….
Compiling o/modules.o….
Compiling o/mspecial.o….
mspecial.cpp: In function `bool summon_if_hating(char_data*)':
mspecial.cpp:208: warning: 'victim' might be used uninitialized in this function

/usr/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/bits/stl_list.h: In function `void
load_specfuns()':
/usr/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/bits/stl_list.h:435: warning: '__p
' might be used uninitialized in this function
Compiling o/mudcfg.o….
Compiling o/mud_comm.o….
Compiling o/mud_prog.o….
Compiling o/new_auth.o….
Compiling o/object.o….
Compiling o/objindex.o….
Compiling o/olcmob.o….
Compiling o/olcobj.o….
Compiling o/olcroom.o….
Compiling o/overland.o….
overland.cpp: In function `ch_ret process_exit(char_data*, short int, short int,
short int, int, bool)':
overland.cpp:2165: warning: 'pexit' might be used uninitialized in this function

Compiling o/pfiles.o….
Compiling o/player.o….
/usr/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/bits/stl_list.h: In member functio
n `void char_data::update_visits(room_index*)':
/usr/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/bits/stl_list.h:435: warning: '__p
' might be used uninitialized in this function
/usr/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/bits/stl_list.h: In member functio
n `void pc_data::load_zonedata(FILE*)':
/usr/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/bits/stl_list.h:435: warning: '__p
' might be used uninitialized in this function
Compiling o/polymorph.o….
Compiling o/rare.o….
Compiling o/renumber.o….
Compiling o/reset.o….
Compiling o/roomindex.o….
Compiling o/save.o….
Compiling o/search.o….
Compiling o/sha256.o….
Compiling o/ships.o….
Compiling o/shops.o….
Compiling o/skills.o….
/usr/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/bits/stl_tree.h: In member functio
n `typename std::_Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::_Link_type
std::_Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::_M_copy(const std::_R
b_tree_node<_Val>*, std::_Rb_tree_node<_Val>*) [with _Key = std::string, _Val =
std::pair<const std::string, int>, _KeyOfValue = std::_Select1st<std::pair<const
std::string, int> >, _Compare = string_sort, _Alloc = std::allocator<std::pair<
const std::string, int> >]':
/usr/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/bits/stl_tree.h:1029: warning: '__
top' might be used uninitialized in this function
/usr/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/bits/stl_tree.h:365: warning: '__t
mp' might be used uninitialized in this function
Compiling o/skyship.o….
Compiling o/slay.o….
Compiling o/tables.o….
Compiling o/track.o….
Compiling o/treasure.o….
Compiling o/update.o….
Compiling o/variables.o….
Compiling o/web.o….
/usr/lib/gcc/i686-pc-cygwin/3.4.4/../../../../i686-pc-cygwin/bin/ld: warning: au
to-importing has been activated without –enable-auto-import specified on the co
mmand line.
This should work unless it involves constant data structures referencing symbols
from auto-imported DLLs.Info: resolving __timezone by linking to __imp___timezo
ne (auto-import)
Generating dependency file …
Done building AFKMud.

Buidling DNS Resolver…
make -s resolver
Done buidling DNS Resolver.

Some of the warnings can and should be fixed but some are in include files and you can't fix through the afkcode :)
27 Sep, 2008, ShadowsDawn wrote in the 7th comment:
Votes: 0
Also Igabod, there is a reason people were trying to steer you away from Cygwin,
and get you to either dual boot your system, use something like andLinux, get
set up with a free host, or best yet.. blow away that windows partition and go full
on Linux.

Yes Cygwin can function as a *nix environment to help learn, and do some general coding.
However, many of the projects written for *nix systems have a hard time compiling.
Granted a lot of these can be fixed as it is due to having to d/l pieces one at a time,
but if you are using Cygwin to compile code and it errors, your first stop should be
to check what libraries you are missing. Honestly, that is true for any compile job, but
even more so for Cygwin. Unless you have written the code yourself, and know exactly
what libraries are linked in and needed, you should always check the error messages first
for signs that you are missing something rather than suggest something is wrong with the
code.
27 Sep, 2008, Guest wrote in the 8th comment:
Votes: 0
Quote
/usr/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/bits/stl_list.h: In member functio
# n `void char_data::update_visits(room_index*)':


Stuff like that is beyond my control. Those are being reported by the C++ library itself. One thing you should probably have been able to pick up on immediately knowing the history of the site you got it from is that none of those warnings triggered an error and aborted the compile. The -Werror flag is something I use religiously to catch new stuff. But when compiling in Cygwin it had to be disabled because there's no way to compile the code otherwise.

Quote
mspecial.cpp: In function `bool summon_if_hating(char_data*)':
mspecial.cpp:208: warning: 'victim' might be used uninitialized in this function


You got me as to why this is even being reported. It does not come up when compiling with gcc 4, which is the target platform for the codebase. It might be worth looking into if you can get gcc 4 in Cygwin, and if not, seriously consider abandoning it as a platform in favor of andlinux or one of the other solutions. It should be becoming quite obvious at this point that the platform is to blame, not the code.
27 Sep, 2008, David Haley wrote in the 9th comment:
Votes: 0
Samson said:
Quote
mspecial.cpp: In function `bool summon_if_hating(char_data*)':
mspecial.cpp:208: warning: 'victim' might be used uninitialized in this function

You got me as to why this is even being reported.

Because the compiler is being cautious. To see that victim will always have a value when it's used, you have to note that 'found' is set to false, and 'victim' is only used if 'found' is true – which will only happen if victim has some value in it. I'm not sure why it would not be seeing that before and would suddenly be seeing it now, though.
27 Sep, 2008, Guest wrote in the 10th comment:
Votes: 0
DavidHaley said:
Because the compiler is being cautious. To see that victim will always have a value when it's used, you have to note that 'found' is set to false, and 'victim' is only used if 'found' is true – which will only happen if victim has some value in it. I'm not sure why it would not be seeing that before and would suddenly be seeing it now, though.


Well apparently this is caution that GNU figured out how to parse with later versions of the compiler than gcc 3.4 which is why it doesn't come up in a current compiler.
27 Sep, 2008, David Haley wrote in the 11th comment:
Votes: 0
I'm not convinced that they were doing it right before and suddenly started doing it wrong. I think they're just improving their static analysis and it's finding something that it didn't find before, but it's not smart enough to realize that it's not actually a problem. Contrast with not finding it in the first place.
27 Sep, 2008, Guest wrote in the 12th comment:
Votes: 0
No no, I'm saying they're doing it RIGHT now and WRONG before by being able to detect this particular type of situation and know that the variable is initialized in the one place it's used.
27 Sep, 2008, David Haley wrote in the 13th comment:
Votes: 0
Oh… he was using an older version of gcc, not a very-new one? My compiler (4.2) doesn't emit a warning here but I thought he might be using 4.3. In that case good on gcc for figuring this one out.
27 Sep, 2008, Remcon wrote in the 14th comment:
Votes: 0
$ gcc -v
Reading specs from /usr/lib/gcc/i686-pc-cygwin/3.4.4/specs
Configured with: /usr/build/package/orig/test.respin/gcc-3.4.4-3/configure –ver
bose –prefix=/usr –exec-prefix=/usr –sysconfdir=/etc –libdir=/usr/lib –libe
xecdir=/usr/lib –mandir=/usr/share/man –infodir=/usr/share/info –enable-langu
ages=c,ada,c++,d,f77,pascal,java,objc –enable-nls –without-included-gettext –
enable-version-specific-runtime-libs –without-x –enable-libgcj –disable-java-
awt –with-system-zlib –enable-interpreter –disable-libgcj-debug –enable-thre
ads=posix –enable-java-gc=boehm –disable-win32-registry –enable-sjlj-exceptio
ns –enable-hash-synchronization –enable-libstdcxx-debug
Thread model: posix
gcc version 3.4.4 (cygming special, gdc 0.12, using dmd 0.125)

So yea it is an older version of gcc in cygwin. I wasn't posting to point out issues just that it seems to compile fine as long as you have the things you need in cygwin (even though there are some warnings)
28 Sep, 2008, Igabod wrote in the 15th comment:
Votes: 0
i just typed up a long reply to all of this and tried to preview it but due to an intermittent wireless connection i lost everything so i'll just summarize by saying the following and hoping it doesn't get lost too.

i thought 4.1 was the latest gcc cause thats what cygwin lists as the latest. i'm definately gonna switch to andlinux now due to all the problems i'm encountering with cygwin. i don't know how to copy/paste from cygwin, but thats a moot point now because i'm getting andLinux. i'm hung over so i can't remember what else i typed but i accept chris baileys apology for his earlier response refering to me saying samsons work was shoddy or something like that. and now i'm gonna go take some asprin and get some food from Sonic to try and get rid of this hangover.
28 Sep, 2008, Fizban wrote in the 16th comment:
Votes: 0
Quote
i don't know how to copy/paste from cygwin,


Right click the title bar, click properties, check the box for insert mode.
0.0/16