18 Sep, 2007, Ryanicus wrote in the 1st comment:
Votes: 0
I'm trying to "make" this codebase which is available here: http://www.awakenedworlds.net/index.php?... and I'm getting dozens of errors in each file such as these:

g++ -Dlinux -c -o pro_create.o pro_create.cpp
pro_create.cpp: In function 'void do_program(char_data*, char*, int, int)':
pro_create.cpp:314: warning: minimum/maximum operators are deprecated
g++ -Dlinux -c -o quest.o quest.cpp
g++ -Dlinux -c -o redit.o redit.cpp
redit.cpp: In function 'void redit_parse(descriptor_data*, char*)':
redit.cpp:883: warning: minimum/maximum operators are deprecated
redit.cpp:883: warning: minimum/maximum operators are deprecated
redit.cpp:888: warning: minimum/maximum operators are deprecated
redit.cpp:888: warning: minimum/maximum operators are deprecated
g++ -Dlinux -c -o screen.o screen.cpp
g++ -Dlinux -c -o shop.o shop.cpp
shop.cpp: In function 'void shopping_sell(char*, char_data*, char_data*, int)':
shop.cpp:1074: warning: minimum/maximum operators are deprecated
shop.cpp:1127: warning: minimum/maximum operators are deprecated

This continues with the same errors popping up on most of the files. I'm new to Ubuntu. I haven't encountered this problem in cygwin and I'm not sure what to do. Any help in translating this error would be greatly appreciated. Cheers.

-ryanicus
18 Sep, 2007, Guest wrote in the 2nd comment:
Votes: 0
Could you include the lines of code, and some surrounding material, so that we can see what's causing the warnings?

It's likely something silly that older gcc compilers used to let slide but don't now.
18 Sep, 2007, Caius wrote in the 3rd comment:
Votes: 0
Did you try contacting the author directly? His contact address is in the post you linked to.
18 Sep, 2007, Brinson wrote in the 4th comment:
Votes: 0
Those are warnings, it should compile with them…just spams the shit out of you.
18 Sep, 2007, kiasyn wrote in the 5th comment:
Votes: 0
-Werror is win
18 Sep, 2007, Ryanicus wrote in the 6th comment:
Votes: 0
Thanks for the replies. I am currently disucssing the issue with the distributor of the codebase as well. I wrongly attributed the "make" failure with the warnings. When I scroll up further there are errors that look like this for most of the files in src:


Makefile:126: vtable.d: No such file or directory
Makefile:126: weather.d: No such file or directory
Makefile:126: zedit.d: No such file or directory
set -e; gcc -MM -Dlinux zedit.cpp \
| sed 's/\(zedit\)\.o[ :]*/\1.o zedit.d : /g' > zedit.d; \
[ -s zedit.d ] || rm -f zedit.d
set -e; gcc -MM -Dlinux weather.cpp \
| sed 's/\(weather\)\.o[ :]*/\1.o weather.d : /g' > weather.d; \
[ -s weather.d ] || rm -f weather.d
set -e; gcc -MM -Dlinux vtable.cpp \
| sed 's/\(vtable\)\.o[ :]*/\1.o vtable.d : /g' > vtable.d; \
[ -s vtable.d ] || rm -f vtable.d

I have looked at the Makefile but, atm, I'm not seeing what's wrong. Hopefully you are laughing right now at my ignorance because the problem is so simple. :redface:
19 Sep, 2007, Mister wrote in the 7th comment:
Votes: 0
Those .d files seems to be storing dependencies for the makefile, so that you don't need to "make clean" if you modify a .h file. I guess you can ignore such warnings.

The "minimum/maximum" operators were an extension in gcc: <? for minimum and >? for maximum. They were deprecated, and I think removed in some recent version. So I guess they should be replaced with the UMIN/UMAX macros so common in Diku/Merc, or the standard std::min and std::max

As for the makefile, this is a simplified form of mine:
O_DIR := ../obj
EXEC := mrmud

C_FLAGS := -O2 -Wall -Wextra -Werror
L_FLAGS := -lz -lpthread

FILES := $(patsubst %.cpp,%,$(wildcard *.cpp))

.SUFFIXES:

$(EXEC): $(FILES:%=$(O_DIR)/%.o)
@rm -f $(EXEC)
@echo "Linking MUD …"
@g++ -o $(EXEC) $(FILES:%=$(O_DIR)/%.o) $(C_FLAGS) $(L_FLAGS)
@chmod 755 $(EXEC)

-include $(FILES:%=$(O_DIR)/%.d)

%.o $(O_DIR)/%.o : %.cpp
@echo "Compiling $*.cpp …"
@mkdir -p $(O_DIR)
@g++ -c -MMD -MP $(C_FLAGS) $*.cpp -o $(O_DIR)/$*.o

clean :
@echo "Removing temporal files …"
@rm -f $(O_DIR)/*.o $(O_DIR)/*.d

It compiles all .cpp files in the current directory, no need to list them, and takes care of dependencies, too.
19 Sep, 2007, Ryanicus wrote in the 8th comment:
Votes: 0
Thanks for the reference. I'm up and running.
0.0/8