Here goes

Posted by Viruz on Tue 05 Feb 2002 01:37 AM — 4 posts, 17,821 views.

#0
Well got this piece of what i would have thought would have been great code
trying to compile. did the config thing and all (not a complete idiot)

then


bash-2.05$ make
c++ -c -Wall -g -O  com_time.cpp -o obj/com_time.o
c++: com_time.cpp: No such file or directory
c++: No input files
*** Error code 1

Stop in /home/mud/dawn (line 44 of /home/mud/dawn/makefile).

bash-2.05$ ls -l com*
-rw-r--r--  1 mud  mud    2246 Dec 29 08:36 com_time.cpp
-rw-r--r--  1 mud  mud   16048 Dec 29 08:36 comedit.cpp
-rw-r--r--  1 mud  mud    1850 Dec 29 08:36 comedit.h
-rw-r--r--  1 mud  mud  114538 Dec 29 16:00 comm.cpp
-rw-r--r--  1 mud  mud   12029 Dec 29 08:36 comm.h
bash-2.05$


so I know I have the file

Looking in makefile



	dawn: $(sort $(O_FILES))
>>>> LINE 44>>>>       	$(CPP) -c $(C_FLAGS) com_time.cpp -o $(OBJDIR)/com_time.o
	        -rm -f ../dawn
	        $(CPP) $(L_FLAGS) $(LIBS) -o ../dawn \
	                $(addprefix $(OBJDIR)/,$(O_FILES)) $(OBJDIR)/com_time.o


the line looks ok to me
So i look at the bottom of the makefile and see a blurb about openbsd and using gmake,
which is what I use and honestly I think everyone should use :) (security is precious)

and I get this error


c++ -c -Wall -g -O  comm.cpp -o obj/comm.o
comm.cpp: In function `int main(int, char **)':
comm.cpp:613: implicit declaration of function `int closesocket(...)'
gmake: *** [comm.o] Error 1



So I compile it again so see if i get more errors using the ignore error option

bash# gmake -i
c++ -c -Wall -g -O  comm.cpp -o obj/comm.o
comm.cpp: In function `int main(int, char **)':
comm.cpp:613: implicit declaration of function `int closesocket(...)'
gmake: [comm.o] Error 1 (ignored)

******
more code going ok
******

descript.cpp: In method `void descriptor_data::dclose()':
descript.cpp:211: implicit declaration of function `int closesocket(...)'
gmake: [descript.o] Error 1 (ignored)

******
more code going ok
******

hreboot.cpp: In function `void hotreboot_game_environment_transfer()':
hreboot.cpp:528: implicit declaration of function `int closesocket(...)'
gmake: [hreboot.o] Error 1 (ignored)

******
more code going ok
******

save.cpp: In function `void fwrite_char(char_data *, FILE *)':
save.cpp:318: passing `long int *' as argument 1 of `ctime(const time_t *)'
save.cpp:436: warning: long int format, int arg (arg 3)
gmake: [save.o] Error 1 (ignored)



so the culprit is closesocket.



Well heres a little background
OpenBSD 3.0
tried both dawnsrc1.69o and dawnsrc1.69p
No problems compiling anything including smaug
tried the same code in cygwin (fresh install and freshly untarred code unix style) no luck in cygwin

I noticed in another post someone mentioned build 1.69q, haven't been able to find it



I probably won't get an answer but it's worth a try
Amended on Tue 05 Feb 2002 01:48 AM by Viruz
Australia Forum Administrator #1
You would have got different errors in Cygwin? I got it to compile after making a couple of changes, as documented in one of my recent posts.

Meanwhile, to compile under OpenBSD, which I have just done (dawnsrc1.69p) ...

1. Change makefile, line 7 to read:

C_FLAGS = -Wall $(PROF) $(NOCRYPT) -Dunix

This works around the closesocket problem by defining the "unix" define.

2. Change save.cpp, line 333, to read:

sprintf( time_buf,"%s", (char *) ctime((time_t *) &ch->id));

Basically this casts the ch->id to the correct type for ctime.

This should then compile and link (just type gmake) however I also get errors compiling the resolver which I haven't investigated yet. However I believe you can run without that. :)
#2
Nick I thank you for the reply. and will try that asap.

you are always on the ball. :)

Anyway is my understanding that resolver is just an ip to domain resolver of those connecting to you ?

if so is there just a simple way to just not have it at all compile(I hate seeing errors) since i really don't care either way if i see an ip or domain of those connected to me?
Australia Forum Administrator #3
Quote:

Anyway is my understanding that resolver is just an ip to domain resolver of those connecting to you ?


Yes, I believe so.

Quote:

if so is there just a simple way to just not have it at all compile


You may as well fix the actual error. :) I didn't have time to investigate yesterday, but it is related to the need for the "unix" define. Edit the file "makefile" and add the extra bit in bold at around lines 50 to 51.


../resolver: extras/resolver.cpp
    $(CPP) -o ../resolver  $(C_FLAGS) extras/resolver.cpp